-
Notifications
You must be signed in to change notification settings - Fork 532
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
GetRequest.DownloadAsync crash on Release Config #752
Comments
Which version were you on before? (Just so we can see where the differences come from.) |
Last version where it works is 1.12.0.455 |
So is this using |
Yes, it is definitely working in 1.12 because I have store app which is using this version. I've updated to 1.13 and had to downgrade fast, because after update app stopped working (there was error or download attempt on any file). I was very suprised, because I'm tesing it each time before submitting an update. This time was no diffrent, but error was there anyway. So I checked in RELEASE config and find this^^. For the time beeing I've returned to v1.12 (same my-code) and all works fine. |
Okay - and presumably this happens consistently? I should presumably be able to just create a Universal Windows App, make a GetRequest.DownloadAsync and see the problem? Will give it a try - but I'm afraid it won't be for a week as I'm on vacation next week. In the meantime I'll assign it to Chris who may be able to help sooner. Just thinking about the different versions, I've just remembered that actually we need to be thinking about the differences between 1.11 and 1.13, as there wasn't a 1.12 in the support libraries. |
You're right I downgraded support libraries to 1.11. |
Thanks so much for provide a repro - that'll make it much easier to help you. I may find time to have a look this weekend, but hopefully if not, Chris can reproduce it next week. We'll get there one way or another :) |
Unfortunately I don't seem to be able to run the repro. I only have access to Windows on a VM (Windows Server 2012), which doesn't seem to like running the Windows Phone emulator, which I appear to need. |
You can't use Windows Phone emulator - it's Windows 10 UWP app, so you'll need Windows 10 machine or Windows 10 Mobile emulator (which runs only on Windows 10 machine). |
OK, thanks, I'll see if I can find a Windows 10 machine. |
OK, I can reproduce this (with one difference). Using a Win10 VM. Using the code to posted earlier, it works in debug mode with all versions of Google.Apis.Drive.v3 The difference is that I don't appear to get an exception thrown when it fails, it just puts no data into the resposne stream. I'll see if I can find what's causing this... |
Exception isn't thrown to 'the surface', but you can see it in Output window in VS. Besides this, I agree with all. |
Ah yes, I see them, thanks. |
The problem occurs when .NET native compilation is enabled, which by default is in release builds, but not in debug builds. |
@MattWhilden works at Microsoft and is an expert in all things UMP. Perhaps he can provide some tips for how to troubleshoot this. |
The problem occurs in the ReadAsync method in MediaDownloader.cs |
Hello! I work on the .NET Native runtime and compiler team and would be happy to take a look at this. At the risk of admitting my complete ignorance publicly, I seem to have hit a wall generating the correct set of client secrets from my fresh new google cloud account. @chrsmith was going to help sort me out this afternoon but if someone has any tips I'd be grateful. |
@MattWhilden: If you run (Personally I find the SDK approach simpler, but the service account approach means you don't need to install anything.) |
@MattWhilden Attached is a sln which reproduces this problem in a simpler way without any Google dependencies. |
Thanks @jskeet and @chrisdunelm. I'm playing with the non googly repro now and will report back. |
Hmm. So if you have a PCL that contains platforms that didn't have Tasks support out of the box then you get built against a extensions dll that fills in the surface area. This library relies on some APIs that have been move elsewhere for UWP and the old APIs throw as you see here. We have a phase of the compiler that is supposed to do remapping from these "old style" portable APIs to the "new" ones that are available for UWP applications. I'm investigating why that doesn't seem to have kicked in and, presumably, will have a decent idea for a workaround at that time. Stay tuned. |
Okay so I've hit paydirt on this issue and it turns out that Microsoft.Threading.Tasks.Extensions has a chunk of code that currently has no way to run in UWP. How to best work around/fix the issue is still an open question but I figured I would report back about what triggers the problem and some thoughts about what may be decent workarounds. The problem We fail 4 of these mappings inside on Microsoft.Threading.Tasks.Extensions but why. This library attempts to create a delegate of some of these mapped types and because delegate creation ends up needing the IL instruction ldvirtftn (instead of the more familiar callvirt) which the .NET Native compiler seems to explicitly disallow. Presumably this is because we were worried about not being able to correctly redirect this call in the face of overloads but I'm still chasing that a bit. The what to do about it I'm going to reach out to the folks here that own Microsoft.Threading.Tasks.Extensions and see if we can hack around the issue in that library. It may be worth seeing how quickly that could happen but it's on the order of a few weeks at the earliest I suspect. I will report back here when I know more, probably a day or two. As a "workaround" that is entirely in your own control: Publishing a version of your library that avoids Microsoft.Threading.Tasks.Extensions may be somewhat palatable. As much as I hate to say it, it seems as though Silverlight 5 being part of the portable targets is the only thing causing the problematic library to be necessary. Happy to answer other questions if you have them. I do appreciate the report and great repro case. Side note: the warnings for builds with .NET Native turned on will try to alert you to our failings. Here's what it looks like on my machine. 1-4 are the compiler complaining about exactly the issue above. 5 and 6 are similar but come from clicking the checkbox in the build properties that is "enable static analysis for .NET Native". This allows some tooling to run that may kick out helpful warnings. In this case, it's noticing that those calls are only going to throw at runtime. 8 and 9 are spurious and can be safely ignored. |
@MattWhilden thanks for the really helpful explanation. |
@chrisdunelm any progress on this matter? |
@Piachu91 Apologies, nothing yet. We will fix this, but have had other priorities over the last couple of weeks. I hope to get back to this next week. |
We're working on additionally targeting NetStandard (<= 1.3, not exactly sure yet) for this library, which as I understand it should fix this on UWP. @MattWhilden If I'm wrong about that, please let me know ;) |
and yes will look into adding this to our docs. https://github.com/NuGet/NuGetDocs/issues/495 |
@harikmenon @joelverhagen - thanks :) That is really useful. Only comment is if the "Package Frameworks" entry box could be made a bit wider. Some of the portable-* names are too long to fit on a single line. E.g. "portable-net40+sl50+netcore45+wpa81+wp8" Coming back to the original bug, we hope to soon be releasing a version of the library that targets:
This confirms that a UWP app (uap target) will select the netstandard1.3 framework given these choices, which is exactly what I was hoping :) |
Sweetness!!! Glad it helped. Do reach out if you need anything else :) |
@chrisdunelm any progress? Maybe some timeline for fix? |
This is proving more problematic than anticipated. |
The UWP release build might be due to .NET Native. You can reach out to .NET Native (External Feedback) dotnetnative@microsoft.com If you need some help. |
Since this is a library and not an app, you don't have to build NET Native output. you can ship IL and the consuming app will convert the resulting app to .NET native. However, you need to test apps that are release and consuming your binaries though to make sure it works in .NET Native. |
@harikmenon thanks. Yes, our library is shipped as IL in the nupkg, then we have a Win10 test app which consumes that library and crashes in a release build. Works OK in a debug build. Quick question - in VS 2015 update 2 (community) there was a project build option "Compile with .NET native tool chain". This has gone in update 3, and I can't find an equivalent. Is this expected? And how is native compilation now enabled/disabled? |
Hmm, do you mind reaching out the alias I had sent you before? They would know the answer for sure for all things .NEt Native :) |
@chrisdunelm please do reach out to us. "Works on DEBUG but not on RELEASE" is exactly the symptom for issues we are fixing with .NET Native. As for the checkbox... That means that VS doesn't think you've installed our tools onto that machine. We should be getting installed with the UWP tools. Perhaps running a repair for that SDK will get you back into shape? |
Hi everybody, can anyone of you please me regarding speech API? I am trying to analyze an audio of 45 second using this .NET API but getting transcript of only first 5 seconds. Thanks |
@abrar84 This won't be the right place to get help for that but if you mail either Hari or I with details (we both work at MS), we can probably get your question routed to the right place. harikm@THENAMEOFOURCOMPANY.com, mwhilden@THENAMEOFOURCOMPANY.com. |
@harikmenon, @MattWhilden - yes, I'll contact you at the alias you gave. I've been distracted away from this for a few days, but should be back on it in the next day or two. Sorry for the delay. @abrar84 which (who's ;) speech api are you having problems with? |
@chrisdunelm @MattWhilden any luck? It's not working since may, and I need new ResumableUpload functionality |
Again, sorry for the delay. This work is still on our todo list, although (as you can probably tell), it's not currently our top priority. I hope to get to it in September. |
Hello, I'm the user that posted the issue #838 and I just tried reverting to versions 1.13.0.483 and 1.12.0.455, and both of them don't work anymore in release mode (they work 100% fine in debug). |
I can't agree with you, because for me old version is still ok (are you sure that you downgraded all libraries)? |
@Piachu91 Well I just downgraded to versions 1.13.1.483 and 1.12.0.455 from the NuGet package manager, I'm quite sure it downgraded/changed all the related libraries automatically (I could see the list of libraries that were being modified when I confirmed the prompt). |
@chrisdunelm @MattWhilden any progress? |
@Piachu91 We've recently decided not to try to support native within the 1.x release. We do intend to make sure this works in the 2.0 release, which we hope will happen in early 2017 (see #787 for v2 planning). |
@chrisdunelm yeah, unfortunately I talked about it with @jskeet when he was in Warsaw last month. I only hope that this will be as soon as possible. |
UWP support is being tracked in #983. Closing this issue. |
I have Windows 10 store app. After updating to v1.13 of Google.Apis.Drive.v3 executing GetRequest.DownloadAsync throws:
Exception thrown: 'System.PlatformNotSupportedException' in Microsoft.Threading.Tasks.Extensions.dll
Exception thrown: 'System.PlatformNotSupportedException' in Microsoft.Threading.Tasks.dll
but (It's important) ONLY IN RELEASE CONFIG. In DEBUG works fine.
The text was updated successfully, but these errors were encountered: