不同版本.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>
相关推荐
Risehuxyc1 小时前
HttpClient怎么传POST参数
c#
光泽雨1 天前
控件Password附加属性
wpf
zdr尽职尽责4 天前
UnityCli 兼容2022版本
ui·unity·ai·c#·游戏引擎
BruceNeter5 天前
C# winform卡死问题分析1——线程池子线程创建句柄
c#·.net
samble6 天前
从零搭建半导体设备上位机(十二):参数设置页,表单校验、范围校验与配方联动
wpf·数据校验·validationrule
何以解忧唯有撸码7 天前
开源】当桌面图标开始打台球:我用 WinForms 做了一桌“真的”台球
c#·winform·自定义控件·gdi
国家一级摸鱼选手7 天前
[Unity]几何碰撞检测:SAT 分离轴定理详解(从数学原理到 C# 实现)
unity·c#·游戏引擎·分离轴定理(sat)·多边形相交
汤姆宝库8 天前
BPE分词器的完整实现:字节对合并与词表构建
开发语言·人工智能·c#
Risehuxyc8 天前
C# 发展历史
开发语言·c#
kyle~8 天前
C# --- 反射
开发语言·c#