-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I am trying to test my plugin with this handler in 2022 but it always shows the following error when I click the handler button.

First, I thought it is a problem with my code but I found the same error happens with any addin. I checked the handler code and I found the error happens in this line which parse each addin
| XElement addin = XElement.Load(file); |
The error happens if an addin has a wrong encoding. Actually, I found the reason is Autodesk.RobotStructuralAnalysysLink.Application.addin is encoded as UTF-8 but says UTF-16 as shown below. If I remove this file, the handler and my addin will work fine.
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<RevitAddIns>
<AddIn Type="Application">
<Assembly>c:\Program Files\Common Files\Autodesk Shared\Extensions 2022\Modules\RSA\Revit2RobotConnector\Autodesk.RobotStructuralAnalysysLink.Application.dll</Assembly>
<Text>Revit2RobotConnector UI Application</Text>
<ClientId>D9AC7590-0F0C-4D41-8915-EDA2EDED1B44</ClientId>
<Name>Robot Structural Analysys Link Application</Name>
<FullClassName>Autodesk.Revit.UI.Revit2RobotConnector.Revit2RobotConnectorApplication</FullClassName>
<VendorId>ADSK</VendorId>
<VendorDescription>Autodesk, www.autodesk.com</VendorDescription>
</AddIn>
</RevitAddIns>
I guess the way to solve this is to wrap the code in foreach in a try-catch block
Metadata
Metadata
Assignees
Labels
No labels