Results 1 to 4 of 4

Thread: Application fails to install on other computers

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    13

    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

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,376

    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
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    Lively Member
    Join Date
    Feb 2006
    Posts
    77

    Re: Application fails to install on other computers

    Quote Originally Posted by awweather View Post
    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.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width