Table of Contents
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.
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 throws some light on the exception occurred. By using error numbers, we can identify the root cause of the problem.
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.
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.
The 80070002 error is caused mostly by two reasons:
- The AddIn DLL mentioned in the
assembly
tag is missing (not valid), or - The AddIn references a DLL that cannot be found.
If you found any other solution to resolve this issue, please let me know.
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.
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
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.
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.
This is due to an unknown file specified in the <Assembly>
tag.
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 .
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.
Web Search
You might be interested in my article on Visual Studio Add-in - Web Search.
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.
- 23rd September, 2012: Initial version