不同版本.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>
相关推荐
小羊没烦恼!1 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
神仙别闹1 天前
基于C#+MySQL实现(WinForm)个人聊天室软件
c#
kybs19911 天前
全球灾害数据分析可视化 毕业设计-附源码66794
vue.js·spring boot·mysql·安全·django·c#·asp.net
Polevne1 天前
C# SFTP客户端实现文件传输
c#·ssh
samble1 天前
从零搭建灌装监控系统(四):深色主题与样式系统,ResourceDictionary 统一管理
c#·wpf·mvvm·样式·工业控制
_Jonas1 天前
.net framework开发环境正式环境配置文件的切换
.net·wpf
cjp5601 天前
024 . WPF MVVM类封装优化
c#
淡海水2 天前
13-04-面试-源码级深度追问链
数据结构·unity·面试·c#·游戏引擎·源码·il2cpp
asdzx672 天前
如何使用 C# 提取 PPT 文本与图片
c#·ppt·提取文本
2501_930707782 天前
使用C#代码使用条件格式为 Excel 隔行设置颜色
c#·excel