在 .NET Core 项目中放置 "dotnet bundle" 的位置(project.json 替换为 *.csproj 文件)
Where to put "dotnet bundle" in .NET Core project (project.json replaced with *.csproj file)
由于最新的 .NET Core(我实际上使用的是 AspNetCore 1.1.2)已将 project.json 文件替换为 *.csproj 我仍然不清楚 "dotnet bundle"、预编译选项放在哪里。
"scripts": {
"precompile": ["dotnet bundle"]
}
之前在 project.json 文件中找到了上述 json 块。有什么线索吗?它已经在其他一些配置文件中了吗?下面是解释此更改的 link,并显示了与 project.json 文件等效的 *.csproj 文件:
https://docs.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj
一如既往,对于任何不正确的白话,我深表歉意,.NET Core 对我来说是新的。
您可以使用 Target
和 Exec
to accomplish this in .csproj
:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command=”bower install” EnvironmentVariables=”Path=$(ExternalToolsPath)” />
<Exec Command="dotnet bundle" />
</Target>
请参阅 了解如何让 dotnet bundle
使用新的 .csproj
格式。
由于最新的 .NET Core(我实际上使用的是 AspNetCore 1.1.2)已将 project.json 文件替换为 *.csproj 我仍然不清楚 "dotnet bundle"、预编译选项放在哪里。
"scripts": {
"precompile": ["dotnet bundle"]
}
之前在 project.json 文件中找到了上述 json 块。有什么线索吗?它已经在其他一些配置文件中了吗?下面是解释此更改的 link,并显示了与 project.json 文件等效的 *.csproj 文件:
https://docs.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj
一如既往,对于任何不正确的白话,我深表歉意,.NET Core 对我来说是新的。
您可以使用 Target
和 Exec
to accomplish this in .csproj
:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command=”bower install” EnvironmentVariables=”Path=$(ExternalToolsPath)” />
<Exec Command="dotnet bundle" />
</Target>
请参阅 dotnet bundle
使用新的 .csproj
格式。