My Winform applilcation has used Microsoft.SqlServer.Management.Common namespace(assembly :Microsoft.Sqlserver.smo.dll/Microsoft.Sqlserver.ConnectionInfo.dll) and developed in .NET 4.0.
Problem:Application is throw an exception when it tries to use above assembly reference methods. Full error text is shown below,
"Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. "
Error is resolved when we include "app.config" file with below code,
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
But, I need to keep configuration file as "renamed.config" and not to include app.config file as of the project requirement.I have set configuration file as "renamed.config" file using below code,
//AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", "d:\\reanmed.config" );
I have also included <Startup> element in this "renamed.config" configuration file and removed the app.config file.But it raise me below error, it always expect app.config file with <Startup> element to resolve this iss
View Complete Post