Sue Hernandez's SharePoint Blog

SharePoint and Related Stuff

Error occurred in deployment step ‘Add Solution’: Error: Cannot add the specified assembly to the global assembly cache

Hello Again!

It’s been a while!!  Things have been hectic.  I am now employed at a new job, doing more SharePoint-ie things!!  And thankfully, learning, learning, learning!!

Error Message:

Came across this error today:
“Error occurred in deployment step ‘Add Solution’: Error: Cannot add the specified assembly to the global assembly cache: MyProjectOutput.dll.”

Thanks to a few helpful blog and forum posts, the answer was this:

  1. Either retract solution from Visual Studio, and/or manually remove .dll from the GAC (C:\Windows\assembly)
  2. Close Visual Studio
  3. [Not sure if this is needed] Restart SharePoint Timer Service (SPTimerV4)

Also try these troubleshooting steps:

  • Recycle Application Pool or do an IIS Reset (could also add this as a Pre-Deployment step: Project Settings/SharePoint tab)
  • Put the dll in question into its own solution and deploy that once.  Leave your changes for your main project package.
  • Ensure that if you have multiple projects that reference that DLL (such as a Helper or Utilities class), that you are using the correct reference.  Possibly remove the project reference, and re-add.
  • Check to ensure that any FeatureActivating code is not busting something

Thanks to these references:

 

I hope to keep up the blogging now that things are cooling down!!
~ Sue

Advertisements

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

%d bloggers like this: