error in WPF

Jul 12, 2013 at 3:02 PM
Edited Jul 12, 2013 at 3:03 PM
I get this error when getting youtube video link and displaying it in wpf mediaelement

An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll
Additional information: The 'User-Agent' header must be modified using the appropriate property or method.

Here is the stack trace:

at System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
at System.Net.WebHeaderCollection.Set(String name, String value)
at MyToolkit.Networking.Http.Get(HttpGetRequest req, Action`1 action) in c:\Users\E.J\Desktop\mutoolkit\Shared\Networking\Http.cs:line 221
--- End of stack trace from previous location where exception was thrown ---

the original code i am using in the program is
    Dim g = Await MyToolkit.Multimedia.YouTube.GetVideoUriAsync("tE9Tti_9Z3w", MyToolkit.Multimedia.YouTubeQuality.Quality480P, MyToolkit.Multimedia.YouTubeQuality.Quality720P)
    med1.Source = g.Uri
End Sub
Jul 12, 2013 at 3:11 PM
This should be fixed in the newest version. As of now, you have to download the project from the codeplex site or using subversion and reference it directly in your solution... The NuGet update with the fix will be released later... (then, you should switch back to the NuGet version to receive further updates).