question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextBox throws an exception when building library/plugin for Autodesk Revit

See original GitHub issue

I’m building a WPF plugin for Autodesk Revit application. I included Material design to my app. Here is a dummy project, it demonstrates the same problem that i’m facing in my actual application.

Since i’m building a library, i do not have app.xaml. I merged resources in the Resource dictionary file and i use them in the Window1 window.

When using TextBox, the application breaks, i get the following error: System.Windows.Markup.XamlParseException: 'Provide value on 'System.Windows.Markup.StaticResourceHolder' threw an exception.' Inner exception: NotImplementedException: The method or operation is not implemented.

Stack trace is the following: at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at brisi.Window1.InitializeComponent() in C:\Users\Default\Desktop\brisi\brisi\Window1.xaml:line 1

I do have to point out that i have two bullshit lines of code in my .xaml.cs file: ColorZoneAssist.SetMode(new CheckBox(), ColorZoneMode.Accent); Hue hue = new Hue("xyz", System.Windows.Media.Color.FromArgb(1, 2, 3, 4), System.Windows.Media.Color.FromArgb(1, 5, 6, 7));. I don’t have a good understanding of how Revit loads libraries that my plugin is using, but if i don’t use those two lines, the app breaks [this problem].

I understand that debugging this problem will be difficult if you don’t have access to Autodesk Revit. Any help will be appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dfistriccommented, Nov 7, 2019

@Keboo yes it works, I didn’t test it before with prerelease version, my bad, only with the stable branch. Thank you for your time to check this out.

0reactions
Keboocommented, Nov 4, 2019

@dfistric can you re-test with 3.0.0-ci3552 or later. I believe that the fix is already done for that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"External component has thrown an exception." appears ...
Issue: When opening a model from Revit's Recent Files list, an exception is thrown and Revit fails to open. Application ContentDelivery - Revit....
Read more >
What is the prefered way of throwing exceptions?
Go to Solution. Interesting question. I know at least some of the Autodesk exceptions have a FunctionId property, which reports the C++ file ......
Read more >
Text Box Border Won't Resize (2018.2)
I believe the problem is that the CAD files are scaled too large when imported and this throws Revit for a loop.
Read more >
Solved: Simple user input - Revit API Forum
Welcome to Autodesk's Revit API Forums. ... I guess the simplest way is to create a WinForm with textbox for users to input....
Read more >
Internal Exception - thrown after having displaying two ...
Solved: Hello team, I'm receiving this exception after putting a PreviewController into two different hosts in winforms: Below is the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found