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

Reopening of file results in duplicate sender inputs & outputs (dynamo 2.0) #56

Closed
BCoop94 opened this Issue Feb 4, 2019 · 20 comments

Comments

Projects
None yet
6 participants
@BCoop94
Copy link

commented Feb 4, 2019

Each time a dynamo 2.0 script is reopened any saved speckle sender component has all its inputs and outputs duplicated.

@BCoop94 BCoop94 changed the title Reopening of file results in duplicate sender inputs (dynamo 2.0) Reopening of file results in duplicate sender inputs & outputs (dynamo 2.0) Feb 4, 2019

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

Hey @BCoop94 this happened to me too once, but couldn't consistently replicate it... Will look into it but if you can tell us how to replicate it it would be very helpful!

@ksobon

This comment has been minimized.

Copy link

commented Feb 5, 2019

@teocomi its caused by the exact version of Newtonsoft.Json library that you are using. It has to be v. 8.0.3. Don't ask me why.

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

@ksobon I doubt that's the reason since I'm not including Newtonsoft.Json in the built...

@mjkkirschner

This comment has been minimized.

Copy link

commented Feb 5, 2019

for some reason, lets assume we don't know it yet - the json constructor is not being called when the graph is opened - this is usually caused by json.net of a different version being loaded and runtime attributes evaluating to different types.

ie - [JsonConstuctor of 8.03] is not equal to [JsonConstructor of 10.x] for example

@mjkkirschner

This comment has been minimized.

Copy link

commented Feb 5, 2019

one approach to fixing this which I have not tried, could be to combine both constructors into one and do the right thing in either case...

Also have the user check for addins which are loading a different version of json.net - in the end the attributes are still compared at runtime, I'm not sure how frody will help here.

@ksobon

This comment has been minimized.

Copy link

commented Feb 5, 2019

If you got a [JsonConstructor] in there, that was the only thing that was causing this for me. I agree with @mjkkirschner and you guys got dependencies on v. 11 in there:

image

@mjkkirschner Fody.Costura doesn't help here either because it checks the current app domain for loaded assemblies and then skips them if one is loaded. That means Revit would load the v8.0.3 and your packaged resource that comes with Fody will never be used.

@mjkkirschner

This comment has been minimized.

Copy link

commented Feb 5, 2019

I would be interested to know what other addins the user has installed, since I think this extension has been working fine for others.

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

@ksobon yes it's referencing v11 but it's not including it in the release, so should be using whatever Dynamo comes with.
It's probably as mike says, where there's another plugin/package creating the problem, but until we can consistently replicate it we won't know...

@ksobon

This comment has been minimized.

Copy link

commented Feb 5, 2019

@teocomi I understand that you are not including it in the release, but that's not the issue here. As far as I understand the issue is that Newtonsoft.Json is a strong-named assembly. When you referenced that in your solution, it will look for that assembly at runtime, and it will look for the specific version that was referenced in your solution (that's what strong-naming is for). So the fact that you are not including it doesn't make a difference here because I think that even though Revit loads v.8.0.3 your solution is looking for v.11.0.1 and it can't find it.

I think that's what's going on here.

I think there are couple of things to consider here as potential solutions:

  • if you have to have a dependency on v11.0.1, then try adding Assembly Resolver ex. AppDomain.CurrentDomain.AssemblyResolve or edit the App.config to point at the specific version dll in your app's sub-folder. I think you will have to actually start including the file.
  • if you don't have to have a dependency on v11.0.1, then consider changing it to v.8.0.3 which is the version used by Revit and Dynamo out of the box. That has proved to work relatively well for me in the past.

Cheers!

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 5, 2019

Hey @BCoop94 I'd need a few more info to help you:

  • what version of speckle are you using?
  • what version of dynamo?
  • does this issue occur ALL the times or only SOME times?
  • does it also occur when using Dynamo sandbox: C:\Program Files\Dynamo\Dynamo Core\2\DynamoSandbox.exe ?
@BCoop94

This comment has been minimized.

Copy link
Author

commented Feb 5, 2019

Hi @teocomi,

  • I installed speckle v1.2.2 however in installed packages it is listed as v1.0.1
  • Dynamo 2.0.2
  • So far the issue has occurred all the time upon reopening a save file.
  • I can not replicate the issue in Dynamo sandbox.
@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 6, 2019

Thanks @BCoop94 , since you cannot replicate the issue in Dynamo sandbox, it makes me think there's a compatibility problem with another plugin/package.
Can you please send me a screenshot of your installed Dynamo packages (Packages > Manage Packages...)?
A screenshot of the installed Revit plugins would also be helpful if you can share it.

@BCoop94

This comment has been minimized.

Copy link
Author

commented Feb 6, 2019

@pereiraTTW

This comment has been minimized.

Copy link

commented Feb 7, 2019

Hi @teocomi,

I just installed Revit 2019 (19.0.0.405), Dynamo 2.0.2 and the latest Speckle, and I'm getting the same behaviour. I have no other packages installed.

I create a new sender, plugged some random values, and saved the Dynamo file.

image

We deployed our own server, so I tried the same in the Speckle Hestia server and inputs and outputs are repeated.

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 7, 2019

Hi both @pereiraTTW @BCoop94 I still cannot replicate the bug, my guess is that it's a Revit plugin causing the problem.

Could you please either:

  • temporarily disable all your revit plugins and try again
  • send me a copy of your revit plugins and I'll try myself (if you can share them)

The Revit plugins are generally stored in a few locations:

%appdata%\Autodesk\Revit\Addins
C:\ProgramData\Autodesk\Revit\Addins
C:\ProgramData\Autodesk\ApplicationPlugins
C:\Program Files\Autodesk\Revit 20XX\AddIns\

To disable the plugins, just move them to another folder. To send them to me you can zip them and share them on Slack.

Thanks for your collaboration!

@mjkkirschner

This comment has been minimized.

Copy link

commented Feb 7, 2019

@alvpickmans

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

just chiming in, I could replicate the same issue on Revit 2019.2, no extra add-in apart from anything that comes with Revit.
image

I encounter the same problem in another package (https://forum.dynamobim.com/t/jsondata-package/19026/25), and solved it by downgrading Json.Net to 9.0.1.

@teocomi

This comment has been minimized.

Copy link
Member

commented Feb 8, 2019

Okay so I could finally replicate the bug. Weirdly enough I had to remove some of my Revit plugins to do so... :/
I'll downgrade for now and publish an update while we check if there's a better solution...

@ksobon thanks for the heads up!
@mjkkirschner if I changed the logic of my constructors to handle this scenario, do you see any other possible conflict happening?

@pereiraTTW

This comment has been minimized.

Copy link

commented Feb 10, 2019

@teocomi, thanks for that. Please, keep us posted.

@teocomi

This comment has been minimized.

@teocomi teocomi closed this Feb 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.