The directory '/website/App_Code/' is not allowed because the application is precompiled

孤街醉人 提交于 2019-11-30 16:49:51

Depending on your case, there are three possible scenarios:

see this link http://www.beansoftware.com/ASP.NET-FAQ/Directory-App_Code-Not-Allowed.aspx

Basically, If you precompiled your app, there shoudn't be an App_Code folder. If you added it later, you should delete it.

OR

May be Somehow a precompiled.config file has made it to production. Deleting that file should resolve the App_Code directory error.

Deleting the "precompiledApp.config" file should solve your problem.

In my case, I mistakenly, forced Publish a class, which caused this issue.

The Solution was to make an update on the offending class, then Publish again with the option "Delete unused files from the Destination Site". (Which is under the publish modal options)

In my case I compiled with "ASPX files are updateable" option checked OFF. I guess the IIS my website was running on did not like that.

Once I recompiled with "ASPX files are updateable" option checked ON, the issue disappeared.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!