ASP.Net Core App to IIS subfolder



Having trouble publishing your .net core app to a subfolder?
Make sure to double check if you’ve:
1.) Converted that subfolder into an application via IIS Manager.
2.) Created and assigned a new Application Pool. (No CLR, choose No managed code)

As someone who’s worked in a Linux server environment for over a decade, basic things like this was an annoying obstacle. At the end, everything I read and studied to find this resolution will become new knowledge.

Oh yeah..and I wish I could change the display language to English, but this VPS hosting service doesn’t have the pack included with the image. Screenshot is in Japanese, but you get the point.

ASP.Net Coreで初めてのAPIが完成して喜んでいたけれど、サブディレクトリへパブリッシュしたらerror 500が出た。Unix環境がメインだった俺には、Windows Serverはまだまだ未知。いじるのは遥かに簡単だけれど、細かい仕様がまだわからない。そんなんで、自分のプログラム側の問題かと思ったりして解決策見つかるまで10時間近くかかったという。それまでフォーラム読みまくって、色々試した知識は無駄にはならない!

解決方法:
1.) IISマネージャー内でアプリを起動させるフォルダを右クリックして、アプリケーションへ変換。
2.) 新しいアプリケーションプールを作成してから、指定のフォルダへ設定。(CLRバージョンを選ばずにマネージドコードなし)

Leave a Reply

Your email address will not be published. Required fields are marked *