I need to use some classes from another project. How can I just import or create a reference to that project in Visual Studio?
Right now if I use "Add reference" in Visual Studio, I get the error:
".NET Core projects only support referencing .NET framework assemblies in this release. <br/>
To reference other assemblies they need to be included in a NuGet package"
NET Standard support - it can't, as it doesn't even support async/await . You need to upgrade to . NET 4.6.
Move Your Project File You can migrate your old project to the Core project using the 'dotnet migrate; command, which migrates the project. json and any other files that are required by the web application. The dotnet migrate command will not change your code in any way.
.NET Core works with dependencies via NuGet.
If your projects are in the same solution, then yes, you can add a reference using the Visual Studio UI ("Add reference" command). A background reference will be added as a NuGet package.
Manually you can do this by adding <ProjectReference>
section to the .csproj
file:
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" />
Otherwise, you should pack your project into a NuGet package (use the dotnet pack command) and then add it as other NuGet packages. If you do not use any public NuGet sources, you can host your own NuGet feed.
You have the next error:
".NET Core projects only support referencing .NET framework assemblies in this release.
To reference other assemblies they need to be included in a NuGet package"
Because you are trying to add a .NET project to a .NET Core project or wise versa. Look into this issue for more details:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With