Access Application Folder
I am developing a webapplication using asp.net mvc 3.
In the solution I have a project for all the web/presentation things (models, views, controller) and in another project I have my services, daos and domainobject. now I created a config-file in my service-project with some settings. how can I access the file from my services?
If I don't set a path it uses the path of the as开发者_JAVA技巧p.net exe.
Hope someone can help Tobi
You can use AppDomain.CurrentDomain.BaseDirectory
to get proper path.
Or change Build action property of your config file to Embedded Resource (msdn). After that you will be able to retrieve file using ResourceManager
精彩评论