lentyai
lentyai

Reputation: 690

ASP.NET Core 2.0 Web API IIS Hosting and Debugging

I have a ASP.NET Core 2 Web API with the Angular 4 front end SPA application. It was created using clean Core 2 Web API template in VS2017 and angular-cli for the front-end using VSCode. Currently I can successfully run my prototype using either IIS Express WebAPI or self-hosted. I can successfully deploy to IIS using steps simmilar to these: https://learn.microsoft.com/en-us/aspnet/core/publishing/iis?tabs=aspnetcore2x. However, I can't figure out how to attach to the IIS process to be able to step through the code as I used to do with regular old Web API or MVC app hosted in IIS.

I'm coming from traditional Web API and Angular1 environment. Both ends were deployed to IIS and it was a simple process to attach to IIS for troubleshooting. So, maybe it's a stupid question, but I can't seem to find good resource on how to approach production deployment of such Core 2 WebAPI + Angular 2 SPA app. What are the best practices? IIS for Web API and npm for client? Can someone maybe point me to tutorial on how to do that and how to debug/troubleshoot with IIS? Are there a better ways to deploy/host it, maybe my approach is wrong and IIS not needed?

If any pictures, code, setup is needed I'll gladly add it to the question. I just don't know what I can provide at the moment. Any help, advise, link will be much appreciated!

Upvotes: 2

Views: 3089

Answers (1)

YonZo
YonZo

Reputation: 177

Not 100% sure if this is what you're after, but check out this blog-post: https://blogs.msdn.microsoft.com/webdev/2017/07/13/development-time-iis-support-for-asp-net-core-applications/

Note: Make sure you select the new launch profile ("IIS") in the main window, before starting a debug session!

Upvotes: 1

Related Questions