1
I have a WPF project that contains a app.config
containing the consection string and tb have a Data layer of type Classlibrary . dot net Standard in which the Migrations folder should be created.
When I give an "Add-Migration Start" the system is unable to access My app.config and take the Connection string to create Migration.
This error is appearing:
"Unable to load file or Assembly 'System.Configuration.Configurationmanager, Version=4.0.0.0, Culture=neutral, Publickeytoken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the specified file."
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<connectionStrings>
<add name="SistemaComercial" connectionString="Data Source=.\sqlexpress;Initial Catalog=SistemaComercial;Persist Security Info=True;User ID=sa;Password=123" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
What I do to solve?
show how it creates the Migrations on the console.
– ZelDias
Add-Migration Start
– Master JR
NA vdd, I can’t create any. Gives the error I showed above.
– Master JR
check the answer I left below
– ZelDias
check which Packages.config of your application has System.Configuration.Configurationmanager and see if you have it in the references, if I haven’t been using just delete the line that has it and compile the project.
– Marco Souza