mrward/monodevelop-nuget-addin

Load file:/// urls are not supported for icons of packages

ArsenShnurkov opened this issue · 6 comments

Addin doesn't show icons from local file urls, i.e.

file:///var/lib/layman/dotnet/dev-dotnet/deveel-math/files/Deveel.Math.png

this is not an access right problem (because firefox open this path from user without problems)
this is not a problem with file (because it work from internet-based url)

Gentoo system should be able to build packages without internet access. To achieve this result I created a local nuget repository. But what should I write to .nuspec files, to load icons locally?

In order to allow icons to be loaded through a proxy I changed the addin to use NuGet's HttpClient class. The NuGet HttpClient class unfortunately does not seem to handle FileWebRequests. Debugging the code you get an invalid cast exception thrown for the local file url:

Unable to cast object of type 'System.Net.FileWebRequest' to type 'System.Net.HttpWebRequest'.
   at NuGet.RequestHelper.GetResponse()
   at NuGet.HttpClient.GetResponse()
   at MonoDevelop.PackageManagement.ImageLoader.LoadImage(Uri uri, Object state)

Local file urls do work in Visual Studio 2013/2010 and SharpDevelop.

will you fix this next year?

This should be fixed on a separate branch.

works for me. Now I am waiting it in the upstream :)

This fix has now been merged to monodevelop master and should be in MonoDevelop 6.0

Thanks!