IIS7.5 Not Compiling Code From App_Code folder

2019-06-11 12:28发布

I just recently upgraded to IIS7.5 locally. Our Production system is IIS6.0 (Windows Server 2005). I have a folder setup with an APP_Code folder in production, linked to IIS as a virtual directory. The code compiles fine there. However, my test environment is local (Windows 7 with IIS7.5). The code here will not compile from the APP_Code folder, same folder and virtual directory construction. I do not have a web.config file (using default inheritance). I did not experience these issues until updating to IIS7.5. All files were created in a notepad-like environment (not a project through Microsoft Visual Studio). Any help is appreciated.

1条回答
劫难
2楼-- · 2019-06-11 12:57

My understanding is that IIS7 won't be able to compile files in a APP_CODE directory that is setup as a virtual directory in IIS. Instead, you need to reference files as a subfolder/virtualdir of the APP_CODE directory while keeping the APP_CODE folder a physical directory on the web root. Which would be a better practice anyway, since each website should have its own unique APP_CODE folder anyway. So each website should have a physical /APP_CODE/ directory and in IIS just create new virtual dir in the /APP_CODE directory referencing the folder containing the files you want to be virtual, i.e.- /APP_CODE/VIRTUALDIR/.

查看更多
登录 后发表回答