help.net


Musing on .Net

News

Windows Phone Apps I recommend

FotoBank


FotoIreland



hit counters






Open source CMS


My blog

Irish blogs

Locations of visitors to this page Get Chitika eMiniMalls

.Net useful

Blogs I read

PocketPC

SQL

Usability

Migration to VS 2005: Up and Downs

In this article, I will try to report on a regular basis all the annoying things I found with migrating a perfectly well working web solution in VS 2003 to VS 2005.

1 - Misleading error system
I appreciate Microsoft efforts to improve the developer life by reporting in details all the compilation errors.
However the issue here is you can find yourself with errors apparently misleading you on the real origin of the bug.

Example:

I added by mistake a second <appsettings/> section in my web config file (Note: I didn't know at the time I made this mistake). When I run the web project I got a lot of nasty errors like this:

Error 14 C:\Web Projects\Developers\Default.aspx: ASP.NET runtime error: Sections must only appear once per config file.  See the help topic <location> for exceptions. (C:\Web Projects\Developers\web.config line 150) C:\Web Projects\Developers\Default.aspx 1 1 C:\Web Projects\Developers\

If you are not paying attention and you are in a hurry, you simply double click on the error line, expecting to be send to the culprit. Surprise, you are send to the page itself, in this case Default.aspx. The wiggle under the Page directive appears and if you are a beginner (thankfully I am not) you can scratch your head for a while before dicovering that the real error reside in the second part of the line in the web config file.

I believe this happens also with some other errors.

2 - Intellisense nonsense

I have my user controls (ASCX files) stored in a subfolder Modules. When in the HTML code I include an IMG tag, pointing to an image at the root level in a folder images, Intellisense create an error indicating that it can't find the image, even if the project compile perfectly and the image appears properly.

Structure:

Developers project (the root of my web project
Images
Modules
--> MyControl.ascx

Of course if I add a relative path to my image tag (../) Intelisemnse is happy but the result is wrong. In some case I even have the control not rendered at all!

 3 - Namespaces

Not a big deal but if you declare a Dataset or Datatable, you have to add a Imports System.Data on top of your code, otherwise you got a compilation error. I presume Data... have moved to a new class.

 4 - Projects

I have a Class library project to include my business objects. Works fine, but I don't understand why when I reference this project in my web project, all the files from the class library are duplicated in the web project.

Solution structure
Web Project
-->Web files
-->BAL (Business access layer project)

BAL (Class Library project)
-->Classes

 5 - Unexplainable compilation errors

Now this one is new, after few compilations running well, with no warnings, I got this weird error coming from a very basic user control. I have not a single idea where this coming from!

Could not load file or assembly 'App_Web_utn2fxip, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

UPDATE: This error disappeared as it comes, very strange.

 5 - Visual Studio 2005 self destruction

After one day of relative peace with VS 2005, now things are getting worse. First I had a bad time with the new menu control. Strangely enough I can't make it working in a master page (see the picture below). It works fine in any .aspx page but on the master page whatever the web project, a basic menu control show all the time expanded. If I move the mouse over the menu collapse properly.
So after this I decided to create a new web project and I spend some time trying to understand why all of a sudden the web project disappeared. See the screen below (click on it to enalrge) and you can see the mess I have suddenly in VS 2005. The languages menus have doubled, and some junk appear if I chosse the second Visual Basic item!

UPDATE: For the menu control I just test it on a new blank project and works fine in a master page. So still don't know what to do to have a menu working on my project, searching, scratching my head, searching, ...

Visual Studio another error !!

Posted: Nov 22 2005, 07:05 PM by help.net | with 7 comment(s)
Filed under:

Comments

No Comments