开发者

ASP.NET 3.5 Web Site stopped importing System namespace by default

开发者 https://www.devze.com 2022-12-26 12:41 出处:网络
I have a VB Web Site project that has recently (and mysteriously) stopped importing the \"System\" namespace by default.

I have a VB Web Site project that has recently (and mysteriously) stopped importing the "System" namespace by default.

I'm having to either place an Imports System line at the top of each code behind, or preface everything with System, which is fairly annoying, not to mention redundant. I can't for the life of me figure out how to get the System namespace back to being imported by default.

I've already checked to see that WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config contains the <add namespace="System"/> line--it does. That was my best lead.

I have references to several namespaces within the System namespace in the <assemblies> node (e.g. System.Design, System.Web.Extensions of my website's web.config. There is no <namespaces> node. This has not been changed recently.

I'm tearing my hair out. Does anyone have any sug开发者_JAVA技巧gestions?


This seems to have fixed itself as mysteriously as it broke in the first place. I'm not sure what I did, but it's working now. So it goes.


Just been through this with a VB Web Project in VS 2013.

Lots of cases of the error from types in the System, System.Collections1, …

Turns out when copying a <configSections> element into the web.config (as part of adding some better logging) I'd copied the surrounding <configuration> element in as well.

Lots of weirdness followed. Was able to find issue when I found I could get the site to run and the IIS error page told me I had a configuration error.

Now to redo all the changes I had undone on my way to finding that….


1 The wonders of legacy code maintenance.

0

精彩评论

暂无评论...
验证码 换一张
取 消