"Mixed mode assembly" in .NET Setup Project

404 views Asked by At

I'm building a c# app in VS2010 that uses Microsoft.SqlServer.Smo assembly.

NOTE: For some reason when I searched this assembly in the addReferance->.NET dialog, I didn't find it, so i had to browse it in ProgramFiles(x86)->Microsoft SQL Server->90->SDK->Assemblies.

This assembly cause "Mixed mode assembly" exception at run-time, so I search the web for fix and found that I need to add App.Config file with:

<startup useLegacyV2RuntimeActivationPolicy="true">
<requiredRuntime version="v4.0.20506"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup>

This fixed the problem, but now I have a new problem. I created a Setup Project for my app and again I have the same "Mixed mode assembly" problem when I run the setup. The problem is I can't add a config file to the a Setup Project. What can I do??

0

There are 0 answers