Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2008, 04:18 PM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default Codebehind Recompile problem...

Sorry if this is a dumb question; I seem to remember running into this problem some time ago, and I can't remember what the answer was :

I am working on an old ASP.NET 2.0 website that uses C# codebehind files. I have tried to make some very basic code changes (i.e. fixing a typo in a programmatic error message) on my local copy of the webapp, but my changes are not being recompiled into the DLL.

After making the change in the .cs page, I click Build>>Build Page for both the .aspx and .cs pages. Still, the changes do not appear when I run the site on the test/local server.

The .cs pages uses "Codebehind="productdetail.aspx.cs"", which VWD reminds me is "no longer supported". Will the DLL recompile ignore my changes unless I rename Codebehind to Src? Edit: I have done that, still no recognition.

I used to use inline code for ASP.NET pages, and recompiles never seemed to be a problem. Seperate code pages, however, are presenting these problems.

Thanks for any advice!
 
Old December 17th, 2008, 09:43 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Are you...

are you opening the project via the solution file or are you opening the website directly with VWD?
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old December 18th, 2008, 01:50 PM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alliancejhall View Post
are you opening the project via the solution file or are you opening the website directly with VWD?
I am opening the website in VWD (VS2005) as a file system. I don't see an .sln in the root directory...
 
Old December 18th, 2008, 01:54 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default well....

Then as far as I know the dll won't recompile with the new code because the build doesn't know what the solution is? so all you are doing is updating the code behind and the dll stays the same. I think you can start a brand new project then use the add existing to import all the original code files and aspx pages to create a new DLL. just make sure you name the project the same? Someone esle might have a better idea but i believe that's why it's not working.
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old December 18th, 2008, 02:34 PM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alliancejhall View Post
Then as far as I know the dll won't recompile with the new code because the build doesn't know what the solution is? so all you are doing is updating the code behind and the dll stays the same. I think you can start a brand new project then use the add existing to import all the original code files and aspx pages to create a new DLL. just make sure you name the project the same? Someone esle might have a better idea but i believe that's why it's not working.

Arrgg...sorry, I was being stupid. I see them now in the website's root directory on my desktop:

MyWebsite.csproj
MyWebsite.csproj.user
MyWebsite.Publish.xml
MyWebsite.sln

Should I somehow be opening the website in VS05 using the sln file instead of opening WebSite>>as File System?

I think the root of my confusion is that I am used to dealing with the simpler "Web Site Project"/file system model rather than the "Web Application Project" + .sln file model.

Last edited by Nostromo77; December 18th, 2008 at 02:44 PM..
 
Old December 18th, 2008, 02:57 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default yeah..

Just double click the solution file it should open the project.... and then add the changes again and then you should be able to compile/build the project.
__________________
Jason Hall

Follow me on Twitter @jhall2013
The Following User Says Thank You to alliancejhall For This Useful Post:
Nostromo77 (December 18th, 2008)
 
Old December 18th, 2008, 05:30 PM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alliancejhall View Post
Just double click the solution file it should open the project.... and then add the changes again and then you should be able to compile/build the project.
Aha.. this seems to be working. Thank you.

So in order to make a change like this, and then move it to production, is the process:

1. Switch the local copy of the Webapp's debug property to FALSE
2. Build the project locally to compile the changes
3. Copy the local .DLL "brain" an dcopy it over the old DLL on the production server?

Or is it more complicated than this?
 
Old December 18th, 2008, 09:37 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Nope...

Just open the solution make your changes build then you can choose publish and then publish the files to where they need to be in production and you can tell it to only publish the files needed to run the app....

but your way will work too assuming all you change is the codebehind.
__________________
Jason Hall

Follow me on Twitter @jhall2013
 
Old December 22nd, 2008, 09:32 AM
Authorized User
 
Join Date: Oct 2006
Posts: 42
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alliancejhall View Post
Just open the solution make your changes build then you can choose publish and then publish the files to where they need to be in production and you can tell it to only publish the files needed to run the app....

but your way will work too assuming all you change is the codebehind.
It worked - thank you!
 
Old December 22nd, 2008, 09:33 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Good to hear!

Glad it's working!
__________________
Jason Hall

Follow me on Twitter @jhall2013





Similar Threads
Thread Thread Starter Forum Replies Last Post
Codebehind not working angshujit ASP.NET 1.0 and 1.1 Basics 1 September 21st, 2007 07:32 AM
Modify resource file with out recompile the proj ndc550 ASP.NET 2.0 Basics 0 November 2nd, 2006 05:19 PM
Problem with Codebehind - urgent sunny76 ASP.NET 2.0 Basics 1 February 17th, 2006 09:18 AM
JSP Codebehind buddhudev Pro JSP 0 October 1st, 2005 02:33 PM
Ch15 CodeBehind mahir BOOK: Beginning ASP.NET 1.0 2 May 8th, 2004 01:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.