Bug in VS2005 w/ASPNET2 Websites

M

Mark Olbert

There appears to be a REALLY annoying bug in VS2005: periodically when you're rebuilding an ASPNET2 website which uses App_Code
stuff the compiler will fail to create the dynamic assembly or not be able to copy it to the bin directory or something.

In my case the error message which always shows up complains about my master page not defining a public property. The funny/sad
thing is that the property is defined, and in most cases I haven't touched the master page file in quite a few successful builds
when the message appears.

Sometimes, modifying a file in the App_Code subdirectory and recompiling solves the problem. But not always. And having to do that
is a pain in the butt.

Generally I have to quit out of VS2005 and restart it. Which is an even bigger pain. But even that doesn't always work. Sometimes I
have to reboot my machine to clear the problem. Which is the biggest pain of all.

Has anyone else run into this? Is there a workaround?

- Mark
 
M

Mark Olbert

Here's an example error message:

Warning 1

The type 'boardng' in 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\boardng\3e34c4a8\6c859375\App_Web_72xagc8p.2.cs' conflicts with the imported type 'boardng' in
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\boardng\3e34c4a8\6c859375\App_Web_boardng.master.cdcab7d2.kyumxfzp.dll'. Using the one in
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\boardng\3e34c4a8\6c859375\App_Web_72xagc8p.2.cs'.
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\boardng\3e34c4a8\6c859375\App_Web_72xagc8p.2.cs 255

The error is then:

Error 3 'boardng' does not contain a definition for 'PostedOn' C:\Websites\BoardNG\Copy of topic.aspx.cs 55

and yet the specified missing property has existed for quite a few successful builds.

- Mark
 
A

Albert Weinert

Mark said:
The error is then:

Error 3 'boardng' does not contain a definition for 'PostedOn' C:\Websites\BoardNG\Copy of topic.aspx.cs 55

I only had errors like this when i copy a Pages and forget to rename the
Page-Class in die .cs and the Inherrits from that Class in the .ascx.

--
Freundliche Grüße

Albert Weinert

http://der-albert.com
 
C

Christopher Reed

Whenever I've had this problem, I rebuild the entire website and that
usually takes care of the problem.
 
S

Steven Cheng[MSFT]

Hi Mark,

For such problem, it's hard to point out a definite resolution. And except
there is some obvious assembly referencing problem(like multiple times
referencing), such problem is likely caused by the page's dynamic compiled
assembly not synchronized correctly. As Christopher mentioned, usually you
can try save all the files and rebuild the website application and run it
again to see whether it works.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
M

Mark Olbert

Steven,

As I pointed out in my original posting, sometimes rebuilding the entire site >>doesn't<< solve the problem. In fact, the repeated
inability to solve it by rebuilding is what caused me to write the initial post.

By the way, is there an easy way of forcing an entire site rebuild? The Rebuild Solution menu option seems to have disappeared in
VS2005.

One other point: I discovered late last night that, if all else fails, you can avoid having to reboot by going into
c:\windows\Microsoft .NET\Framework\<Framework Version>\Temporary Internet Files\<sitename> and deleting all the files in there. You
can't be editing the site in VS2005 when you do this because it locks files and prevents them from being deleted, but at least you
can avoid having to reboot.

- Mark
 
C

Christopher Reed

Rebuild Solution isn't there by default. Go to the Tools menu and select
Options. In the Options dialog, select Projects and Solutions. There is a
checkbox for "Always show solution". Check this box and click OK. Go to
the Solution Explorer and the solution will now be present. Right-click on
the solution and you will now the option to Build Solution or Rebuild
Solution.

Note that the Build menu always has both Build Web Site and Rebuild Web
Site. With the solution present, the Build and Rebuild options for Solution
is also present there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top