Tuesday, December 09, 2008

Four "Gotchas" In ASP.NET 3.5

I learned 4 things about developing ASP.NET applications in the 3.5 Framework today:

1. Importing/converting a .NET 2.0 user control may not work. You might have to create a new user control and copy the code from the 2.0 version control to paste it into the new one.

2. When you create a new web page, don't do the right-click, "Add" then "New Item" thing. You won't get to select a master page if you go that way. Instead, right-click on the master page and select "Add Content Page." Why they changed it from the old method I have no idea.

3. Web.Config files are a special issue. You might find it best to copy the code from an already-existing 3.5 app and paste it into your new web.config. (This will mostly apply to my colleagues since we share code and have settled on standardized web.config files for the most part.)

4. When you publish, if Visual Studio insists on creating App_Code and App_Data files instead of compiling the files in those folders into a dll in the bin folder, right-click on the web root then click on "Convert To Web Application." That will change the build. This is another step added in that we didn't have to do before and one which makes no sense. If you try to run the app with those two files, the Framework kicks off an error telling you those folders are not allowed. Why even have an option where one can keep them?

I know some of you are out there wondering why I didn't know this before we went from VS2005 to VS2008. I find I learn things better by doing rather than just reading about it. Although the learning time might be longer, I'll retain the knowledge better and make up the time later.

No comments:

Post a Comment