从调试切换到发布时,Silverlight 无法解析引用

标签 silverlight silverlight-4.0 f#

我正在使用:Silverlight 4.0 版,100% F# 解决方案。从 切换目标配置时遇到问题调试 发布 .在 Debug模式下一切都可以正常编译,然后在发布中我得到以下信息:

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.



项目文件中的项目组 lokos 像:
  <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 并安装缺少的内容。

关于从调试切换到发布时,Silverlight 无法解析引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4027770/

相关文章:

visual-studio-2008 - 在 XAML 中创建具有代码完成功能的属性或 DependencyProperties

.net - 为什么 Silverlight 不为我的自定义 ServiceModel.ClientBase<TChannel> channel 的行为调用 AfterReceiveReply?

.net - Prism 。使用 RegisterInstance 执行任务

f# - TypeProvider 无法从 Expression 添加方法

visual-studio-2010 - VS2010 F# Smart Tag 添加开放导入声明

silverlight - 无法通过在 Silverlight 中提供相对路径来找到图像

c# - 如何将附加本地对象变量传递给我的事件处理程序?

Silverlight 4 - RIA 服务 - 这是很好的编码实践吗?

银光4.0 : Unhandled Error in Silverlight Application[Async_ExceptionOccured]

f# - 使用 Codedom 在运行时编译 F# 源代码?