a strange exception

  • Thread starter Thread starter Developer.Man4
  • Start date Start date
D

Developer.Man4

when i try using HttpContext.Current.Server.MapPath(path) from a
desktop application built using c# i get a
System.NullReferenceException

can anyone tell me why and what to do??

m using VS2003 and i have iis 6 installed

thanks for time and for ur fast reply
 
(e-mail address removed) wrote in @h3g2000cwc.googlegroups.com:
when i try using HttpContext.Current.Server.MapPath(path) from a
desktop application built using c# i get a
System.NullReferenceException

can anyone tell me why and what to do??

m using VS2003 and i have iis 6 installed

thanks for time and for ur fast reply

Probably because there is no current http context. You'll need to running a
web-application or the like as far as I know - not just a console app.

/Peter
 
Strange? Why would it be strange for there not to be any current HttpContext
in a desktop application? Web Application, yes, but not strange in a desktop
app.
Peter
 
but i have no other option other than building the windows application
how can i refer to the server from my windows application
 
iis is on the same machine.
isn't there other way to retrieve the physical path of a logical path
returned from the directoryServieces objects
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top