Solved

Add namespaces to converted vb.net web application project

Posted on 2015-01-08
4
296 Views
Last Modified: 2015-01-11
I'm refreshing a vb.net website in VS2013, and experimenting with converting it to a web application.  I've done all the steps of the conversion except adding namespaces to the code files.  There are maybe 150 to 200 code classes in roughly as many module and codebehind files.  

What are some ways to put all this code into a single namespace?

And will I have to change all the class.method calls to include that namespace? That is:

    dim exeG as new GetVars
    rtn = exeG.GetFirstVar(n)

would have to be

    dim exeG as new MyNameSpace.GetVars
    rtn = exe.GetFirstVar(n)

or if public shared,

    rtn = MyNameSpace.GetVars.GetFirstVar(n)

Because that might be more work than the conversion to web application would be worth, given time and budget constraints.
0
Comment
Question by:codequest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
Imran Javed Zia earned 500 total points
ID: 40539740
Hi,

I don't remember any automatic way to perform this action. but you can Put the namespace under "Default Namespace" in project properties, and it doesn't need to be in the code files.

but for maintainability and readability I will recommend you to do it in each file.

Thanks
0
 
LVL 2

Author Comment

by:codequest
ID: 40540994
Thanks for the input.  I think that's on the right track.  However, it still generates a many errors of these types:

'MPMenu' is not declared. It may be inaccessible due to its protection level.      
'MsgBox' is not a member of 'WebApplication1.App_Pages_blah_blah

These errors all seem to appear in the CodeBehind files, not in the class modules.  Also, these errors seem to be limited to some, but not all, ascx user controls + aspx files that have master files.

Any suggestions about those?  If not, I may accept your answer and ask another question.
0
 
LVL 16

Expert Comment

by:Imran Javed Zia
ID: 40542844
You may have to cross check deginer.cs files.
0
 
LVL 2

Author Comment

by:codequest
ID: 40543586
Thanks for the suggestion.  Can you elaborate on that?  I've never worked with the designer files before.  

There appear to be only a few code behind files affected, so if can resolve those, I'll be able to test the rest of the functionality for website vs web application.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question