Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight unable to resolve References when switching from Debug to Release

I am using: Silverlight Version 4.0, 100% F# solution. I am having an issue when switching the Target Configuration from debug to release. Everything compiles fine in debug mode, then in release I get the following:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.ComponentModel.DataAnnotations". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Windows.Controls.Data.Input". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

The Item group in the project file lokos like:

  <ItemGroup>
    <Reference Include="FSharp.PowerPack">
      <HintPath>C:\Program Files\FSharpPowerPack-2.0.0.0\Silverlight\v3.0\FSharp.PowerPack.dll</HintPath>
    </Reference>
    <Reference Include="mscorlib" />
    <Reference Include="FSharp.Core">
      <HintPath>$(ProgramFiles)\Microsoft F#\Silverlight\Libraries\Client\$(SilverlightVersion)\FSharp.Core.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.ComponentModel.DataAnnotations" />
    <Reference Include="System.Core" />
    <Reference Include="System.Net" />
    <Reference Include="System.Runtime.Serialization" />
    <Reference Include="System.Windows" />
    <Reference Include="System.Windows.Browser" />
    <Reference Include="System.Windows.Controls">
      <HintPath>bin\Debug\System.Windows.Controls.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Data">
      <HintPath>bin\Debug\System.Windows.Controls.Data.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Data.Input" />
    <Reference Include="System.Windows.Controls.DataVisualization.Toolkit">
      <HintPath>bin\Debug\System.Windows.Controls.DataVisualization.Toolkit.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Input">
      <HintPath>c:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.Windows.Controls.Input.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Layout.Toolkit">
      <HintPath>bin\Debug\System.Windows.Controls.Layout.Toolkit.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Navigation">
      <HintPath>bin\Debug\System.Windows.Controls.Navigation.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Controls.Toolkit">
      <HintPath>bin\Debug\System.Windows.Controls.Toolkit.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Data">
      <HintPath>bin\Debug\System.Windows.Data.dll</HintPath>
    </Reference>
    <Reference Include="System.Xml" />
  </ItemGroup>

Obviuosly some Elements have HintPaths while others do not, and while some have hintpaths there appear to be absolute and relative paths...

Can anybody help me out? Thanks in advance.


OK so I removed the references and then readded them and they came into the project file in the format of:

c:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\System.ComponentModel.DataAnnotations.dll

for both of the references. It all compiles - in both versions. Any hint on th HintPaths? How they are used and how and when they are generated? And why when I tried to modify the proj file by hand it didn't seem to matter (still didn't compile even though VS told me it reloaded)?

Thx

like image 870
akaphenom Avatar asked Nov 05 '22 07:11

akaphenom


1 Answers

Sounds like you moved the project from another machine and you don't have the Silverlight Toolkit and the WCF RIA Services installed on your machine.

Clean your solution, close your Visual Studio and install what's missing.

like image 119
herzmeister Avatar answered Nov 09 '22 17:11

herzmeister