mtiede
(mtiede)
January 20, 2016, 3:10pm
1
I have this code:
webrequest := HttpWebRequest( webrequest.Create( ub.Uri ) );
webrequest.Method := 'POST';
var requestStream: Stream := await Task.Factory.FromAsync( webrequest.@BeginGetRequestStream, webrequest.@EndGetRequestStream, nil);
But that doesn’t compile. How DO I pass the webrequest’s BeginGetRequestStream to the Task Factory?
Patrick
(Patrick Lanz)
January 20, 2016, 3:18pm
2
Mark,
@ webrequest.BeginGetRequestStrem, no?
mtiede
(mtiede)
January 20, 2016, 3:27pm
3
Yes, that sort of works. I tried that first, but it complained about mismatched case, but that was just a warning I mistook for an error.
However, it turns out, that I can’t even use the “await”, apparently because it is Silverlight app.
The error message now says, “await requires .net 4.5 or later”. I think that is what I’m using, but maybe I better double check that.
… time passes …
I double checked. There doesn’t appear to be a place to select .net version 4.5. Only Silverlight 5.
… more time passes …
hmm… I see C# examples in SL 5 using await. I even added the System.Threading.Tasks namespace, but still got the compiler error.
ck
(Carlo Kok)
January 20, 2016, 7:14pm
4
I’ll log a bug and see if it’s doable to support SL5 with await.
Thanks, logged as bugs://74261
mtiede
(mtiede)
January 20, 2016, 7:30pm
6
I’m not positive the examples I saw earlier were with Silverlight. My SEARCH included Silverlight, but perhaps the found page was not for Silverlight. OR, whoever wrote the example code did not actually try it.
So I’m not sure how much you can really do with Silverlight.
bugs://74261 got closed with status wontfix.
ck
(Carlo Kok)
October 20, 2017, 7:09am
8
Silverlight has pretty much died
Patrick
(Patrick Lanz)
October 20, 2017, 7:50am
9
Carlo,
it’s at the end of its life, but still used.
The functions of my Silverlight applications are migrating slowly to a web application and a WPF application
So, we need support for it under VS2015. Not new features, but just the ability to edit, compile and debug.
ck
(Carlo Kok)
October 20, 2017, 8:19am
10
Of course we’re not removing SL support. However I’m not adding new features to the compiler that are specific to silverlight.