56

When one user tries to run the application, our ClickOnce application is reporting:

Unable to install or run the application. The application requires stdole Version 7.0.3300.0 in the GAC.

It's interesting to note that the GAC (C:\Windows\assembly) does not have stdole installed in it. How do I get it there?

We are using .NET 3.5, and it has been installed on this computer.

10 Answers 10

67

Try going to the Publish tab in the project properties and then select the Application Files button. Then set the following properties:

  • File Name of stdole.dll
  • Publish status to Include
  • Download Group to Required

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.

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.

2
  • 1
    This scenario did not work for me. I now receive the error "Application Validation did not succeed. Unable to continue." After clicking the "details" button, I get "Strong name signature not valid for this assembly stdole.dll". I'm assuming this is because it's a .NET framework Dll. Commented Feb 17, 2009 at 20:23
  • 5
    You should not be redistributing stdole.dll msdn.microsoft.com/en-us/library/aa195478(office.11).aspx Commented Oct 20, 2011 at 21:38
28

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.

I ended up manually dragging the files in C:\Program Files\Microsoft.NET\Primary Interop Assemblies to C:\windows\assembly and the application worked on that problem machine. You could also do this programmatically with 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!

22

I my case, I solved this issue going to the Publish tab in the project properties and then select the Application Files button. 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.dll assembly.

1 - Located stdole.dll file;

2 - Changed its Publish status to Exclude

3 - After that you need to republish your application.

This issue happened on a Visual Studio 2012, after its migration from Visual Studio 2010.

Hope it helps.

3
  • 4
    This was the way I fixed the issue in VS2010. Including the file most definitely did not work. I had to manually exclude it.
    – Keith
    Commented Dec 3, 2014 at 13:38
  • 1
    In my case, I found that including the file will clash if the target PC has a different version installed. Excluding it is the answer. Thanks. (Using VS 2013.)
    – Peet Brits
    Commented Feb 24, 2016 at 7:47
  • 1
    Worked for me in Visual Studio 2012. I excluded it as suggested, but I tried to do a search for stdole.dll in the entire solution and didn't find anything. Not sure if there's another way to find this reference.
    – Rick
    Commented Feb 15, 2017 at 12:16
13

I had the same problem with a ClickOnce deployment.

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'.

This fixed my problem when I re-published.

I hope this help you :D

5

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.

The best fix we found out was to modify MS Office installation on problematic computers (through the Programs and Features panel) 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.

Then the problem with stdole.dll was fixed.

I hope this might help.

0
1

Well, you can't install to the GAC using ClickOnce. This is documented in this MSDN article.

2
  • Magnus, thanks for the article. However, the install of .NET was bad and the core .NET Dlls were not in the GAC as they should have been. If the .NET install is bad, ClickOnce will not work. Commented Mar 10, 2009 at 1:26
  • Ok, cannot install stdole.dll in GAC using ClickONce. but any installer for install stdole.dll ?? thx
    – Kiquenet
    Commented Aug 2, 2010 at 16:23
1

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 Local to True. I ended up needing to do that with each Microsoft Office/COM-related assembly.

2
  • I'm having this problem now with an app I wrote 4 or 5 years ago, using VS 2010/.NET 4. I tried doing what you suggested, but can't even find the stdole.dll in the Solution Explorer, even with showing all files. (And I checked the path on all of the System files referenced in the project.) So I don't know what's going on.
    – Rod
    Commented Nov 20, 2013 at 16:48
  • I also have this problem.
    – tofutim
    Commented Feb 24, 2014 at 22:01
0

Check if you're really using EnvDTE reference. If not, remove it and recompile.

0

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.

0

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".

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.

Now publish it. The application will look for the dll locally, and the dll is included in the deployment so it will find it.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.