Question

I have a business project that contains code for business rules, in this project I have setting file storing the message for exception ( to avoid hard coding).

In UI project, I refer to business project and UI project has a method throws exception which has exception message defined in business project.

But after build, I can not find the Business.config because it didn't copy to the UI bin folder.

So how to include business setting/config file in to UI project?

I figure out that whole the application setting section is included in the Business.dll file. This way I can not change the exception message later without rebuild the solution.

Any idea? Thanks

Was it helpful?

Solution

Right click on the Business.config file in Solution Explorer.

Select Properties and set Property Copy to Output Directory to Copy if Newer or Copy always.

This will copy configuration along with your business project dll (where ever you reference it in other C# project).

See image below:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top