Targetting different Frameworks using MSBuild gives problems with dependencies

前端 未结 2 466
失恋的感觉
失恋的感觉 2021-02-11 06:27

I have a little project, and I want to have 2 compiled versions of that project:

  • one that is targetting the .NET 2.0 framework
  • one that is targetting the
2条回答
  •  故里飘歌
    2021-02-11 07:07

    I've been able to solve this problem by making sure that I do not reference assemblies from the GAC. Instead, I've created a 'lib' directory in my project that contains the 3rd party assemblies. In my solution, I reference the 3rd party assemblies from there, and set copy local==True.

    Next to that, you must also make sure that in your csproj file, the referenced assemblies have a Private tag whose value is set to true. Like this:

    
       False
       ...
       True
    
    

提交回复
热议问题