Are there any better ways to copy a native dll to the bin folder?

前端 未结 6 1049
别跟我提以往
别跟我提以往 2020-12-01 09:15

I have C# wrapper code that calls functions from a native (C++) dll. Currently, I can add a reference to the C# dll and have set the \'Copy Local\' option to true. However t

6条回答
  •  自闭症患者
    2020-12-01 10:06

    Found a better way. Nuget can add .targets files, witch are stored in the build folder of the package, into your project. With this way you can copy at each build some files of your package wherever you want. In the following example, I have stored some Non DotNet DLL into a "binaries" folder. At each build, It checks if DLLs are already copied in the output folder ($OutputPath variable) and copy them if necessary.

    Nuspec content :

    
    
        
            Example
            1.0.0
            Example
            false
            Example
        
        
            
            
            
        
    
    

    Example.targets content :

    
        
            
                 
            
    
            
        
    
    

提交回复
热议问题