.net 错误消息“无法安装或运行该应用程序。该应用程序需要 GAC 中的 stdole 版本 7.0.3300.0”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/558361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error message "Unable to install or run the application. The application requires stdole Version 7.0.3300.0 in the GAC"
提问by proudgeekdad
When one user tries to run the application, our ClickOnce application is reporting:
当一位用户尝试运行该应用程序时,我们的 ClickOnce 应用程序会报告:
Unable to install or run the application. The application requires stdole Version 7.0.3300.0 in the GAC.
无法安装或运行该应用程序。该应用程序需要 GAC 中的 stdole 版本 7.0.3300.0。
It's interesting to note that the GAC(C:\Windows\assembly) does not have stdole installed in it. How do I get it there?
有趣的是,GAC(C:\Windows\assembly) 中没有安装 stdole。我怎么把它弄到那里?
We are using .NET 3.5, and it has been installed on this computer.
我们正在使用 .NET 3.5,并且它已安装在这台计算机上。
采纳答案by proudgeekdad
So it turns out that the .NET files were copied to C:\Program Files\Microsoft.NET\Primary Interop Assemblies\. However, they were never registered in the GAC.
所以事实证明 .NET 文件被复制到C:\Program Files\Microsoft.NET\Primary Interop Assemblies\. 但是,它们从未在GAC 中注册。
I ended up manually dragging the files in C:\Program Files\Microsoft.NET\Primary Interop Assembliesto C:\windows\assemblyand the application worked on that problem machine. You could also do this programmatically with Gacutil.
我最终手动将文件拖入其中C:\Program Files\Microsoft.NET\Primary Interop Assemblies,C:\windows\assembly并且该应用程序在该问题机器上运行。您也可以使用Gacutil 以编程方式执行此操作。
So it seems that something happened to .NET during the install, but this seems to correct the problem. I hope that helps someone else out!
因此,在安装过程中 .NET 似乎发生了一些事情,但这似乎解决了问题。我希望能帮助别人!
回答by Darin Dimitrov
Try going to the Publishtab in the project properties and then select the Application Filesbutton. Then set the following properties:
尝试转到项目属性中的“发布”选项卡,然后选择“应用程序文件”按钮。然后设置以下属性:
- File Nameof stdole.dll
- Publish statusto Include
- Download Groupto Required
- stdole.dll 的文件名
- 发布状态,以包括
- 将组下载到必需
After that you need to republish your application.
之后,您需要重新发布您的应用程序。
If the reference has CopyLocal=true, then the reference will be published with the application. If the reference has CopyLocal=false then the reference will be marked as a prerequisite. This means the assembly must be installed in the client's GAC before the ClickOnce application will install.
如果引用具有 CopyLocal=true,则引用将与应用程序一起发布。如果引用具有 CopyLocal=false,则引用将被标记为先决条件。这意味着必须在安装 ClickOnce 应用程序之前将程序集安装在客户端的 GAC 中。
There are some assemblies that are installed into the GAC because of the Visual Studio install, not the .NET Framework install. This could be your situation.
由于 Visual Studio 安装,而不是 .NET Framework 安装,有一些程序集安装到 GAC 中。这可能是你的情况。
回答by Julio Nobre
I my case, I solved this issue going to the Publishtab in the project propertiesand then select the Application Filesbutton. Then just:
我的情况是,我在项目属性中的“发布”选项卡中解决了这个问题,然后选择“应用程序文件”按钮。那么只需:
Note:Before you apply this solution, make sure that you have already (as I did), checked all your solution's projects and found no references to stdole.dllassembly.
注意:在应用此解决方案之前,请确保您已经(像我一样)检查了所有解决方案的项目,并且没有发现对stdole.dll程序集的引用。
1 - Located stdole.dllfile;
1 - 位于stdole.dll文件;
2 - Changed its Publish statusto Exclude
2 - 将其发布状态更改为排除
3 - After that you need to republish your application.
3 - 之后您需要重新发布您的应用程序。
This issue happened on a Visual Studio 2012, after its migration from Visual Studio 2010.
在从 Visual Studio 2010 迁移后,此问题发生在 Visual Studio 2012 上。
Hope it helps.
希望能帮助到你。
回答by rpf
I had the same problem with a ClickOnce deployment.
我在 ClickOnce 部署中遇到了同样的问题。
I solved the problem by going to the 'Publish' tab in the project properties and then selecting the 'Application Files' button.
我通过转到项目属性中的“发布”选项卡,然后选择“应用程序文件”按钮解决了该问题。
I then selected the options:
然后我选择了以下选项:
- 'File Name' of 'stdole.dll'
- 'Publish status' to 'Include' and
- 'Download Group' to 'Required'.
- “stdole.dll”的“文件名”
- “发布状态”到“包括”和
- 将“下载组”改为“必需”。
This fixed my problem when I re-published.
当我重新发布时,这解决了我的问题。
I hope this help you :D
我希望这对你有帮助:D
回答by Benlitz
We had the same issue with our ClickOnce application that uses Interop with Microsoft Office. It happened only on a few computers in the company.
我们的 ClickOnce 应用程序使用与 Microsoft Office 的互操作,我们遇到了同样的问题。它只发生在公司的几台计算机上。
The best fix we found out was to modify MS Office installation on problematic computers (through the Programs and Featurespanel) and ensure that ".NET programmability feature" (not sure of the name of the component - our Microsoft_Office versions are not English) was installed for each of the MS Office applications (Excel, Word, Outlook, etc.). This seems to not be included in a default install.
我们发现的最佳解决方法是在有问题的计算机上修改 MS Office 安装(通过“程序和功能”面板)并确保“.NET 可编程功能”(不确定组件的名称 - 我们的 Microsoft_Office 版本不是英文)是为每个 MS Office 应用程序(Excel、Word、Outlook 等)安装。这似乎不包含在默认安装中。
Then the problem with stdole.dll was fixed.
然后stdole.dll 的问题就解决了。
I hope this might help.
我希望这可能会有所帮助。
回答by user1422348
My solution: I opened the references folder in Solution Explorer (showing all files), and for each assembly that the installation complained about (the name of the assembly may not be exactly the same as the filename of the assembly - within object explorer, but easy enough to figure out), I changed the Copy Localto True. I ended up needing to do that with each Microsoft Office/COM-related assembly.
我的解决方案:我在解决方案资源管理器中打开了references 文件夹(显示所有文件),并且对于安装抱怨的每个程序集(程序集的名称可能与程序集的文件名不完全相同 - 在对象资源管理器中,但是很容易弄清楚),我将Copy Local更改为True。我最终需要对每个与 Microsoft Office/ COM相关的程序集执行此操作。
回答by Magnus Johansson
Well, you can't install to the GAC using ClickOnce. This is documented in this MSDN article.
好吧,您无法使用 ClickOnce 安装到 GAC。这在这篇 MSDN 文章中有记录。
回答by Magnus Johansson
Check if you're really using EnvDTE reference. If not, remove it and recompile.
检查您是否真的在使用 EnvDTE 参考。如果没有,请将其删除并重新编译。
回答by Mike
Interesting, I didn't have any references to stdole in my project, but I had a user still receiving the error. I had to add the reference, then change the setting to include. Hopefully that will work.
有趣的是,我的项目中没有任何对 stdole 的引用,但我的用户仍然收到错误消息。我必须添加引用,然后更改设置以包含。希望这会奏效。
回答by RobinDotNet
To H2oRider -- does your application access the Oracle dll in the GAC? What I recommend you do is this: Add the dll to your project and set the build action to "content" and set "copy to output directory" to "copy always".
对于 H2oRider——您的应用程序是否访问 GAC 中的 Oracle dll?我建议您这样做:将 dll 添加到您的项目并将构建操作设置为“内容”并将“复制到输出目录”设置为“始终复制”。
Then delete your reference(s) to the dll in the GAC. Re-add the reference, but this time drill down to the one you just added to your project.
然后删除您对 GAC 中 dll 的引用。重新添加引用,但这次深入到您刚刚添加到项目中的引用。
Now publish it. The application will look for the dll locally, and the dll is included in the deployment so it will find it.
现在发布它。应用程序将在本地查找 dll,并且 dll 包含在部署中,因此它会找到它。
If this doesn't work, then it might be that you can not use that dll if included locally rather than in the GAC. This is true of some assemblies, like the Office PIAs. In that case, the only way to deploy it is to wrap it in a setup & deployment package and use the Bootstrapper Manifest Generator to turn it into a prerequisite you can publish with ClickOnce deployment.
如果这不起作用,那么如果包含在本地而不是 GAC 中,您可能无法使用该 dll。这适用于某些程序集,例如 Office PIA。在这种情况下,部署它的唯一方法是将其包装在设置和部署包中,并使用 Bootstrapper Manifest Generator 将其转换为您可以使用 ClickOnce 部署发布的先决条件。

