mrward / monodevelop-nuget-addin

NuGet addin for MonoDevelop and Xamarin Studio
MIT License
264 stars 38 forks source link

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

Closed ArsenShnurkov closed 8 years ago

ArsenShnurkov commented 8 years ago

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?

mrward commented 8 years ago

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.

ArsenShnurkov commented 8 years ago

will you fix this next year?

mrward commented 8 years ago

This should be fixed on a separate branch.

ArsenShnurkov commented 8 years ago

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

mrward commented 8 years ago

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

ArsenShnurkov commented 8 years ago

Thanks!