Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 16859 [details]
Description of Problem:
When trying to add our internal NuGet repository to be used in Xamarin, it fails to parse the URL
Steps to reproduce the problem:
1. Add a NuGet repo in Preferences resembling this URL format: https://somerepo.pkgs.visualstudio.com/_packaging/tps/nuget/v2
2. Load a solution and try to add a packagae to a project from this repo.
Add Packages window shows an error: "Invalid URI: The hostname could not be parsed."
All packages from this repo are listed.
How often does this happen?
1) Can you attach the full IDE information? (About dialog - Show Details)
2) Also can you attach the exception callstack from the IDE log? (Help - Open Log Directory).
You should be able to mark the comment/attachment as private if it contains sensitive information, otherwise remove that information before attaching.
I use a VSTS package source which has a similar url and that seems OK for me:
Bugzilla won't allow me to set attachments as private. Can you please set these permissions for me? I will then attach the log files.
Thanks in advance,
=== Xamarin Studio Community ===
Version 6.0.2 (build 73)
Installation UUID: 7a8e0fb8-1b19-460c-ab67-8e3e07af1a17
Mono 4.4.2 (mono-4.4.0-branch-c7sr1/f72fe45) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 404020011
=== Xamarin.Profiler ===
=== Apple Developer Tools ===
Xcode 7.3.1 (10188.1)
=== Xamarin.Mac ===
=== Xamarin.Android ===
=== Xamarin Android Player ===
=== Xamarin.iOS ===
=== Build Information ===
Release ID: 600020073
Git revision: a6f7a24a9723a2d4f5d33c176615b0d44703ab5b
Build date: 2016-07-26 13:36:15-04
Xamarin addins: f5acb37866a0141bc5ddbe95118f18dae4014568
Build lane: monodevelop-lion-cycle7-sr1
=== Operating System ===
Mac OS X 10.11.6
Darwin mikkos-mbp.guest.corp.microsoft.com 15.6.0 Darwin Kernel Version 15.6.0
Thu Jun 23 18:25:34 PDT 2016
VSTS is now using a different url:
Old url style:
Newer url style:
The newer url style cannot be used currently. The older style url still works and is the current workaround.
Some initial tests:
1) Xamarin Studio 6.0.2 on Windows is OK.
2) Xamarin Studio 6.0.2, 6.0.1 and 5.10 all fail unless the url includes "DefaultCollection"
3) Xamarin Studio 6.1 is OK
Xamarin Studio 6.1 uses NuGet v3, older versions use NuGet v2, so I am assuming NuGet v3 is using a different way to connect to the url.
The exception callstack:
I will run some tests with older versions of Mono to see if this is a regression.
It does not seem to be a regression in Mono. I tried a few versions: 4.4.0, 4.2.2, 4.0.4 and 3.12.0 all of which fail with the same error.
Had some time to look into this a bit further. Created a simple console app that uses NuGet to repro the problem:
There are two problems here:
1) VSTS is returning incorrect urls in its results when using a url without DefaultCollection in it:
<link rel="self" href="https://_packaging/VSTSTest/nuget/v2/Packages" />
When the DefaultCollection url is used the urls are correct. Which seems to be a VSTS bug.
2) Mono cannot parse urls that start with an underscore.
So the following code will trigger the same exception:
// Causes 'Invalid URI: The hostname could not be parsed.'
var uri = new Uri ("https://_foo/bar.html");
On Windows the above code works with no exception being thrown.
This seems to be OK with Mono 4.8.0. The VSTS feed is still returning incorrect urls but Mono now parses them without an exception being thrown.