IIS7.5未从App_Code文件夹编译代码 [英] IIS7.5 Not Compiling Code From App_Code folder

查看:557
本文介绍了IIS7.5未从App_Code文件夹编译代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚最近升级到IIS7.5本地。我们的生产系统是IIS6.0(Windows Server 2005)。我有一个文件夹设置与生产中的APP_Code文件夹,链接到IIS作为一个虚拟目录。代码编译良好。但是,我的测试环境是本地的(Windows 7 with IIS7.5)。这里的代码不会从APP_Code文件夹,同一文件夹和虚拟目录构建中编译。我没有web.config文件(使用默认继承)。我没有体验到这些问题,直到更新到IIS7.5。所有文件都是在类似记事本的环境中创建的(而不是通过Microsoft Visual Studio的项目)。任何帮助是赞赏。

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.

推荐答案

我的理解是,IIS7将无法编译APP_CODE目录中的文件设置作为IIS中的虚拟目录。相反,您需要将文件引用为APP_CODE目录的子文件夹/虚拟目录,同时将APP_CODE文件夹保存为Web根目录上的物理目录。这将是一个更好的做法,无论如何,因为每个网站应该有自己独特的APP_CODE文件夹无论如何。因此每个网站应该有一个物理/ APP_CODE /目录,在IIS中只是在/ APP_CODE目录中创建新的虚拟目录,引用包含要虚拟文件的文件夹,即 - / APP_CODE / VIRTUALDIR /。

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/.

这篇关于IIS7.5未从App_Code文件夹编译代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆