I have a problem and maybe someone can help me.
I'm working on a ASPNET MVC
project so I've structured the solution into multiple projects to break down the different components.
In my main project web.config file (for example PROJETO1.Principal
) I'm trying to set up to fetch references from the connection
strings of the general project (for example PROJETO.Geral
), in this general project I have the files app.config
that contains my connections
strings.
The general.config code looks something like this:
<connectionStrings configSource="app.config"></connectionStrings>
In my code app.config
looks like this:
<?xml version='1.0' encoding='utf-8'?>
<connectionStrings>'
(lista minhas connections strings)'
</connectionStrings>
But it does not work, the error below occurs:
The configSource file 'app.config' could not be opened.
I tried to specify the path of the file, the following error occurs:
The configSource
attribute must be a relative physical path.
It's worth mentioning that the error occurs at the point that I try to open the list of connections
using ConfigurationManager
(I also tried with WebConfigurationManager
but without success).
Another thing, if the file app.config
was within the same project it would work without problem.