Bug 61041 - Visual Studio 2017 System reference changes after rebuilding UWP
Summary: Visual Studio 2017 System reference changes after rebuilding UWP
Alias: None
Product: Tools
Classification: Mono
Component: csharp ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-12-08 03:38 UTC by jonathan nichols
Modified: 2018-01-09 15:05 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 GitHub or Developer Community 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.

Related Links:

Description jonathan nichols 2017-12-08 03:38:40 UTC
Using the latest updated visual studio 2017, if you create a brand new PCL project and lets say you create a class in the Xamarin.Android project. In the class you had a System.Environment.GetFolderPath() method. At first this will work, but if you rebuild the UWP project you will notice that the System.Environment.GetFolderPath() method no longer works and that the path to this assembly changes
Comment 1 jonathan nichols 2017-12-08 03:46:51 UTC
I must be more specific the bug happens when you do the following...

1.) Create new PCL XF project using Visual Studio 2017
2.) Add a new class to the root of the Android, iOS, and UWP project.
3.) inside the new class on android add a class, inside the class use the method Environment.GetFolderPath(...)
4.) Rebuild the UWP project.

You will now notice "GetFolderPath" does not exist in Environment. The reuild of UWP project somehow references the wrong System dll when things are done in this order. Hopefully this is an isolated issue. Anyways I felt it would be good to try and report.
Comment 2 Alexander Köplinger [MSFT] 2018-01-09 15:05:16 UTC
This does not seem to be an issue specific to Mono.

Please report Xamarin.Forms bugs at https://github.com/xamarin/Xamarin.Forms/issues or use "Report a problem" from within Visual Studio 2017 (https://docs.microsoft.com/en-us/visualstudio/ide/how-to-report-a-problem-with-visual-studio-2017), thanks!