“Unable to install or run the application. The application requires that the assembly be installed in the Global Assembly Cache (GAC) first.”

I recevied this error while compiling my first C# production application. I had to do the following in Visual Studio for the project:

  1. In Solution Explorer, expand the References node and click the assembly listed in the error. Ensure Copy Local in the Properties grid is set to ‘True’.
  2. In the properties of the project, Publish | Application Files Tab, ensure the Publish Status for the assembly listed in the error is set to ‘Include’
About these ads
Explore posts in the same categories: Uncategorized

Tags: , , , , , ,

You can comment below, or link to this permanent URL from your own site.

8 Comments on ““Unable to install or run the application. The application requires that the assembly be installed in the Global Assembly Cache (GAC) first.””

  1. Bob T. Says:

    You are the man. I had the same problem with VB 2008 Express and made the Office Core assembly true. I also changed two of the publishing choices from automatic to include, not sure of if I needed to but ran the install again and worked. Now I can send a
    Beta to my client and he can look at the program.

    Thank you.

  2. james igoe Says:

    Thanks. Clearest fix found. Everything else was just confused.

  3. Bill Dickinson Says:

    Interesting. I have all these settings as described, but still get an error message. I added a new, in-house-developed assembly to my click-once application, which up until now, has installed just fine for years. Any ideas???

  4. Bill Dickinson Says:

    Ok, our case was slightly different from those described already. But, others may encounter it and wonder what’s going on, so here’s what happened to us (abbreviated):

    1. Application A references class library assemblies B and C.
    2. Assembly B references several classes in assembly C.
    3. Assembly C was updated with several new classes and the version number was incremented from 1.0.0.4 to 1.0.0.5
    4. Rebuild of A went fine but during the publish step, two dependency entries for assembly C were written to application A’s manifest. The were:

    - dependencyType=”install” for version 1.0.0.5
    - dependencyType=”preRequisite” for version 1.0.0.4

    This last dependency caused the GAC error because version 1.0.0.4 was never written to the GAC in the first place, yet the manifest is saying that it should be in the GAC because of the preRequisite dependency type.

    The cause for all this was simply this: assembly B, although not modified in anyway, needed to be rebuilt to update the version number of assembly C it referenced.

    Hope this helps others.

    Cheers.

  5. Dmitriy Reznik Says:

    Thank you very much. After several days of struggle your solution did work for me!!

  6. Hifni Says:

    Thank You Very Much! This solved my problem.

  7. Sajjad Says:

    Man..you made my day…suddenly stopped working and you fixed the issue..can go home now…Tanks a lotttttttttt


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: