Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handler fails with wrong encoding #8

Open
EMostafaAli opened this issue Jan 12, 2022 · 0 comments
Open

Handler fails with wrong encoding #8

EMostafaAli opened this issue Jan 12, 2022 · 0 comments

Comments

@EMostafaAli
Copy link

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.
image

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant