recompiling the codebehind

col

New Member
I had a fairly embarrassing situation yesterday when I tried to install my first stab at an ASP.NET app on a client's server. It turned out that the client had changed their directory structure a little bit so that the path to a database in my codebehind was no longer valid. No problem, I'm thinking, I'll just change the path to point to the right spot. Of course this didn't solve the problem because the codebehind has to be re-compiled. I had built the application using VS.NET but the server we were installing the app on didn't have VS.NET. So my question is, how can you re-compile the code after a change, on a machine that doesn't have VS.NET?? <BR>I have read about 2 solutions. Using the .NET compiler that comes with the .NET framework, or putting "Src=http://aspmessageboard.com/archive/index.php/'YourWebForm.aspx.vb'" into the @Page directive. Neither of these solutions worked for me yesterday. Can anyone shine some light on this for me?<BR>Much appreciated.<BR><BR>masmithThere is a way to complie from the command line but I'm unsure of the syntax for it.compiling from the command line:<BR>vbc /t:library /r:System.dll /r:System.Data.dll /r:System.Web.dll /out:C:InetpubwwwrootinAllCompiledFilesSeparatedBy Space.vb C:InetpubwwwrootinAnotherCompiledFile.vb...<BR><BR>if you're using C#, you would use csc instead of vbcsorry... i wrote that too quickly.<BR><BR>the /out: specifies what the compiled .dll will be called and where it will be placed. after that, you indicate the files being compiled separated by spacesYeah, there is a way to do that. I believe that syntax is something like <BR><BR>vbc /target:library YourFile.vb<BR><BR>This apparently creates a DLL from your vb code. However, when I tried this it came back with a ton of "errors" - stuff like "Checkbox not defined" and "Type OleDb.OleDBConnection is not defined". Why aren't these errors raised when I "build" my solution is VS.NET. Obviously there are some fundamental things I'm not understanding about how VS.NET builds solutions....<BR><BR>thanks for the response. Any other thoughts?<BR><BR>masmith<BR><BR>Ok, so if I made a change to my codebehind, "WebForm1.aspx.vb", is that the only file I have to re-compile, or do I have to re-compile ALL the files?make sure you reference the correct dlls in the command line by means of /r:<BR><BR>for example vbc /t:library /r:System.dll /r:System.Data.dll /r:System.Web.dll etc...<BR><BR>these are probably the only 3 you'll need to reference in the command line. /r:System.Data.dll will import everything for OleDbConnection and /r:System.Web.dll will import everything for Checkboxes etc. i usually create a .bat file which contains this command so i can just click on it and recompile the application. all you have to do is write your compile line in notepad and save it as type .bat.That makes sense! I'll give it a try. ThanksOk, well I tried your suggestion and I'm still getting errors.<BR>The vbc.exe resides in C:winntmicrosoft.netframeworkv1.0.3705<BR>The .vb file I want to re-compile is in D:arcims_datawebsitedevelopmentarcims_asp.net<BR><BR>I opened the command prompt and navigated myself to the directory where the vbc.exe resides then I wrote the following:<BR><BR>vbc /t:library /r:System.dll /r:System.Data.dll /r:System.Web.dll /out:D:arcims_datawebsitedevelopmentarcims_asp.net in est.dll D:arcims_datawebsitedevelopmentarcims_asp.netWebFo rm1.aspx.vb<BR><BR>Does that look right? I'm still getting all of the same errors about checkboxs, OleDb, ListItem, TableRow, etc.<BR><BR>What am I doing wrong?
 
Back
Top