当我创建一个新的、干净的 Blazor .NET 6.0 应用程序并启动它(使用 Visual Studio 2022)时,我在浏览器控制台中看到以下错误:
WebSocket connection to 'ws://localhost:60908/BlazorApp3/' failed: (aspnetcore-browser-refresh.js:234)
Run Code Online (Sandbox Code Playgroud)
还有其他人知道这个吗?知道这是否是 VS2022 的错误以及如何修复它?
我创建了一个Angular CLI项目,其中包含对包含web api服务的后端项目的代理引用.
launchSettings.json(后端项目):
...
"iisSettings": {
"windowsAuthentication": true,
"anonymousAuthentication": false,
"iisExpress": {
"applicationUrl": "http://localhost:10863/",
"sslPort": 0
}
},
...
Run Code Online (Sandbox Code Playgroud)
proxy.conf.json(前端项目):
{
"/api": {
"target": "http://localhost:10863",
"secure": false,
"logLevel": "debug"
}
}
Run Code Online (Sandbox Code Playgroud)
package.json(前端项目):
...
"scripts": {
"ng": "ng",
"start": "start http://localhost:4200 && ng serve --proxy-config proxy.conf.json",
"build": "ng build --prod --output-path=..\\CoreTest\\wwwroot",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
...
Run Code Online (Sandbox Code Playgroud)
然后我启动后端并通过运行启动Kestrel webserver npm start.使用angular2服务,我会对其中一个后端服务进行http-get.由于后端服务在带有Windows身份验证的IISExpress中运行(我想要Windows身份验证),因此出现401错误.
我可以这样做npm run build并浏览我的IISExpress网址并加载由ng build发布的index.html,但我想使用ng服务方法,因为开发更顺畅,因为ng服务在内存中工作.
我的问题是:在开发过程中如何使用Angular CLI和Windows身份验证?
在整个 bootstrap 4 (scss) angular 应用程序中实现暗模式和亮模式的最佳方法是什么?Angular cli 编译 scss 文件,因此为每个主题包含单独的 css 文件的旧方法对我没有吸引力。如何??设置主体类并在整个 scss 文件中使用 .dark / .light?使用混合?使用引导颜色主题?
欢迎任何想法!
我们有一个带有IIS网站和下面的IIS Web应用程序的Web服务器.Web应用程序的根目录是:http:// website/webapplication /.部署后,我在浏览器中收到以下错误:
http://website/app/app.component.html 404(未找到)
app/app.component.html 404(未找到)
我的组件:
@Component({
selector: "app",
templateUrl: "./app/app.component.html"
})
Run Code Online (Sandbox Code Playgroud)
文件app.component.html确实不存在于/app/app.component.html下,但确实存在于:/webapplication/app/app.component.html.
所以,我的结论是Angular仅在网站的根目录中有效.在html标题中,我将标记设置为:<base href="/webapplication/">,但这没有帮助.
这似乎是一个正常的设置,我无法相信在Angular中解析的模板失败,我必须遗漏一些东西......有谁知道解决这个问题?