views:

382

answers:

4

I'm trying to deploy a VB.NET app which is an extension to Excel using VSTO. It works fine in the development environment, but when someone else (without a dev environment installed, just the .NET framework) installs it, they get:

The common language runtime could not be loaded by <application>. Contact your administrator for further assistance.

Google pops up the microsoft help page for this:

http://msdn.microsoft.com/en-us/library/6s0wczt9.aspx

But I've verified that the .NET versions are the same on both machines. For VSTO apps in 2k5 there was a specific vsto runtime library users needed to install -- is there something similar for VS2008 that I haven't found yet? Any ideas besides that?

Thanks in advance!

A: 

Make sure they have the correct version of the .NET framework. If they have .NET 1.1 (or even 2.0) installed, and you're targetting the 3.5 framework, you can get this error message.

Reed Copsey
As mentioned above, I verified that they're the same -- I suppose I should have mentioned that both machines have v3.5 installed.
sam
@sam: Was the only idea I had - since you had just mentioned that the framework was installed. Both are 3.5sp1, or just 3.5? If you're using sp1 on VS or the framework, you can have incompat. issues, too.
Reed Copsey
They're both 3.5sp1.
sam
A: 

We had the same problem. It's all to do with security policy.

There are issues with the security policy for your DLL's when running VSTO projects.

Namely you need to grant 'full trust' to your assemblies. What this means you have to A) sign your projects with a key, and B) register your assemblies as having full trust during deployment (which can be done easily with CASPOL.exe: http://msdn.microsoft.com/en-us/library/cb6t8dtz.aspx)

Its very easy to do. Alternatively you can roll your own security-setting assembly which you integrate into your msi (thats what we did)

Check out this MSDN Article for the full details: http://msdn.microsoft.com/en-us/library/zdc263t0.aspx

Matthew Rathbone
I thought for sure this would do it -- unfortunately, no love. I had already strong-named the assembly, and dropped it in the GAC (which apparently makes it fully trusted automatically). The security gotchas were always the trouble the last time I tried this in VS2k5. Alas, not this time. Ready to never use VS again at this point...
sam
My experience has been that with VS 2008 and VSTO 3.0, you no longer need to worry about the CAS policy. It works without doing this, but the AddIn assemblies do still need to be signed.
Dennis Palmer
thats not the answer, its because he didn't have VSTO 3.0 runtime installed. If that was installed also check that SP1 + the runtime extensions are on there.
Anonymous Type
A: 

For VSTO apps built with Visual Studio 2008, The VSTO version 3.0 Runtime is required.

Here is the download page: http://www.microsoft.com/downloads/details.aspx?FamilyID=54eb3a5a-0e52-40f9-a2d1-eecd7a092dcb&amp;DisplayLang=en

Dennis Palmer
this is the right answer.
Anonymous Type
@Anonymous Type, I appreciate the comment, but an upvote would also be nice. It would also push this answer up to the top of the list. Thanks!
Dennis Palmer
A: 

Install VSTO runtime 3.0 Then update it to VSTO 3.0 SP1 also install VSTO_PTExtLibs.exe (PIA extension libs for runtime) if you are referencing these in your project.

Anonymous Type