?
Solved

Add namespaces to converted vb.net web application project

Posted on 2015-01-08
4
Medium Priority
?
306 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

762 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