How to specify output folder for the referenced nuget packages?

前端 未结 2 824
半阙折子戏
半阙折子戏 2021-01-21 04:40

I have a project with some nuget packages referenced.

In output folders (bin\\Debug or bin\\Release), all referenced libraries lie next to the

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-21 04:56

    Grace to the zivkan's investigation I found the answer. Traditional project has target CopyFilesToOutputDirectory which depends on _CopyFilesMarkedCopyLocal target. In this last one we have task Copy:

    
    

    And here I found metadata DestinationSubDirectory which is exactly what I need to change.

    So finally

    First, we need to change csproj file and add these lines:

      
        
          lib\
        
      
    

    Second, we need to change app.config file to let the assembly know the path to the libraries:

      
        
          
        
      
    

    That's all. All referenced libraries will be copied into subfolder lib

提交回复
热议问题