jjaskulowski
jjaskulowski

Reputation: 2564

How to get root path asp.net site but exe path in windows app?

I'm making a nuget library that reads from file. I would like to, by default read the file from:

I don't want to depend on any System.Web.* because requiring System.Web in windows application would be, at least, strange.

Upvotes: 0

Views: 284

Answers (1)

Uriil
Uriil

Reputation: 12618

AppDomain.CurrentDomain.BaseDirectory is what you looking for. Documentation here: https://msdn.microsoft.com/en-us/library/system.appdomain.basedirectory%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

Upvotes: 1

Related Questions