csproj标签的简单介绍

介绍几个常用的 csproj 属性,附带说明!

专注于.NET技术开发的博主,关注我个人微信公众号查看更多:承哥技术交流小作坊。

<!--csproj框架引用-->
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <!--支持的编译平台,配置了此选项,可以在配置管理里面配置它到底是x86还是x64或者AnyCPU-->
    <Platforms>AnyCPU;x86;x64</Platforms>
    <!--当前项目按什么来编译-->
    <PlatformTarget>x86</PlatformTarget>
    <!--版本,打nuget包也会认这个版本号-->
    <Version>1.0.0</Version>
    <FileVersion>1.0.0</FileVersion>
    <!--编译输出类型:Library 类库,WinExe 应用程序-->
    <OutputType>Library</OutputType>
    <!--是否启用WPF,Winform同理-->
    <UseWPF>true</UseWPF>
    <!--是否生成 AssemblyInfo.cs,如果需要手动添加就设置为False。因为 Microsoft.NET.Sdk 里面已经包含了该配置-->
    <GenerateAssemblyInfo>False</GenerateAssemblyInfo>
    <!--打nuget包时可能会用到该选项。如果csproj没有显示的包含Compile的项,提示重复的Compile。可以尝试添加此项-->
    <IncludePackageReferencesDuringMarkupCompilation>False</IncludePackageReferencesDuringMarkupCompilation>
    <!--目标框架类型-->
    <TargetFramework>net452</TargetFramework>
    <!--基础输出目录-->
    <BaseOutputPath>..</BaseOutputPath>
    <!--输出目录-->
    <OutputPath>$(BaseOutputPath)\$(Configuration)\</OutputPath>
    <!--是否将framework版本追加到目录,如 自动创建 net452 文件夹-->
    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <!--是否将运行标识追加到目录,如 自动创建 x86 文件夹-->
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
    <!--应用程序图标-->
    <ApplicationIcon>ico_test_48.ico</ApplicationIcon>
  </PropertyGroup>
  <!--框架引用-->
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <!--项目引用-->
  <ItemGroup>
    <ProjectReference Include="..\A\B.csproj" />
  </ItemGroup>
  <!--包引用-->
  <ItemGroup>
    <PackageReference Include="System.Data.SQLite">
      <Version>1.0.115.5</Version>
    </PackageReference>
  </ItemGroup>
</Project>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

冷眼Σ(-᷅_-᷄๑)

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值