Dnx451 actually means .net 4.5

I have created two projects using Visual Studio 2015 RC

  • class library MyLib

    for which the target framework is.NET Framework 4.5.1

  • ASP.NET 5 project MyWebApp

    that is referenced MyLib

    in project.json

    :

    "frames": {"dnx451": {"dependencies": {"Lib01": "1.0.0- *"}},}

When I try to create MyWebApp

a warning appears:

MSB3274: Main link "C: \ MyWebApp \ src \ MyLib \ bin \ Debug \ MyLib.dll" could not be resolved because it was built within ".NETFramework, Version = v4.5.1". This is a higher version than the current target environment ".NETFramework, Version = v4.5".

The warning goes away if I change the target structure MyLib

to 4.5.

Seems to be MyWebApp

targeting .net framework 4.5 and not 4.5.1? How to MyWebApp

reference targeting .net 4.5.1 library?

+3


source to share


1 answer


This warning doesn't seem to mean much. It still shows up even if the .net version of the web project is installed more than a library for example.

"net46": {                
  "dependencies": {
    "Lib01": "1.0.0-*"
  }
}

      

Another interesting possibility to build a library with .NET Framework 4.6 (latest) and still build / run and use classes from the dnx451 project (I went through read-only in 4.6 since IReadOnlyCollection from lib to web application).



Also, as far as I know .net 4.5.1 made no changes for the API and it is not very easy to check the difference between 4.5 and 4.5.1

And finally, if you want to get rid of the warning, you can create a class library like vNext (Package) and then pass it from an ASP.NET 5 application, so your class library can use dnx451 in the same way as a web application.

0


source







All Articles