它應該是這樣的:
<ItemGroup>
<Compile Remove="wwwroot\dist\**" />
<Content Remove="wwwroot\dist\**" />
<EmbeddedResource Remove="wwwroot\dist\**" />
<None Remove="wwwroot\dist\**" />
</ItemGroup>
但有可能是其他人在比賽中的東西。這裏是「默認」 .NET核心2的csproj應該怎麼看起來像+「DIST」文件夾忽略:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
</PropertyGroup>
<ItemGroup>
<Compile Remove="wwwroot\dist\**" />
<Content Remove="wwwroot\dist\**" />
<EmbeddedResource Remove="wwwroot\dist\**" />
<None Remove="wwwroot\dist\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.2" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
</ItemGroup>
</Project>
如果你想有複製到輸出,仍然可見裏面VS文件夾的內容:
<ItemGroup>
<Compile Remove="wwwroot\dist\**" />
</ItemGroup>
它編譯,但如果我只想跳過編譯? – kat1330
更新了我的答案。 –
不幸的是,它不適合我。我試圖跳過編譯,但複製在'發佈'文件夾。 – kat1330