为什么在code的变化反映在ASP.NET网站即使code不能编译? [英] Why are changes in code reflected in an ASP.NET website even if the code does not compile?

查看:166
本文介绍了为什么在code的变化反映在ASP.NET网站即使code不能编译?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在Visual Studio 2010中一个相当大的网站项目,我想知道为什么在code的变化,当我单独测试一个网页(被反映右键单击的.aspx 文件并选择查看更改在浏览器),即使有在code进行编译的prevent它的错误。这混淆了我。我得到几个错误,当我跑在Visual Studio中的code。但是,我做任何改变,无论是在客户端code或服务器端code,是如果我只是在浏览器中查看该页面的体现。这使得客户端code和标记感,但为什么它甚至采取硬伤服务器端code?没有服务器端code需要编译?感谢您的任何输入。我对这个话题有更多的问题,但我希望在这个问题的答案可以帮助我解答我有其他问题。

I am working on a rather large website project in Visual Studio 2010 and I'm wondering why changes in the code are reflected when I test a web page individually (by right-clicking the .aspx file and selecting View Changes in Browser), even though there are errors in the code that prevent it from compiling. This confuses me. I am getting several errors when I run the code in Visual Studio. However, any change that I make, either in the client side code or the server side code, is reflected if I just view the page in the browser. This makes sense for client side code and markup, but why does it even take the "flawed" server side code? Doesn't server side code need to be compiled? Thanks for any input. I have many more questions on this topic, but I'm hoping the answer to this question helps me answer the other questions I have.

编辑:在我收到错误的更多信息

我已经学会了从分配给这个项目的原开发商一些细节。他告诉我,对于他内置到项目的每个附加功能,他复制和粘贴原来的项目目录,并改名的文件夹。例如,这是原来的项目目录:

I have learned some more details from the original developer assigned to this project. He has informed me that, for every additional feature that he built in to the project, he copied and pasted the original project directory and renamed the folder. For instance, this is the original project directory:

APP_ code [文件夹]

App_Code [folder]

App_Data文件[文件夹]

App_Data [folder]

的Web.config [文件]

Web.config [file]

...

他这个复制每次他建立了一个新的模块到网站的时间。这当然不是说我会做的方式,但它已经被现在完成。因为它的立场,也有这种原始的项目目录,这意味着有4 的web.config 文件,4 APP_ code <4份/ code>和的App_Data 文件夹(在 APP_ code 文件夹的类4份)。我得到的错误是这样的事情: [服务器控件]未声明。它可能无法访问由于其保护级别 [服务器控件]不是会员[局部类] ,其中一些人认为如果将肯定警报智能感知他们,其实错误。看来,出于某种原因,每个我的网页的服务器控件没有正确链接到相应的code隐藏文件。但是,智能感知并不突出这些错误或以任何方式承认他们。当我尝试建立的项目,我得到这些错误。我曾试图揭露设计师code文件,以尝试手动修复这些错误,但我知道,你不能这样做,在网​​站项目。我诚实地茫然。

He copied this every time he built a new "module" into the website. This is certainly not the way that I would have done it, but it has already been done now. As it stands, there are 4 copies of this original project directory, which means there are 4 web.config files, 4 App_Code and App_Data folders (and 4 copies of the classes in the App_Code folder). The errors I'm getting are things like these: [server control] is not declared. It may be inaccessible due to its protection level, and [server control] is not a member of [partial class], among a few others that would certainly alert intellisense if they were, in fact, errors. It seems that, for some reason, the server controls on each of my webpages are not correctly linked to the corresponding code-behind file. But intellisense does not highlight these errors or acknowledge them in any way. I get these errors when I try to build the project. I have tried to expose the designer code file to try to fix these errors manually, but I learned that you cannot do that in a Website project. I am honestly at a loss.

如果任何人有任何想法如何解决这个问题,请让我知道。如果我能得到更清晰的,请告诉我。我不能包含任何实际的code,但我可以试着给你一些例子,如果这将有助于。

If anyone has any idea how to fix this, please let me know. If I can be more clear, please tell me. I can't include any actual code, but I can try to give you some examples if that would help.

下面是这似乎是类似于雷另一个问题。即使这样的Visual Studio报告的错误的数目是相同的。 变量没有宣布它可能无法访问由于其保护级别

Here is another question that seems to be similar to mine. Even the number of errors that Visual Studio reported is the same. variable is not declared it may be inaccessible due to its protection level

推荐答案

原来,原来的开发商取得了部分类文件的副本。他们分散在整个项目,所以我不知道他们在那里。它们已被删除后,一切工作就像我的预期。

It turns out that the original developer had made copies of the partial class files. They were dispersed throughout the project, so I had no idea they were there. After they were deleted, everything worked like I expected.

这篇关于为什么在code的变化反映在ASP.NET网站即使code不能编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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