with the release of the .net core i have been trying to build a simple project, however whenever i try and add a dll reference in my project i get the following message
".Net Core Projects only support Referencing .Net Framework assemblies in this release To Reference other assemblies they need to be included in nuget package and reference that package"
i was getting this message in RC2 but not in RC1, is anyone else having this issue and does anyone know how to resolve it? i have not been able to find anything relating to this other than a git issue ticket https://github.com/aspnet/Home/issues/1612
For referencing external dll in .net core you need to create you own nuget package.
The NuGet docs show how to create a package from a dll:https://docs.nuget.org/create/hosting-your-own-nuget-feeds . You can put that nuget package in a local folder and use that as a feed: [https://docs.nuget.org/create/hosting-your-own-nuget-feeds]
For this you need to edit the nuspec file and add the following code in the nuspec file.
<package>
*******--Some code--*****
<metadata>
<references>
<reference file="xxx.dll"/>
</references>
</metadata>
<--For addig reference of external dll-->
<files>
<file src="path\*.dll" target="lib\netCoreApp1.0"/>
</files>
Now create .nupkg file and install this package in your project.
Hope this solution works for you.
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