“Target Framework” in Visual Studio

烈酒焚心 提交于 2019-12-13 21:44:00

问题


What actually happens when you target the .NET 3.5 framework in Visual Studio? What does that actually do? Does it somehow "flag" any of the output files and associate them with the framework version?


回答1:


It sets an attribute in the .csproj file:

<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>

and updates any references to namespaces if they require the newer version:

<Reference Include="System.Core">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>

This tells the compiler which version of the namespace and hence dll it needs to link against.



来源:https://stackoverflow.com/questions/2202425/target-framework-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!