.net core 1.0 visual studio referencing external dll

前端 未结 1 1257
一生所求
一生所求 2020-12-15 09:25

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

相关标签:
1条回答
  • 2020-12-15 10:06

    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.

    0 讨论(0)
提交回复
热议问题