简体   繁体   English

智能感知,引用和Visual Studio 2008中的生成问题

[英]Issues with intellisense, references, and builds in Visual Studio 2008

Hoping you can help me -- the strangest thing seems to have happened with my VS install. 希望您能帮到我-我的VS安装似乎发生了最奇怪的事情。

System config: Windows 7 Pro x64, Visual Studio 2008 SP1, C#, ASP.NET 3.5. 系统配置:Windows 7 Pro x64,Visual Studio 2008 SP1,C#,ASP.NET 3.5。

I have two web site projects in a solution. 我在解决方案中有两个网站项目。 I am referencing NUnit / NHibernate (did this by right-clicking on the project and selecting "Add Reference". I've done this for several projects in the past). 我正在引用NUnit / NHibernate(通过在项目上单击鼠标右键并选择“添加引用”来完成此操作。我过去在多个项目中都这样做过)。

Things were working fine but recently stopped working and I can't figure out why. 一切正常,但最近停止工作了,我不知道为什么。 Intellisense completely disappears for any files in my App_Code directory, and none of the references are recognized (they are recognized by any file in the root directory of the web site project. 对于我的App_Code目录中的任何文件,Intellisense完全消失,并且没有引用被识别(网站项目的根目录中的任何文件都可以识别它们。

Additionally, pretty simple commands like the following (in Page_Load) fail (assume TextBox1 is definitely an element on the page): 此外,类似以下的简单命令(在Page_Load中)也会失败(假设TextBox1绝对是页面上的元素):


if (Page.IsPostBack)
{
str test1;
test1 = TextBox1.Text;
}

It says that all the page elements are null or that it can't access them. 它说所有的页面元素都是空的,或者它不能访问它们。

At first I thought it was me, but due to the combination of issues, it seems to be Visual Studio itself. 起初我以为是我,但是由于问题的综合,似乎是Visual Studio本身。

I've tried clearing the temp directories & rebuilding the solution. 我尝试清除临时目录并重建解决方案。 I've also tried tools --> options --> text editor settings to ensure intellisense is turned on. 我还尝试了工具->选项->文本编辑器设置,以确保打开智能感知。

I'd appreciate any help you can give! 我会很感激您能提供的任何帮助!

If you think it is VS then try running it with this command line to get it back to factory defaults: devenv /resetsettings 如果您认为它是VS,请尝试使用此命令行运行它以将其恢复为出厂默认设置:devenv / resetsettings

Alternatively you may be experiencing issues due to the fact that intellisense only works on code that is (pre)compiled check the following: 另外,由于intellisense仅适用于(预)编译的代码,因此您可能遇到问题:

  1. a required folder is marked as excluded, 所需的文件夹被标记为已排除,
  2. there is an issue compiling a referenced project. 编译参考项目时出现问题。
  3. compile error in the global.asax class. global.asax类中的编译错误。 Note: extra { or } in a class bubbles from the root folder, usually kills intellisense. 注意:类中多余的{或}从根文件夹冒泡,通常会杀死intellisense。 (Clean solution then build watch output for error's) (清洁解决方案,然后构建监视输出以查找错误)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM