Convert VB.Net Web Site to Web Application Project

I am working with Visual Studio Pro SP1 and had some problems converting an old VB.Net web site into a VB.Net Web Application Project.  I followed the advice offered here ( ), but ran into a few kinks when using the process on a VB project. 

The Problem:
After creating a new Web Application Project, copying in the old files, and running the "Convert to Web Application Project" process, the site would no longer build.  Any classes stored in the "Old_App_Code" folder (previously named "App_Code" before conversion) could not be seen.  The original website was written using the root namespace, and when I converted it, VS changed the default namespace to the name of the project.

My Solution:
First, I changed the default namespace back to the root namespace (set Default Namespace to "" in project properties).  Next, and this is the part that confuses me, is that I copied the code from each file in the "Old_App_Code" folder, and pasted it into another newly created *.vb file in the same folder.  After I had done this for each file, I deleted the old *.vb files and renamed the new ones with the old names.  Viola!  Everything builds and works just fine.

I converted this project in order to prepare it for integration with MSBuild and Team Foundation server (MSBuild applications need a project file, hence the need to convert), and since most of our existing apps are VB.Net 1.1 or 2.0 Web Sites. (not Web Applications), I'm sure that I will run into this again.

Does anybody have an explanation of why the code-copying is necessary, so I can better explain the process to developers as they come on-board for our Visual Studio Team Suite rollout?



11/6/2007 4:23:38 PM 12495 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 7

 I just converted my website ( to a Web Application Project this weekend and it took about 2 days to get everything working.  The best way to look at the conversion is that now you are creating an Assembly with multiple objects.  When you convert the applications, just like in any assembly, you must have unique names.  I went and Namespaces all of the files based on the function / folder they were in.

For example

ASPX File Namespace class name
\Articles\Default.aspx JosephGuadagno.Web.Articles Default
\Articles\Detail.aspx JosephGuadagno.Web.Articles Detail
\BookReviews\Default.aspx JosephGuadagno.BookReviews Default
\BookReviews\Detail.aspx JosephGuadagno.BookReviews Detail

 Fortunately, I did not have any code in the App_Code folder, I used seperate projects for those.  However, the class's Build Action might have been set to "None"

Joseph Guadagno
My Website:
My Blog -

If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
11/6/2007 4:41:31 PM

Similar Artilces:

Converting Web Site from Vb.Net 2003 to Vb.Net 2005
I have a web site in 2003 that I what to convert to 2005. I open my web site in the visual studio 2005 by Local IIS option. I follow the steps of the visual studio conversion wizard.In the conversion report I received the following warning 'Referencepath' settings have not been converted.  Can anyone tell what I have to do to make this warning disappear? Best regards,Sérgio 'Referencepath'  is a property you can set with with VS2003 project file, sothat when ever you to do Add reference this path is serached for class libraries.  We do not  have that ...

Converting web site project to web application in vs 2008
I am converting web site project into web applicatio project in vs 2008 and running into web reference related issue.  I am not so sure how to address this.  Our old web site application had app_webreferences folder with AllServices as sub folder and then all of the web services under that folder. for example:  AllServices\AService.wsdl  AllServices\BService.wsdl   AllServices\CService.wsdl   etc... our code references AllServices.BService in the code or AllServices.AService etc...  It seems like when I Right Clicked on web application project...

how to convert website to web site
Can we convert a website(VB.NET) to website in VS2005???mahmood Why do you want to convert VB into C#? you can create new modules for the site in C#, and they can co-exist in the same system. If you have some specific requirements, then use online tools to convert into c# to convert the codebehind files. Most probably the .aspx file will remain unchanged, but you might need to make some changes here and there.You will get lots of converters online by just googling it. I would strongly recommend avoiding converting codes, as I have faced the horrors of the process. Pr...

VS 2005 SP1 + .NET AJAX => automatically adds web.config in nested Web Application Project when opening project or solution
I get a 'Configuration Error' on an aspx page because VS added automatically a web.config to my nested Web Application Project where no web.config file should be. This effect I have noticed since I have installed SP1 and .NET AJAX Extensions. Why is VS 2005 adding the web.config file and how can I disable this behavior? Following is the content of the automatically added web.config file (comments omitted): <?xml version="1.0"?><configuration>    <appSettings/>    <connectionStrings/>    <system.web> &...

Converting a Web Application Project to a Web Site Project
I converted a VS 2003 web application to VS 2005 using the Web Application Project model.  Is it possible to convert this to a Web Site Project once it is upgraded to VS 2005? We don't have any automated tools to convert from VS2005 WAP to Websites.  If you really prefer to use the website model, I would recommend converting directly from VS2003 to Websites.  To do that you can open the VS2003 app using the "Open Website" command.Omar KhanVisual Web Developer Team I thought you were going to say that.  I have spent quite a bit of time getting rid of most of the warnin...

Converting a Web Site Project to a Web Application Project ?
I upgraded my .NET 1.1 apps to Web Site Projects long before this add on was released and was wondering if there's  a way to convert these Web Site Projects to Web Application Projects because I really did like the old way of just uploading one dll to the web server when updates came around.   Is there a way to do this?In this world there are 10 types of people, those that know binary and those who don't. Here are a couple of tutorials that describe how to do this: C# - VB -

how to tell the project type in .NET? Difference between web application & web site?
Hi, I wonder how can I tell the .NET project type if I got the solution code. Is there any configuration for the project type like: ASP.NET web application, ASP.NET web service application, windows application etc. And is the web site actually a web application project in .NET? Just not clear about the basic concept.   thanks, Hi, in ASP.NET 1.x (visual studio 2002 - 2003) they were real projects but that changed with the initial release of Visual studio 2005 when the concept of website came up. After a while, and quite a lot of asking, Microsoft released the web application pr...

Problem when deploying Web Application project over VS2005 Web Site project
Hi,  we ran into this issue yesterday evening when we were trying to deploy new code on production box. It was running previous version of our app that was VS 2005 Web Site project, but the new version was migrated into Web App project. New build was tested on sandbox and even on the same production machine (but under different, non public web site configured there) and was working fine. However, when we deployed on production web site, we got this error:Compiler Error Message: CS0246: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directi...

Converting a VS 2005 Web Application to a VS .NET 2003 Web Application
Well it seems that I am going against the stream here, but one of our clients wants the web application I wrote in Visual Studio 2005 to be deployed using Visual Studio .NET 2003. What's the best way to go about this without rewriting the whole dang thing? I would probably create a new 2003 project, copy all of your aspx and other files into it, attempt a build and see what happens.  If you didn't use a lot of the new controls (like membership, personalization, masterpages etc, then you will probably be ok with just minor changes.  If you did rely on a lot of the newer c...

how to convert a web application project to a web site
 I need to convert a web application project to a web site.  Is there a conversion program or process available? THXCurt  Easiest way will be to create a blank website, copy all files from web application to new website and change the page directive of all aspx pages.  Rgds,Neolsoft~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Mark as Answer if it helps you~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ THX!...

Convert VB console code into VB.Net Web Application?
Anybody know how to convert this into a project and have a webform work with it instead of the console? ' Copyright (c) 2004, Andrew Brereton' All rights reserved.' ' Redistribution and use in source and binary forms, with or without' modification, are permitted provided that the following conditions are met:'  * Redistributions of source code must retain the above copyright notice, this'    list of conditions and the following disclaimer.'  * Redistributions in binary form must reproduce the above copyright notice,' ...

Error when Deploying and Signing Web Application project with Web Deployment project
I have a Web Application project that needs to be deployed and signed using Web Deployment projects. When I delete the global.ascx file I'm able to do the deployment and sign the output assembly. The error I'm getting without signing the assemblies is "An error occurred when merging assemblies: ILMerge.Merge: The target assembly 'HelloWorld' lists itself as an external reference.” .  Global.ascx or .asax? The usual cause of a signing error is when a reference is not signed.  Is the global.asax.cs or .vb marked as conte...

Web Deployment Project deploying files not included by Web Application Project
Recently my boss asked me to find a way to share a web site project between 2 separate projects which will only share a subset of the files in the folder.  I created 2 web applications projects in the folder and eliminated the web site project.  I discovered when I publish the web application projects, that it wasn't compiling the .as*x pages, so I looked into web deployment projects.  The problem I'm having with web deployment projects is that when I build them from the solution configuration, it copies all the files in the web project to the deployment folder and I c...

Web resources about - Convert VB.Net Web Site to Web Application Project -

Application - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Welfare experiment may have applications in Australia
A trial in Finland providing an obligation-free basic income could change how we think about welfare.

Patent application shows Apple Watch band that transforms into a case, stand and Mac accessory
An Apple patent application published today reveals an idea for an interesting variation on the magnetically-closed Milanese Loop band that allows ...

Seagate Introduces First 8 TB Hard Disk Drive for Consumer NAS Applications
Seagate Technology on Tuesday introduced its new breed of hard disk drives (HDDs) for network area storage (NAS) and RAID applications. The new ...

Panasonic Develops a Stretchable Resin Film and Its Application Materials for Stretchable Electronics ...
A stretchable film is developed. This film stretches to 2.5 times the original length and then returns to the original form. A conductive paste ...

MBA: Mortgage Applications Increased in Latest Weekly Survey, Purchase Applications up 19% YoY
From the MBA: Mortgage Applications Increase in Latest MBA Weekly Survey Mortgage applications increased 21.3 percent from one week earlier, ...

Mortgage applications sink after rush
A Fed rate hike pulled mortgage demand forward, and made for a steep drop-off in the past two weeks.

SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika
SURPRISE! Mizzou Sees Application Drop After Days Of Protests, Illusory Klan Hoods, Poop Swastika

In Application To Move To Los Angeles, Rams Shit All Over City Of St. Louis
... to relocate to the greater Los Angeles metropolitan area. The relocation would be effective for the 2016 NFL League Year.” The Rams’ full application ...

NTU research team discovers optoelectronic application for molybdenum disulfide
A research team under the National Taiwan University (NTU) has discovered an optoelectronic application for molybdenum disulfide (MoS2), a 2-dimensional ...

Resources last updated: 1/14/2016 7:25:46 PM