The assembly * could not be found at or could not be loaded
I have seen others post this question, but after trying the offered solutions, I have yet to get any satisfaction. Here's the deal. I created an Excel 2003 workbook project in VS2008. No matter what configuration I try on the client machine, I get the above error when opening the workbook.
Here's a list:
OS's are all Windows XP Professional x32
PIA for Office 2003 is installed
VSTO version 3 runtime is installed
using .NET 2.0 configuration tool shows the assembly as trusted
caspol shows the assembly as trusted
I went through the articles, msdn2.../library/bb332051 and bb332052, about 837 times and followed the instructions to the letter.
I used the .NET 2.0 config tool to manually add the folder where the workbook is installed as a trusted location.
I used the above to remove the trusted location to see if there would be any change.
I used the SetSecurity project to set up the workbook/assembly as trusted. After using SetSecurity and installing, I was able to confirm, using .NET 2.0 config tool and caspol, that the assembly was trusted.
.NET frameworks and service packs are installed to version 3.5
As stated above, no matter what the security settings are, I get the same error message. Since my monitors like the privilege of remaining on my desk, I am humbly requesting help before they end up scattered from here to the office at the end of the hall.
I thank everyone in advance for any shred of a clue that can be provided.
Answers
Your first post mentions that VSTO version 3 runtime is installed. Note that this version of the VSTO runtime is compatible only with Office 2007 projects.
For Office 2003 projects (including those created by using Visual Studio 2008), the client computer must have the Visual Studio 2005 Tools for Office Second Edition runtime installed. For more information, including download links, see http://msdn2.microsoft.com/en-us/library/ms178739.aspx. Note that both versions of the runtime are installed automatically when you install Visual Studio 2008, which would explain why your installer works on a different computer that has VS installed.
I understand the name of this version of the runtime is a bit confusing, because you're using Visual Studio 2008, but the history behind the runtime names is too long and complex to go into here.

I hope this helps,
McLean Schofield
All Replies
- have you tried creating a blank excel project with no code at all? does still produce an error?
if yes, then your installation is most likely corrupt. otherwise try to locate code which causes this error, i.e. comment all code and then uncomment it line by line
this way you will at least locate the statement causing problems and then think of solution Actually, for test purposes, the workbook has one line of code, the usual MessageBox.Show("you did it right") type of thing. I developed it on one machine, created the install package and installed it on my other machine (I have VS2008 and Office 2003 installed on both) and it works fine on both of those machines. I have another machine to simulate client installs and it fails. I also tried it on two other client machines with Office 2003 installed and it fails exactly the same way every time.
Thanks for your reply but the criterion of a shred of a clue was not met

Your first post mentions that VSTO version 3 runtime is installed. Note that this version of the VSTO runtime is compatible only with Office 2007 projects.
For Office 2003 projects (including those created by using Visual Studio 2008), the client computer must have the Visual Studio 2005 Tools for Office Second Edition runtime installed. For more information, including download links, see http://msdn2.microsoft.com/en-us/library/ms178739.aspx. Note that both versions of the runtime are installed automatically when you install Visual Studio 2008, which would explain why your installer works on a different computer that has VS installed.
I understand the name of this version of the runtime is a bit confusing, because you're using Visual Studio 2008, but the history behind the runtime names is too long and complex to go into here.

I hope this helps,
McLean Schofield
- Many, many thanks. I knew from the consistency of the errors that it had to be something like that, but I couldn't for the life of me figure it out. My equipment also thanks you.

