|
-
May 20th, 2013, 01:06 PM
#1
Thread Starter
New Member
Application fails to install on other computers
Hello,
I created an app that will allow a user to send an email through outlook (VB 2008). It works perfectly fine on my computer, but whenever I attempt to install it on another machine, I get an error saying that microsoft.office.interop.outlook version 15 needs to be installing in the global assembly cache first. I have looked online, but have not find a solution that actually works.
Any help would be appreciated.
Anthony
-
May 20th, 2013, 03:13 PM
#2
Re: Application fails to install on other computers
Every google result said just about the same thing:
1) did you include the .dll
2) is the correct version of Microsoft Office installed
-
May 20th, 2013, 04:15 PM
#3
Lively Member
Re: Application fails to install on other computers
 Originally Posted by awweather
Hello,
I created an app that will allow a user to send an email through outlook (VB 2008). It works perfectly fine on my computer, but whenever I attempt to install it on another machine, I get an error saying that microsoft.office.interop.outlook version 15 needs to be installing in the global assembly cache first. I have looked online, but have not find a solution that actually works.
Any help would be appreciated.
Anthony
The same versions of outlook are not installed.
Try an If then statement, pointing to different versions of the interop assembly versions... i.e. 12, and 14.
-
May 20th, 2013, 10:39 PM
#4
Re: Application fails to install on other computers
I think a bit of background is in order here. Office applications are COM-based and .NET applications are not directly compatible. When you reference the object library of an Office application, your .NET code needs to interoperate with its COM code and that's where the Interop assembly comes in. It is a .NET library, so your application can talk to it directly, but it contains code that can communicate with a COM library.
When you reference an Office object library in a .NET application, the IDE can generate an Interop assembly, as it can for any COM library, or it can use an existing assembly. Such an existing assembly is known as a Primary Interop Assembly (PIA) and is installed in the Global Assembly Cache (GAC) so that multiple applications can use the one library instead of all carrying their own copy. If I'm not mistaken, the most recent version of Microsoft Office installs PIAs by default. Perhaps that previous one did too but I'm fairly certain that older versions, while having PIAs available, did not install them for you. You had to either install them on each client or deploy your own copy with your app.
Also, when you reference an Office object library, your app will only work with that specific version. All users of your app will have to have that version installed or your app won't work. If all your users are going to be using the same version of Office but you don't have that version installed on your development machine, you're going to have to install the appropriate PIAs on your machine and then reference that. If you're users may have different versions of Office installed and you want to be able to support them you can't have any reference at all. In that case, you must use late-binding.
To support multiple versions, developers usually start by adding a reference and developing against that. When the application is done, they then remove the reference and look at addressing all the errors that arise. It's best to start with Option Strict On for the project and leave it On, then just turn it Off at the file level for those files that specifically need to use late-binding. Even then, it's best to leave it On in the existing file and add a new code file containing a partial class and move just the method(s) that need to use late-binding into that file, setting Option Strict Off at the top. You should probably also do a bit of refactoring to keep the amount of code in those new files to an absolute minimum, which means that as much code as possible is executing with Option Strict On.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|