0
votes

I am trying to build a .net core API using MVC, but I am trying to add it to an application that was not build on ASP.NET Core. When I try and configure the interfaces to be used in the core app (Setup.cs) I am not able to reference the interface. When trying reference the solution within the core app, I get the error

"The following projects are not supported as references: [solution name] has target frameworks that are incompatible with the targets in current project.

.NETCoreApp,Version=1.0 .NETFramework,Version=v4.5

What is the best way to be able to reference a .NETFramework project within a .NETCore project?

1
You can't reference an assembly that is higher than the framework of the referencing assembly (you can go down, though). In other words, a ASP.NET Core project could reference a .NET 4.6 project. - Tim
Is that not what I am attempting to do? Within my ASP.NET Core project, I want to reference a project in .NET 4.5? Is that not down referencing? - Brandon Turpy
Just because you're using the ASP.NET Core application framework doesn't mean you're building on .NET Core. - mason
Ah, I misread the direction, sorry. This should work, though there may be a trick to referencing non .NET Core assemblies in .NET Core. - Tim

1 Answers

0
votes

from comment above I realized it was not possible. I was not able to use the .net standard version in my core app.