SharpKml.Dom.Document' does not have a default constructor on HoloLens(UWP)
See original GitHub issueI am trying to read in a kml file for a HoloLens application. I am using the MRTKv2 with Unity.
My solution with SharpKml works fine in the player of Unity. But on the HoloLens an exception is thrown.
string fileURI = Path.Combine(Application.streamingAssetsPath, "lszh.kml");
var stream = File.Open(fileURI, FileMode.Open);
KmlFile file = KmlFile.Load(stream);
When the stream is loaded I get the following exception: System.ArgumentException: Type 'SharpKml.Dom.Document' does not have a default constructor Parameter name: type occurred
I suspect it has to do with the interaction between SharpKml and UWP.
Any ideas about what the problem might be?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Does a window's default constructor have to be public?
2 Answers. Controls dont need a default constructor in WPF, unless you want to instantiate the control from XAML. As shown, the default ......
Read more >Parameterless struct constructors - C# 10.0 draft feature ...
When a struct instance constructor has no constructor initializer, that constructor implicitly performs the initializations specified by the ...
Read more >stackOverflowTags
This file contains bidirectional Unicode text that may be ... To review, open the file in an editor that reveals hidden Unicode characters....
Read more >generate-cs-word-dict - hangyan
Generate a word dict for CS from stackoverflow/github tags - generate-cs-word-dict/dict at master · hangyan/generate-cs-word-dict.
Read more >C#, PHP, C++, iOS, MySQL, SQL, ASP.NET, Objective-C, ...
NET 4.0, Eclipse Plugin, TkInter, controller, DNS, get, phpMyAdmin, ... assets, CRM, regression, html-helper, connect, domdocument, attachment, d, extjs4.1, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for the extra information. The stack trace seems to show the area of code I linked to earlier, looking like some of the reflection information is being stripped. I downloaded the emulator and ran the UWP application in release build without the debugger attached but it still worked fine. However, you mention that you’re using Unity, which does try to do some unused code stripping.
Unfortunately, I have no experience with Unity and, although I managed to get all the tools installed and ran one of the tutorials, I have to concede my limitations and am completely lost with how to write anything that would reproduce the issue.
Could I ask you try a
link.xml
file as per the previously linked Unity docs – if that fixes it then it looks like I can add aPreserve
attribute to the actual assembly that would have the same affect and remove the need for you to include that file. Alternatively, I can create a pre-release package that has the attribute applied if you’d like to try using that instead, however, I don’t have the ability to test if it works.Let me know which option works for you
Thank you so much for testing that out and coming back with the fix!
I’ve added some documentation here and linked to it from the getting started page.