1. 引用框架,Microsoft.NETCore.App,手动打开xxx.csproj文件,添加以下节点
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
2.输出时,不输出\bin\debug\netcore3.1目录
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
3. mvc中view文件不打包
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish>
</PropertyGroup>
4.指定相对输出目录
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\Test\bin\</OutputPath>
</PropertyGroup>