Solved

The name does not exist

Posted on 2013-06-17
7
464 Views
Last Modified: 2013-06-17
Hi Experts!

Thanks for reading this.

Not sure what reference is missing for this error.

Does Not Exist in the current context
TIA!
0
Comment
Question by:allanau20
  • 5
  • 2
7 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
The "My" namespace does not exist in C#. To get the application startup path, try using:

string strPath = Application.StartupPath;
0
 
LVL 5

Author Comment

by:allanau20
Comment Utility
Thanks kaufmed.

Tried it, but it says:

The name 'Application' does not exist in the current context

Ctrl + '.' (period) suggests to add: System.Net.Mime.MediaTypeNames.Application
0
 
LVL 5

Author Comment

by:allanau20
Comment Utility
tried ... Environment.CurrentDirectory ...
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 5

Author Comment

by:allanau20
Comment Utility
kaufmed; I need to step out for 4 hrs ... brb...
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
Comment Utility
I took a stab that you were writing a Forms application. If you are, then that logic should work. If, however, you are writing a console application, then you won't have access to the Application class, and you have to do something like this:

using System.IO;
using System.Reflection;

...

string strPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

Open in new window


If this is a web application, then I would have to ask:  What do you need the startup path for?
0
 
LVL 5

Author Comment

by:allanau20
Comment Utility
Oh.I see. I will try it soon. Thanks!
0
 
LVL 5

Author Closing Comment

by:allanau20
Comment Utility
Thanks again and again!!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Log4Net custom Appender not being fired. 5 41
Paging GridView 7 32
How can I use this extension method? 8 35
Showdialog 8 20
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now