SignalR:无法在 Visual Studio 2017 项目中获取 js 库
SignalR: Cannot get js libraries in Visual Studio 2017 project
尝试按照本教程使基本的 SignalR 工作:
https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr?tabs=visual-studio&view=aspnetcore-2.2
我正在使用 Visual Studio 15.9.7
教程包括以下说明,但是当我按照它们进行操作时,模态 window 消失了,没有任何消息,而且我在任何地方都没有 signalr javascript 库。 lib/signalr 文件夹未提取到我的应用程序中。没有。
我环顾四周试图找出手动下载它们的位置。没有。
我尝试了 运行 所有包控制台命令来尝试获取 signalR。像这样: npm install @aspnet/signalr
没有。
是否有一种简单且行之有效的方法来获取这些 js 库?
In Solution Explorer, right-click the project, and select Add > Client-Side Library.
In the Add Client-Side Library dialog, for Provider select unpkg.
For Library, enter @aspnet/signalr@1, and select the latest version that isn't preview.
Add Client-Side Library dialog - select library
Select Choose specific files, expand the dist/browser folder, and select signalr.js and signalr.min.js.
Set Target Location to wwwroot/lib/signalr/, and select Install.
Add Client-Side Library dialog - select files and destination
LibMan creates a wwwroot/lib/signalr folder and copies the selected files to it.
首先,您可以尝试更新您的 Visual Studio 并检查它是否可以帮助解决问题。
此外,我们也可以使用LibMan Cli命令将SignalR客户端库添加到项目中。
运行安装LibMan的命令如下(如果之前没有安装的话)
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
运行下面命令获取SignalR客户端库
libman install @aspnet/signalr -p unpkg -d wwwroot/lib/signalr --files dist/browser/signalr.js --files dist/browser/signalr.min.js
尝试按照本教程使基本的 SignalR 工作: https://docs.microsoft.com/en-us/aspnet/core/tutorials/signalr?tabs=visual-studio&view=aspnetcore-2.2
我正在使用 Visual Studio 15.9.7
教程包括以下说明,但是当我按照它们进行操作时,模态 window 消失了,没有任何消息,而且我在任何地方都没有 signalr javascript 库。 lib/signalr 文件夹未提取到我的应用程序中。没有。
我环顾四周试图找出手动下载它们的位置。没有。
我尝试了 运行 所有包控制台命令来尝试获取 signalR。像这样: npm install @aspnet/signalr
没有。
是否有一种简单且行之有效的方法来获取这些 js 库?
In Solution Explorer, right-click the project, and select Add > Client-Side Library.
In the Add Client-Side Library dialog, for Provider select unpkg.
For Library, enter @aspnet/signalr@1, and select the latest version that isn't preview.
Add Client-Side Library dialog - select library
Select Choose specific files, expand the dist/browser folder, and select signalr.js and signalr.min.js.
Set Target Location to wwwroot/lib/signalr/, and select Install.
Add Client-Side Library dialog - select files and destination
LibMan creates a wwwroot/lib/signalr folder and copies the selected files to it.
首先,您可以尝试更新您的 Visual Studio 并检查它是否可以帮助解决问题。
此外,我们也可以使用LibMan Cli命令将SignalR客户端库添加到项目中。
运行安装LibMan的命令如下(如果之前没有安装的话)
dotnet tool install -g Microsoft.Web.LibraryManager.Cli
运行下面命令获取SignalR客户端库
libman install @aspnet/signalr -p unpkg -d wwwroot/lib/signalr --files dist/browser/signalr.js --files dist/browser/signalr.min.js