I have built an angular 4 application with .Net core 2.0, visual studio 2017, and deployed to production server on IIS web server. The routing is working fine on localhost when refresh,but not working on live. I saw some answers in stackoverflow for IIS in web.config file. But I don't have web.config file under my project structure. can I add it manually or how can I fix it.
<system.webServer>
<rewrite>
<rules>
<rule name="Main Rule" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
Here is my app.routing file
const appRoutes: Routes = [
{ path: '', redirectTo: 'admin-dashboard', pathMatch: 'full' },
{ path: 'login', component: LoginComponent },
{ path: 'forgotpassword', component: ForgotPasswordComponent },
{ path: 'user-dashboard', component: DashboardComponent, canActivate: [AuthGuard] },
{ path: 'notifications', component: NotificationsComponent, canActivate: [AuthGuard] },
{
path: 'admin-dashboard', component: AdminDashboardComponent, canActivate: [AuthGuard],
children: [
{ path: '', component: ChairmanMessagesComponent, canActivate: [AuthGuard]},
{ path: 'quotes', component: QuotesComponent, canActivate: [AuthGuard] },
{ path: 'users', component: UsersComponent, canActivate: [AuthGuard] },
{ path: 'notifications', component: AdminNotificationsComponent, canActivate: [AuthGuard] },
]
}, ];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
Please kindly let me know.