65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIconstarIconstarIcon

5.00/5 (15 votes)

Sep 23, 2012

CPOL

5 min read

viewsIcon

56137

Error Number 8013150a, 80131515, 80131522, 80070002, 80004002, 80004005, 80070057, 80131500, 80131018

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

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:

<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:

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.

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

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

80070002

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

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.

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

80004002

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

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

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

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

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

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

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