Comments (17)
I believe that this is related to .Net Native reflection. The error is happening because you have an implicit style for the Brainf_ckSharp.Uwp.Controls.Ide.Brainf_ckEditBox type, but the metadata provider isn't resolving the type. For Debug builds, we use a reflection-based metadata provider, but for Release builds we generate a table that is used for the lookup, so that's why this works in Release but not Debug. You should be able to work around this by adding the following property to all of your project files:
<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
from brainf_cksharp.
from brainf_cksharp.
Hey @alwu-msft - just adding some more potentially useful info here as @LanceMcCarthy suggested.
I have another app, Legere, which is exhibiting very similar issues.
It's closed source too, I can add you as a collaborator too if you want.
That app is crashing at startup with .NET Native no matter what configuration I use.
- Release
- Debug with .NET Native
This is from an autogenerated file from the XAML compiler, and @MichalStrehovsky said an issue like this was likely due to an SDK bug, see his comment here: microsoft/microsoft-ui-xaml#2545 (comment).
Hope this helps!
from brainf_cksharp.
WOW!
Alan, every time I talk to you, I learn something new about how the .NET Native compiler works :)
from brainf_cksharp.
It's just outright avoiding use of .Net Native reflection by the XAML framework; it doesn't do anything to modify the behavior of .Net Native itself. :) I'm checking with one of my co-workers to see if this is a known, wider issue.
from brainf_cksharp.
@alwu-msft WOW that was super quick, thank you so much!
Side note, I also have another app that is crashing both in Debug with .NET Native and in Release, let me see if applying this workaround changes things over there as well, at least in Debug!
from brainf_cksharp.
@alwu-msft So, I can confirm that fixed the Debug with .NET Native crash in the app!
Potentially related, I have another app that's crashing again in both Release and Debug with .NET Native.
Interestingly enough, that app was already using this workaround you suggested (probably someone from the .NET Native team suggested that to me too a few months back, I forgot I had that in that app to be honest).
- Release crash:
- Debug with .NET Native crash:
This one in particular is exactly the same as the one I mentioned in the related GitHub issue: microsoft/microsoft-ui-xaml#2545.
Would you be interested in having a look at this too? I can add you as a collaborator if you'd like
Thanks again!
from brainf_cksharp.
Sure. Just clone the repo, load the solution in VS, and hit F5 to see crash on launch?
from brainf_cksharp.
@alwu-msft Sent you an invite for https://github.com/Sergio0694/Legere
And yup, just clone and build + run! You'll need the Multilingual App Toolkit installed to build though!
Other than that it should work right out of the box, no additional setup needed.
from brainf_cksharp.
I can't reproduce your Release crash, although I do get the following exception:
Refit.ApiException: 'Response status code does not indicate success: 401 ().'
[Managed to Native Transition]
> Refit.dll!Refit.RequestBuilderImplementation.BuildCancellableTaskFuncForMethod.AnonymousMethod__0(System.Net.Http.HttpClient client, System.Threading.CancellationToken ct, object[] paramList) Line 263 C#
[Resuming Async Method]
Refit.dll!Refit.RequestBuilderImplementation.BuildCancellableTaskFuncForMethod.AnonymousMethod__0(System.Net.Http.HttpClient client, System.Threading.CancellationToken ct, object[] paramList) C#
[Resuming Async Method]
followed by a single endlessly spinning progress ring in the app.
As with your other project, it looks like Legere is crashing in Debug builds because one of the referenced libraries (Legere.Markdown) is being compiled with the reflection-based metadata provider, which just doesn't work with .Net Native (but unfortunately, it's not possible for that referenced project to realize that it's going to later be consumed by a project that's using .Net Native).
Moving forward, the simplest workaround is to probably just employ a Directory.Build.props file at least at the .sln level (if not higher in the directory hierarchy) that includes the property <EnableTypeInfoReflection>false</EnableTypeInfoReflection>
; that allows you to avoid having to modify every individual project.
from brainf_cksharp.
Ah, sorry about that! You don't have my access tokens for the various REST services and apparently Unsplash just changed how one of their APIs endpoints worked, so that was causing the crash. I've pushed a quick workaround to master
, would you mind fetching the changes (literally just ignored the 401
error it was returning) and trying again?
I did so on my maching and I can confirm I'm still getting this in Release:
As for Debug .NET Native, that makes perfect sense now! I have to say that at least, thankfully, that's not really a configuration I'd normally use, I'd either use Debug for quick testing or proper Release with .NET Native for validation before uploading a new package. So personally, I don't mind those issues in Debug .NET Native as much as the Release crash
Thanks again for your time by the way!
from brainf_cksharp.
Hi Sergio, sorry for the radio silence; it's been super busy these last couple weeks. I was able to find a little bit of time to take another look at Legere, but I'm not seeing the crash that you were seeing in Release. If you see it again, I'd recommend saving a crash dump and uploading that along with the app symbols and commit hash to a (private; probably don't want everybody to have access to the dump) cloud share; hopefully that will contain enough information to allow for meaningful postmortem debugging.
from brainf_cksharp.
Hey @alwu-msft - no worries! Thank you again for taking the time to look into this!
It's weird that you're not seeing the crash, I'm still getting that in Release for both my apps actually, Legere and Brainf*ck#.
I'll prepare those crash dumps for you, hopefully those will help!
For now I'm just glad I can at least run the app in Debug, and that I don't need .NET Native to create Store packages to upload. As I mentioned, the remote .NET Native build the Store does during certification produces working binaries at least
from brainf_cksharp.
Alright I have prepared both dumps, along with the output I'm getting, the commit hashes and all the .pdb files I have.
@alwu-msft I actually plan to make this repo public eventually, so as you mentioned it wouldn't be a good idea to just link the dumps here as they would show up in the comment history - can you share an email/handle I can send the link to?
from brainf_cksharp.
Both of those dumps contain exceptions with the message Non รจ stato possibile caricare il file o l'assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' o una delle relative dipendenze. Impossibile trovare il file specificato.
. This doesn't seem related to XAML (which isn't even loaded yet); I'd suggest engaging with the .Net Native team to try to figure out what's going on.
from brainf_cksharp.
Hey @alwu-msft - thank you again for your time!
I see, well then does seem like some sort of issue either with .NET Native as you said, or with the SDK as Lance and Michal suggested. I've sent the two repros to the .NET Native team and also opened a VS feedback item (here), though unfortunately I've received no replies yet. I'll try to ping the VS issue again, hopefully someone will reach out eventually.
Thanks for your help!
from brainf_cksharp.
Closing this as the issue in Brainfk*ck# was resolved, and I also did manage to fix the other issue separately at some point (can't remember exactly what it was, maybe some weird style thingy that was causing a crash). Thanks everyone for the help!
from brainf_cksharp.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brainf_cksharp.