不同版本.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>
相关推荐
高彬44 分钟前
SAP ECC6.0 对接 C# web Services服务
开发语言·前端·c#·sap
半亩码田1 小时前
C#转Python第4.4篇:JSON 处理:json 模块 vs System.Text.Json
python·c#·json
geovindu11 小时前
CSharp: 万年历
开发语言·后端·c#·.net
离陌在学C#18 小时前
C# 异步编程:从 async/await 到 Task 实战指南
开发语言·数据库·c#
用户298698530141 天前
PDF 转 HTML 全攻略:三种方法轻松搞定网页转换
c#·html·.net
geovindu1 天前
CSharp: State Pattern
开发语言·后端·c#·.net·状态模式·行为模式
俊昭喜喜里1 天前
C#中的decimal
开发语言·c#
迪飞特科技1 天前
分布式事务下 Spring 声明式事务失效的 3 种修复方案
分布式·spring·wpf
JustCheng2 天前
Dispacher(1/2)深入解析-详细使用
c#
CoderIsArt2 天前
C#中UI 线程与 Dispatcher
开发语言·ui·c#