Click here to Skip to main content
15,868,016 members
Articles / Programming Languages / C#

Troubleshooting Visual Studio Add-ins, Error Numbers and its Possible Solutions

Rate me:
Please Sign up or sign in to vote.
5.00/5 (16 votes)
23 Sep 2012CPOL5 min read 54.4K   15   10
Error Number 8013150a, 80131515, 80131522, 80070002, 80004002, 80004005, 80070057, 80131500, 80131018

Image 1

Table of Contents

Introduction

In this article, I have tried to cover some of the possible solutions for error numbers that we face with Visual Studio add-in exceptions.

These errors can happen during development or post installation.

I have put my time and efforts on all of my articles. Please don't forget to mark your votes, suggestions and feedback to improve the quality of this and upcoming articles.

You might be interested in my article on Visual Studio Add-in - Web Search. Please click here to check my other articles.

Background

While working with Web Search add-in for Visual Studio, I made some notes on add-in error numbers to troubleshoot Visual Studio add-ins. I thought of sharing these notes for the developer community to make life easier while working with Visual Studio add-ins.

If you found any other solutions for any of the problems mentioned here, please let me know.

Error Numbers

Error numbers throws some light on the exception occurred. By using error numbers, we can identify the root cause of the problem.

80131515

Image 2

I got this 80131515 error when I tried to run Web Search add-in from a network location, and I made it work after applying the first solution from this post.

How to Resolve 80131515 Issue

This error comes when we run an add-in files from a network location as the DLL runs from a network location has less permission.

To resolve this issue, we need add loadFromRemoteSources element to the devenv.exe.config file.

Open (with admin rights) the devenv.exe.config file from the below location:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config 

or:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config  

and add loadFromRemoteSources element with "true" value, like below:

XML
<configuration>
   <runtime>
      <loadFromRemoteSources enabled="true"/>
   </runtime>
</configuration>   

Sometimes, the windows tag the downloaded files as "the file comes from a different location" to apply more restrictions on them. The simple solution is to unblock the downloaded zip file or DLL file.

To unblock the file, just right click on the file (zip/dll/setup), go to 'Properties', then select 'General' tab, then click on the 'Unblock' button. Refer to the below screenshot:

Image 3

If you found any other solution to resolve this issue, please let me know.

80131522

Visual Studio Add-in Troubleshooting, Error Number 80131522 - Shemeer

This error comes when the namespace and/or class name of the connect class specified in the .AddIn file doesn't match the actual one declared in the source code.

If you look at the below image, the actual Namespace is WebSearch2012.

Image 5

but in the .AddIn the Namespace is mentioned as WebSearch, that's why it caused the error 80131522.

Image 6

If you found any other solution to resolve this issue, please let me know.

80070002

Image 7

The 80070002 error is caused mostly by two reasons:

  1. The AddIn DLL mentioned in the assembly tag is missing (not valid), or
  2. The AddIn references a DLL that cannot be found.

If you found any other solution to resolve this issue, please let me know.

8013150a

Image 8

This error is due to the lack of permission to the AddIn DLL. This happens when we run AddIn from a network location.

The best and simple solution is to Copy the AddIn to a Local folder and add that folder in the folder list of Addins:

  • Go to Tools->Options.
  • Select Environment.
  • Go to Add in / Macro security tab.
  • Click Add-> select the local folder where you have copied the AddIn file and AddIn DLL.

Image 9

If you found any other solution to resolve this 8013150a issue, please let me know.

80004002

Image 10

The 80004002 error is because the Assembly is not COM visible.

Image 11

I got this error only when I compiled WebSearch with the above code. If the System.Runtime.InteropServices.ComVisible is not mentioned, then its default by True.

Ensure that Connect class is Public and that you have the ComVisible(True) applied at assembly level, or at least at class level.

80004005

Image 12

80004005 is due to invalid file specified in <Assembly> tag:

Image 13

Make sure that the file exits in the specified path mentioned in <Assembly> tag.

If you found any other solution to resolve this issue, please let me know.

80070057

Image 14

This error has probably happened because an Exception occured inside the Add-in code.

Which Exception? Where?

Any unhandled error inside OnConnection method of an add-in class will cause the add-in to be removed from Visual Studio.

The Error Number 80070057 says that an ArgumentException has occurred inside the OnConnection method of Add-in class (mainly Connect class).

Solution

Handling the ArgumentException inside the OnConnection method will resolve this issue.

If you are using any third party add-ins, then you should get the latest add-in component (DLL) with the fix for this bug.

If you found any other solution to resolve this issue, please let me know.

80131018

Image 15

This is due to an unknown file specified in the <Assembly> tag.

Image 16

80131500

Visual Studio Add-in Troubleshooting, Error Number 80131500 - Shemeer

This error has probably happened because an Exception occured inside the Add-in code.

Any unhandled error inside OnConnection method of an add-in class will cause the add-in to be removed from Visual Studio.

The Error Number 80131500 says that an unhandled Exception has occurred inside the OnConnection method of Add-in class (mainly Connect class).

Solution

Expect the un-expected errors Smile | <img src= .

Handling the Exception inside the OnConnection method will resolve this issue.

If you are using any third party add-ins, then you should get the latest add-in component (DLL) with the fix for this bug.

If you found any other solution to resolve this issue, please let me know.

References

Web Search

You might be interested in my article on Visual Studio Add-in - Web Search.

Web Search - Visual Studio Add-in , Search (Google, Yahoo, MSDN, Code Project, Stack Overflow and more...) for the selected text/item - Shemeer NS

Summary

In this article, I have tried to explain some of the common errors with Visual Studio Add-in with multiple solutions, I hope you have enjoyed this article and got some value addition to your knowledge.

I have put my time and efforts on all of my articles, please don't forget to mark your votes, suggestions and feedback to improve the quality of this and upcoming articles.

History

  • 23rd September, 2012: Initial version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect
India India
Technical Manager/ Software Architect | CodeProject MVP | Visual Studio Marketplace Contributor | Author | Geek | Netizen | Husband | ChessPlayer

Most of my articles are listed on top 5 of the respective 'Best articles of the month' and some of my articles are published on ASP.NET WebSite's Article of the Day section.

Check my contributions in Visual Studio Marketplace and Code Project

Technical Blog: https://shemeerns.wordpress.com/
Facebook: http://facebook.com/shemeernsblog
Twitter : http://twitter.com/shemeerns
Google+ : http://google.com/+Shemeernsblog

Comments and Discussions

 
Question80131515 Pin
boefje26-Aug-14 22:49
boefje26-Aug-14 22:49 
Question80131018 Pin
Yogurt17-Sep-13 9:25
Yogurt17-Sep-13 9:25 
GeneralMy vote of 5 Pin
ffernandez2324-Sep-12 2:06
ffernandez2324-Sep-12 2:06 
GeneralMy vote of 5 Pin
Klaus Luedenscheidt23-Sep-12 19:03
Klaus Luedenscheidt23-Sep-12 19:03 
GeneralRe: My vote of 5 Pin
Shemeer NS23-Sep-12 19:54
professionalShemeer NS23-Sep-12 19:54 
GeneralRe: My vote of 5 Pin
Nandita Agrawal513-Mar-13 6:48
Nandita Agrawal513-Mar-13 6:48 
GeneralMy vote of 5 Pin
  Forogar  23-Sep-12 6:19
professional  Forogar  23-Sep-12 6:19 
GeneralRe: My vote of 5 Pin
Shemeer NS23-Sep-12 6:51
professionalShemeer NS23-Sep-12 6:51 
QuestionHey Pin
Brisingr Aerowing23-Sep-12 5:51
professionalBrisingr Aerowing23-Sep-12 5:51 
AnswerRe: Hey Pin
Shemeer NS23-Sep-12 6:49
professionalShemeer NS23-Sep-12 6:49 
Thank you... Smile | :)

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.