我尝试使用bundleconfig.json,这是我在启动项目时添加到项目中的标准。我读了他们说你必须跑的地方
dotnet bundle
但这对我不起作用我收到了错误
找不到匹配命令“dotnet-bundle”
的可执行文件
现在我用Google搜索并发现我必须在Project.json
中添加它 "tools": {
"BundlerMinifier.Core": "2.2.281",
但我没有Project.json文件只有csproj。我以为我要安装包。所以我安装了BundlerMinifier.Core,但仍然是同样的错误。
我该怎么做才能运行代码并捆绑我的文件?
答案 0 :(得分:2)
根据https://docs.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification?view=aspnetcore-2.1&tabs=netcore-cli%2Caspnetcore2x,您必须安装用于dotnet的CLI工具才能执行此操作。
从项目目录中的命令行看起来就像这样:
dotnet add package BuildBundlerMinifier
dotnet build
你应该得到这个结果
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Bundler: Begin processing bundleconfig.json
Bundler: Done processing bundleconfig.json
BuildBundlerMinifierApp -> C:\BuildBundlerMinifierApp\bin\Debug\netcoreapp2.0\BuildBundlerMinifierApp.dll
链接页面还讨论了ad-hoc捆绑。它在微软网站上,所以它不应该去任何地方。