Solved

The name does not exist

Posted on 2013-06-17
7
479 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
[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
  • 5
  • 2
7 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39255133
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
ID: 39255139
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
ID: 39255146
tried ... Environment.CurrentDirectory ...
0
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!

 
LVL 5

Author Comment

by:allanau20
ID: 39255147
kaufmed; I need to step out for 4 hrs ... brb...
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 39255149
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
ID: 39255156
Oh.I see. I will try it soon. Thanks!
0
 
LVL 5

Author Closing Comment

by:allanau20
ID: 39255167
Thanks again and again!!
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET Calendar Control 5 54
Nested forach loop to linq 3 42
Difference between Leaflet and MapBox? 5 45
XML Constructor Throwing Incorrectly Structured Document Error 4 23
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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