Bug 10040 - Monodevelop removes the reference to the assembly version in csproj files
Summary: Monodevelop removes the reference to the assembly version in csproj files
Status: NEW
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: Trunk
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2013-02-05 05:43 UTC by harold_reina75
Modified: 2013-12-16 20:32 UTC (History)
2 users (show)

Tags:
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 for Bug 10040 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description harold_reina75 2013-02-05 05:43:20 UTC
Monodevelop removes references to versions of assemblies in breaking compativilidad csproj files with VS2012.

This also causes errors in MVC 3 projects because deleting the assembly version errors is generated on the construction of project

example

old file csprojc
...
    <Reference Include="System.Web.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20715.0\lib\net40\System.Web.Razor.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.Mvc.3.0.20105.1\lib\net40\System.Web.Mvc.dll</HintPath>
    </Reference>
etc..

modified by monodevelop

    <Reference Include="System.Web.Razor">
      <HintPath>..\packages\Microsoft.AspNet.Razor.2.0.20715.0\lib\net40\System.Web.Razor.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages">
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages.Deployment">
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Deployment.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.WebPages.Razor">
      <HintPath>..\packages\Microsoft.AspNet.WebPages.2.0.20710.0\lib\net40\System.Web.WebPages.Razor.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.Web.Infrastructure">
      <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
    </Reference>
    <Reference Include="System.Web.Mvc">
      <Private>True</Private>
      <HintPath>..\packages\Microsoft.AspNet.Mvc.3.0.20105.1\lib\net40\System.Web.Mvc.dll</HintPath>
    </Reference>
Comment 1 Dilshod Tadjibaev 2013-12-13 21:32:37 UTC
Any update when this might get fixed? Currently I often have to watch out for any destructive changes monodevelop makes to a project file and put back "<Private>True</Private>" lines. 

I can can pitch in my own resources / time if needed. 

Also I would appreciate any possible workaround this problem for now. 

Thank you!
Comment 2 Mikayla Hutchinson [MSFT] 2013-12-16 20:32:05 UTC
It's very complicated, unfortunately. XS resolves the assembly references, then serializes back the assembly references when saving the project. The problem is this resolution does not always match MSBuild's assembly resolution, especially when more advanced things are done with MSBuild.

When using the MSBuild build engine, code completion and the build always have accurate assembly resolution since it uses MSBuild to resolve the assemblies.

IMO there are a couple of things we could do to improve this:
1) references in the project model should use the MSBuild resolution that we already do for code completion
2) we should track "dirty" state for references and when serializing, only alter the ones that actually changed

An even better solution to #2 would be to do away with our serialize/deserialize model and bring the actual MSBuild DOM into the project model. Then changes to the project model would directly affect specific parts of the DOM.

But both of these things would be very hard to implement.