How to create a nuget package with both release and debug dll's using nuget package explorer?

后端 未结 3 1634
半阙折子戏
半阙折子戏 2020-12-09 04:32

I\'m using the Nuget Package Explorer to create some nuget packages. I\'ve managed to do so just building a project in Release mode in VS and adding both the dll and pdb fil

3条回答
  •  时光说笑
    2020-12-09 04:50

    Inspired by @Tewr I've found a cumbersome but a working solution.

    Create a nuget with the following file structure:

    lib\net\$(Configuration)\YourLib.1.0.0.dll    <---- put here some dummy file  named YourLib.1.0.0.dll
    tools\release\YourLib.1.0.0.dll  <--- put here the release version
    tools\debug\YourLib.1.0.0.dll  <--- put here the debug version
    build\YourLib.targets  
    

    The targets file content:

    
         
        
        
        
        
        
    
    

    The dlls in lib folder will be automatically added as references creating the following in the project file:

    
                                                            
提交回复
热议问题