Addin WPF Windows Renders As Expected In 2018, not 2019

Addin WPF Windows Renders As Expected In 2018, not 2019

ChrisHildebranAtWork
Contributor Contributor
1,015 Views
2 Replies
Message 1 of 3

Addin WPF Windows Renders As Expected In 2018, not 2019

ChrisHildebranAtWork
Contributor
Contributor

[Pretext: Have submitted this to Telerik here but they are scratching their heads about it.]

 

This week i began working on our next iteration of one of our tools "Hanger Preparation" which is part of an addin toolset for Autodesk Revit built using WPF, MVVM, C#, Visual Studio 2017 and Telerik Controls for WPF.

We decided to split our"Hanger Tools" features into a separate windows/workflows "Hanger Preparation 2019" and "Hanger Tagging 2019".

I simply copied the original View and View Model and created two new Views and ViewModels and renamed all of the required Classes, Constructors, etcetera.

The new Views/View Models render/open as expected in Revit 2018 but not in Revit 2019. 

The problem is that the two new Views, "Hanger Preparation 2019" and "Hanger Tagging 2019", return a "System.IO.FileNotFound" exception for the assembly/.dll "Telerik.Windows.Controls.Input" then the window actually opens but it is rendered black. 

You can utimately get them to open if you fist open the original "Hanger Preparation" tool, close it and again attempt to open either of the problem windows "Hanger Preparation 2019" and "Hanger Tagging 2019". Screen capture video of behavior can be seen here. Quality is better if downloaded rather than streamed from Dropbox.

Screenshot 2 shows the references are intact in the project
Screenshot 3 shows the exception in the XAML of the View.
Screenshot 4 shows the new and existing Views/View Models are in the same directory within the project


Trying the solution in this forumn thread had no affect - https://www.telerik.com/forums/could-not-load-file-or-assembly-'telerik-windows-controls-anycontrol-...3

Chris Hildebran
VDC Software Development
IBEW 48 Wireman
ISA CCST 1
JH Kelly, LLC
0 Likes
Accepted solutions (1)
1,016 Views
2 Replies
Replies (2)
Message 2 of 3

JimJia
Alumni
Alumni
Accepted solution

Dear Chris,

 

I didn't find potential Revit API which will result in this issue.

 

The problem here is some assemblies are not loaded successfully, I guess this is why the window rendering doesn't work; you may refer to these page on how to load assemblies properly, hope it's helpful:

https://docs.microsoft.com/en-us/dotnet/api/system.appdomain.assemblyresolve?view=netframework-4.7.2

https://stackoverflow.com/questions/33109558/revit-api-possible-newtonsoft-json-conflict

 

 

 

 


Jim Jia
Autodesk Forge Evangelist
https://forge.autodesk.com
Developer Technical Services
Autodesk Developer Network
Email: Jim.Jia@autodesk.com
0 Likes
Message 3 of 3

ChrisHildebranAtWork
Contributor
Contributor

Jim, thank you for the feedback and guidance to some great potential solutions!

 

What did the trick was actually a solution posted by Colin Stark of StarkBIM in one of the links you suggested. I also reached out to him to confirm that this solution is still a viable one for him to which he responded affimatively. 

 

Glad to have this behind me!

 

Thanks again Jim!

 

Chris Hildebran
VDC Software Development
IBEW 48 Wireman
ISA CCST 1
JH Kelly, LLC
0 Likes