1

I have created a Angular2 application in AspNet Core 1.0. We are not using any of the AspNet core features and just we want Angular2 application to be wrapped inside a AspNet core application.

The application works fine in Development mode i.e. in Debug mode. But When I do publish the application from Visual studio IDE and copy the published contents and place it inside IIS Virtual folder I am not able to access the application. I am getting issues in the References i.e. not able to load .JS .CSS files from Index.html -

"Failed to load resource: the server responded with a status of 404 (Not Found)".

After publish I can notice all the typescript files are transpiled to .js files and all the references are placed properly. Please refer snapshot for the error found in the browser console. any ideas why I am getting this error and what is it need to be done to be deployed in IIS and make it work?enter image description here

After changing the stylesheet href from href="css/bootstrap.min.css" to href="./css/bootstrap.min.css", I am getting this error. enter image description here

Krishnan
  • 958
  • 5
  • 21
  • 44
  • did you install the .net core module on your server? – Bean0341 Dec 01 '16 at 16:45
  • Yes, indeed I am trying to host the application in my local desktop only, in debug mode it works fine in my local system – Krishnan Dec 01 '16 at 16:49
  • also your application doesnt look like you a compiled it. are you using angular cli? and if so did you run you ng-build command in order to compile your dist folder? the files in your dist folder are what you will actually deploy to your server – Bean0341 Dec 01 '16 at 16:49
  • No I am not using any commands to build/publish. I use the Publish menu provided in Visual studio IDE and I can notice that all my typescripts are transpiled to .js files. Is there any specific steps involved in publishing, please share it? – Krishnan Dec 01 '16 at 16:54
  • ok, well I dont want to lead you down the wrong path but I recent built and deployed my angular 2 project to an iis site, I had to convert my project into an angular cli project in order to build it out to be hosted on a server. I would be more than happy to help you out but we would have to move this conversation into a chat. – Bean0341 Dec 01 '16 at 17:17

0 Answers0