【问题标题】:Visual Studio 22 Multiple Startup ProjectsVisual Studio 22 多个启动项目
【发布时间】:2022-07-22 18:20:58
【问题描述】:

我正在使用 VS 2022 Professional 2022 (17.2.0)。

我想在 VS 中使用 Angular 创建一个 ASP.Net Core 应用程序,并为此使用了 Microsoft 教程。 https://docs.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-angular?view=vs-2022

当我想一次性启动多个项目时,只有 Angular CLI 会启动 ng start 命令,但 ASP.NET Core 项目永远不会启动。 当我禁用内部的 Angular 项目时,Multiple Startprojects,.Net Core 控制台将启动。

Creation started...
1>------ Build started: Project: ConverterBackend, Configuration: Debug Any CPU ------
2>------ Build started: Project: Converter, Configuration: Debug Any CPU ------
1>Analyzer tools are skipped to speed up the build. You can run the Build or Rebuild command to run the analyzer.
1>ConverterBackend -> C:\Optimization\Converter\ConverterBackend\bin\Debug\net6.0\ConverterBackend.dll
3>------ Deployment started: Project: Converter, Configuration: Debug Any CPU ------

设置:

proxy.conf.js

target: "https://localhost:7049",

launchSettings.json

"applicationUrl": "https://localhost:7049;https://localhost:5001",

我希望有人有解决方案或遇到同样的错误,因为我找不到任何关于此的信息。 这可能是 AV 问题吗?

解决方案: 如果您遇到此问题,请检查脚本执行权限以及 AV 是否​​阻止了某些内容。

【问题讨论】:

    标签: c# asp.net angular visual-studio-2022


    【解决方案1】:

    我为此使用了两个 VS open 实例;每个都有不同的启动项目。

    【讨论】:

    • 这不是问题的解决方案...它有效,但不能真正解决我提出的问题。
    【解决方案2】:

    您必须启动 ASP.Net Core 应用程序。在那里你应该有一个启动类。 转到配置服务并添加如下内容:

    services.AddSpaStaticFiles(configuration => { configuration.RootPath = "WebUI"; });

    然后 Kestrel 服务器应该与 SPA 一起启动。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      • 2016-04-09
      • 1970-01-01
      • 2013-04-10
      • 2011-06-15
      • 2022-01-02
      相关资源
      最近更新 更多