我正在 VS2010 中构建使用 Microsoft.SqlServer.Smo 程序集的 ac# 应用程序。
注意:由于某种原因,当我在 addReferance->.NET 对话框中搜索此程序集时,我没有找到它,因此我必须在 ProgramFiles(x86)->Microsoft SQL Server->90-> 中浏览它;SDK->程序集。
此程序集在运行时导致“混合模式程序集”异常,因此我在网上搜索修复,发现我需要添加 App.Config 文件:
这解决了问题,但现在我有一个新问题。
我为我的应用程序创建了一个安装项目,当我运行安装程序时,我再次遇到了相同的“混合模式程序集”问题。
问题是我无法将配置文件添加到安装项目中。我能做些什么??
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??
发布评论