Vb.net 在项目文件中设置TargetFrameworkVersion后,未定义System.Runtime.Versioning.TargetFrameworkAttribute
我正在尝试在两个.net版本之间对项目进行多目标定位。我像这样编辑了.vbproj文件Vb.net 在项目文件中设置TargetFrameworkVersion后,未定义System.Runtime.Versioning.TargetFrameworkAttribute,vb.net,clr,.net-4.5,Vb.net,Clr,.net 4.5,我正在尝试在两个.net版本之间对项目进行多目标定位。我像这样编辑了.vbproj文件 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'GP2010|AnyCPU'"> <ReferencePath>\\server\references\newcrystal</ReferencePath>3 <TargetFrameworkVersion>v2.0</Target
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'GP2010|AnyCPU'">
<ReferencePath>\\server\references\newcrystal</ReferencePath>3
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<OutputPath>bin\GP2010\</OutputPath>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'GP2015|AnyCPU'">
<ReferencePath>\\server\references\gp2015</ReferencePath>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<OutputPath>bin\GP2015\</OutputPath>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
我在%temp%中打开该文件,没有发现任何错误
Option Strict Off
Option Explicit On
Imports System
Imports System.Reflection
<Assembly: Global.System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.1", FrameworkDisplayName:="")>
尝试让运行时接收它,但这没有什么区别
我还尝试从这个问题中添加GenerateTargetFrameworkMonitorAttribute,但似乎没有帮助,但我可能放错了位置
Option Strict Off
Option Explicit On
Imports System
Imports System.Reflection
<Assembly: Global.System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.1", FrameworkDisplayName:="")>
Imports System.Runtime.Versioning