C# 未调试时无法通过路由访问组件
我目前正在开发一个带有Dot Net Core API后端的Angular单页应用程序,我在应用程序中遇到了一个路由问题 在Angular应用程序中使用“ng serve”并使用localhost:4200访问SPA时,我可以访问密码重置路由,组件显示。 但是,当我运行“ng build”在我的Dot Net Core API中创建wwwroot文件夹并尝试通过地址栏访问路由时,它表示在localhost:38611或localhost:44316(SSL)中都找不到该页面 下面是我的导航路线代码C# 未调试时无法通过路由访问组件,c#,angular,.net-core,C#,Angular,.net Core,我目前正在开发一个带有Dot Net Core API后端的Angular单页应用程序,我在应用程序中遇到了一个路由问题 在Angular应用程序中使用“ng serve”并使用localhost:4200访问SPA时,我可以访问密码重置路由,组件显示。 但是,当我运行“ng build”在我的Dot Net Core API中创建wwwroot文件夹并尝试通过地址栏访问路由时,它表示在localhost:38611或localhost:44316(SSL)中都找不到该页面 下面是我的导航路线代
export const routes: Routes = [
{ path: 'password-reset', component: UserPasswordResetComponent },
{ path: '', component: HomeComponent },
{
path: '',
runGuardsAndResolvers: 'always',
canActivate: [AuthenticateGuard],
children: [
{ path: 'downloads', component: MenuDownloadsComponent },
{ path: 'user-profile', component: UserProfileComponent }
]
},
{
path: '',
runGuardsAndResolvers: 'always',
canActivate: [ManagerGuard],
children: [
{ path: 'manager-dashboard', component: DashboardManagerComponent },
{ path: 'history', component: MenuHistoryComponent }
]
},
{
path: '',
runGuardsAndResolvers: 'always',
canActivate: [AdminGuard],
children: [
{ path: 'admin-dashboard', component: DashboardAdminComponent },
{ path: 'user-admin', component: MenuAdminUserComponent },
{ path: 'company-admin', component: MenuAdminCompanyComponent },
{ path: 'software-admin', component: MenuAdminSoftwareComponent },
{ path: 'release-admin', component: MenuAdminReleaseComponent },
{ path: 'item-admin', component: MenuAdminItemComponent },
{ path: 'uploads', component: MenuUploadsComponent }
]
},
{ path: '**', redirectTo: '', pathMatch: 'full' }
];
我不明白为什么它在一种情况下有效,但在其他情况下无效,任何帮助都将不胜感激
我对Angular(我最近更新为Angular 10)使用VS代码,而对Dot Net Core(3.1版)使用Visual Studio,但我也尝试在VS代码中运行它,但没有任何效果