aspx page changes not picked up by debugger unless do "Rebuild Solution"

B

Bennett Haselton

If I create a new C# Web Project in Visual Studio and add this to the
Page_Load method for WebForm1:

Response.Write("firsttime");

then hitting F5 to debug the project of course shows the WebForm with
"firsttime" on the page.

But if I then change it to Response.Write("secondtime") and hit F5,
the changes don't take effect -- the WebForm still opens and displays
"firsttime". Even if I do "Build->Build Solution" and then hit F5,
the WebForm still displays "firsttime". It's only if I do
Build->*Rebuild* Solution and then debug, that the changes take effect
and I see "secondtime".

I haven't used Visual Studio much before doing ASP.Net but this seems
inconsistent with the way all other kinds of projects work. In
general, if you modify one of the source files and hit F5, the changes
take effect -- the source is saved and the necessary parts of the
project are rebuilt automatically. Is there some reason why ASP.Net
projects don't work this way? Some setting I can change so that
changes take effect when I hit F5?

The other way to make the changes take effect right away, is to
declare a new variable like "int x;", even if you never use it. If
you do that, the WebForm will display whatever you've modified
Response.Write() to write, even if you don't do Rebuild Solution
first. I guess this is why I didn't notice this problem until now,
since most of the time, the changes I made would be substantial enough
that the relevant parts would be rebuilt when I wanted to debug.

-Bennett
 
M

MS News \(MS ILM\)

What Version are you running etc..
I tried it and it works, but I did not create a new project
I just added you line below and changed "firsttime" to "secondtime" etc..
and it was giving me the correct output
may be .NET does not consider that a one line program is a serious enough
program and will not work for you... Kidding
 
B

Bennett Haselton

MS said:
What Version are you running etc..

Microsoft Development Environment 2002 v. 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705
Windows XP Home SP1
The ASP.Net Web projects are uploaded to a Windows 2000 Server machine
on the LAN.
I tried it and it works, but I did not create a new project
I just added you line below and changed "firsttime" > to "secondtime"
etc..

Did you do the debug while it still said "firsttime", and *then* change
it to "secondtime" and hit F5 again?

-Bennett
 
M

MS News \(MS ILM\)

Well
I hit F5 I see "firsttime"
I exit browser
I change the text to "secondtime"
I hit F5
I see "secondtime"
I am running VS.NET 2003
May be I did not follow your procedure exactly??
 
J

John Saunders

Bennett Haselton said:
Microsoft Development Environment 2002 v. 7.0.9466
Microsoft .NET Framework 1.0 Version 1.0.3705
Windows XP Home SP1
The ASP.Net Web projects are uploaded to a Windows 2000 Server machine
on the LAN.

Maybe this is because you're running the project remotely.
 
B

Bennett Haselton

John Saunders said:
Maybe this is because you're running the project remotely.

That looks like it -- I created a new C# Web Project using a copy of
VS.NET installed on the Windows 2000 Server machine itself, repeated
the steps I'd done earlier, and "firsttime" did get changed to
"secondtime" as expected. (Though when I did it again remotely from
my Windows XP Home machine, the update still did not take effect until
I did "Rebuild All".)

But since I want to keep doing the development on my Windows XP
machine, is there a reason that the changes don't take effect when you
do F5-debug if you're running the project remotely -- and why the
changes *do* take effect if you add a declaration of a new variable to
your code?

-Bennett
 

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top