不同版本.net引用同一个项目

项目文件.csproj文件内容如下:

重点是:不能有其他的

netstandard2;net40;net45;net46;net6

不同版本.net引用同一个项目_第1张图片

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFrameworks>netstandard2;net40;net45;net46;net6</TargetFrameworks>
   </PropertyGroup>
	
	<ItemGroup Condition="'$(TargetFramework)'=='net40' OR '$(TargetFramework)'=='net45' OR '$(TargetFramework)'=='net46'">
		<Reference Include="System" />
		<Reference Include="System.Core" />
		<Reference Include="Microsoft.CSharp" />
		<Reference Include="System.Data" />
	</ItemGroup>

	<ItemGroup Condition="'$(TargetFramework)'=='net45' OR '$(TargetFramework)'=='net46'">
		<Reference Include="System.ComponentModel.DataAnnotations" />
	</ItemGroup>
	
  <ItemGroup>
    <Folder Include="Http\" />
    <Folder Include="Log\" />
    <Folder Include="Ftp\" />
    <Folder Include="File\" />
    <Folder Include="EncryDecry\" />
    <Folder Include="FileZip\" />
  </ItemGroup>

</Project>

你可能感兴趣的:(WinForm,WPF,C#,c#,wpf)