Config Files in ASP.Net

I think this is a beginner subject of ASP.Net development, however I somewhat miss this thing when I was learning ASP.Net in Uni…

When we creating an ASP.Net web application, sometimes we create other projects under the same solution to handle business logic or other relevant classes. And sometimes we want to create the application config file on that respective project. However that project is not an executable project.. So I confused and asking myself for about an hour to think.. Why the value that I retrieve from the config file (App.config) always null??

The reason is: I put the config file on the project that has no executable, so when I debug and run the solution, it automatically call the web application and all of the config that used is the config of web (which is Web.config).

So instead of using the config file from specific project that does not have executable at all, I should use and set the keys config file where the project is executable.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s