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 1695 [details]
example of the noise
When opening a solution that has a lot of .NET 4.0 projects in it, MonoDevelop changes the project files to remove a lot of <TargetFrameworkVersion> and similar tags.
See an example of the noise that a developer may see when going to commit his changes.
Although this appears to be a simple problem, it's actually quite complex.
IIRC, VS only sets the TargetFramework element when the user changes the value in the UI. However, new projects in VS are created by copying csproj files verbatim from templates, and these templates often have no explicit TargetFramework value, therefore this property has the default value. This means it's not unusual to have VS-created csproj files with no TargetFramework value.
MD loads projects into an internal model, and serializes them back out when saving them. Properties with the default value are removed/cleared when serializing. This simplifies csproj files, and IIRC for properties where the value has not been explictly modified in VS, it actually reduces diff noise. Reducing diff noise further would necessitate much more complex handling.
One solution to this would be too keep the TargetFrameworkVersion element if it was already present when the project was loaded, and if the target framework has not changed.
Or maybe we could always set the element, unless it was not already there and the project's framework has the default value. That would match VS more closely IMO.
Bug 7914 has a patch.
*** This bug has been marked as a duplicate of bug 7914 ***