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

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

重点是:不能有其他的

netstandard2;net40;net45;net46;net6

javascript 复制代码
<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>
相关推荐
动感光博3 小时前
Unity(URP渲染管线)的后处理、动画制作、虚拟相机(Virtual Camera)
开发语言·人工智能·计算机视觉·unity·c#·游戏引擎
hie988945 小时前
C#与KepOPC通讯
开发语言·c#
hweiyu006 小时前
C#学习教程(附电子书资料)
开发语言·学习·c#
csdn_aspnet8 小时前
C# DataGridView 选中所有复选框
c#·winform·datagridview
白露与泡影9 小时前
基于Mongodb的分布式文件存储实现
分布式·mongodb·wpf
qq_2979080110 小时前
c#车检车构客户管理系统软件车辆年审短信提醒软件
sqlserver·c#·开源软件
酷炫码神11 小时前
C#数组与集合
开发语言·c#
钢铁男儿11 小时前
C# 深入理解类(静态函数成员)
java·开发语言·c#
CoderIsArt20 小时前
参数系统的基类Parameter抽象类
c#
盛夏绽放1 天前
Python字符串常用方法详解
开发语言·python·c#