从Debug切换到Release时,Silverlight无法解析引用

我正在使用:Silverlight版本4.0,100%F#解决方案.将目标配置从调试切换到发布时出现问题.一切都在调试模式下编译好,然后在发布中我得到以下内容:

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.

项目文件中的Item组如下:

<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>

显然有些元素有HintPaths,有些则没有,有些有hintpaths,似乎有绝对和相对路径……

有人可以帮帮我吗?提前致谢.

好的,所以我删除了引用然后重新读取它们,它们以下列格式进入项目文件:

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

对于这两个参考文献.它都编译 – 在两个版本中. HintPaths的任何暗示?如何使用它们以及如何以及何时生成它们?为什么当我试图手动修改proj文件时它似乎并不重要(即使VS告诉我重新加载仍然没有编译)?

谢谢

解决方法

听起来好像是你从另一台机器上移动了项目而你的机器上没有安装 Silverlight ToolkitWCF RIA Services.

清理您的解决方案,关闭Visual Studio并安装缺少的内容.

相关文章

如何在Silverlight4(XAML)中绑定IsEnabled属性?我试过简单的...
我正在编写我的第一个vb.net应用程序(但我也会在这里标记c#,...
ProcessFile()是在UIThread上运行还是在单独的线程上运行.如...
我从同行那里听说,对sharepoint的了解对职业生涯有益.我们不...
我正在尝试保存一个类我的类对象的集合.我收到一个错误说明:...
我需要根据Silverlight中的某些配置值设置给定控件的Style.我...