Main Topics
Browse All TopicsHi
I have created a library based project. I want to access a file using server.Mappath()
how can I do that
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually, there is. Check your references as explained above. See the screenshot. Perhaps your local browser (class browser) has it wrong. You cannot always trust the intellisense.
These classes are around since asp.net 2.0. If you add the reference to a non-asp.net project, you can still access them. Try typing them in as some experts have shown you and try to compile.
You do not need to add System.Web in front, if the "Imports System.Web" is in place on top of your class, you can use it without.
-- Abel --
PS: when you check the references, you can also check if the correct dll is installed here: %SystemRoot%\Microsoft.net
I'm afraid you have a corrupted or incomplete framework install. You can check the location I mentioned for the existence of the file. But if this is correct, you are not using framework 2.0 and/or you cannot create any asp.net application or web site. Is that correct? Can you check the directory I mentioned?
Also, can you check under Properties of your current project what the framework is that it points to?
> Name 'HttpContext' is not declared.
another thing: sometimes an error originates elsewhere. Can you remove these statements and remove the System.Web reference, do a Clean and then a Rebuild All. If that is error free, try again adding the System.Web, do a new Rebuild All. Now add the "Imports System.Web" and the statement (make sure to assign it to something, like this):
Dim xxx As String = HttpContext.Current.Server
Rebuild again. Does the error re-occur? Then check the things I mentioned in the previous post.
-- Abel --
Please see my comments: this does not matter. The Class Library project MUST HAVE the references as mentioned. The references MUST EXIST on your system.
I explained the bits on creating a web app just to be sure that the libs are there, I never meant for you to change your project type. If you cannot create a web app (regardless whether you are currently doing a lib project), you cannot build your library.
The framework must be installed and must have the correct version. If it isn't or if it has the wrong version, then download the framework and then try again.
Business Accounts
Answer for Membership
by: NNirmalanPosted on 2009-08-31 at 01:41:14ID: 25221283
http://www.devasp.net/net/ articles/d isplay/737 .html
this
Check