简体   繁体   English

.NET/Silverlight 缺失 DLL

[英].NET/Silverlight Missing DLL

I am inheriting a Silverlight project from a developer who just upped-and-quit and left behind no instructions or documentation (whatsoever).我从一个开发人员那里继承了一个 Silverlight 项目,他刚刚升级并退出并且没有留下任何说明或文档(无论如何)。 Scrambling to pick up the pieces and get my sandbox working.争先恐后地收拾残局,让我的沙箱开始工作。

Company gave me a license for VS 2010 Developer, which I have installed.公司给了我 VS 2010 Developer 的许可证,我已经安装了它。 I open the project's SOLUTION file and try to clean -> build it, but getting a compiler error.我打开项目的 SOLUTION 文件并尝试清理 -> 构建它,但出现编译器错误。 It's missing the System.Windows.Interactivity.dll file.它缺少System.Windows.Interactivity.dll文件。 I have already installed Silverlight SDK and Expression Blend, which are the two places previous SO questions ( similar to this, but not identical.) recommended looking.我已经安装了 Silverlight SDK 和 Expression Blend,这两个地方是之前的 SO 问题(与此类似,但不完全相同。)推荐查找。

Although I do see it inside Expression Blend's installation, when I try to add it as a reference to the Silverlight project, I get the following error:虽然我确实在 Expression Blend 的安装中看到了它,但当我尝试将它添加为对 Silverlight 项目的引用时,我收到以下错误:

You can't add a reference to System.Windows.Interactivity.dll as it was not built against the Silverlight runtime.您不能添加对 System.Windows.Interactivity.dll 的引用,因为它不是针对 Silverlight 运行时构建的。 Silverlight projects will only work with Silverlight assemblies. Silverlight 项目仅适用于 Silverlight 程序集。

What are my options here??.我在这里有什么选择??。 Thanks in advance.提前致谢。

When you add the reference, verify that you are adding the dll that is under the Silverlight folder (ie. "Silverlight" should be in the path of the assembly name).添加引用时,请确认您添加的是 Silverlight 文件夹下的 dll(即“Silverlight”应位于程序集名称的路径中)。

It should be found in the following folders (exclude the " (x86)" if running 32-bit Windows), depending on SL 4.0 or 5.0:它应该位于以下文件夹中(如果运行 32 位 Windows,则不包括“(x86)”),具体取决于 SL 4.0 或 5.0:
Installed by Expression Blend 4:由 Expression Blend 4 安装:
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries

Installed by Microsoft Expression Blend Preview for Silverlight 5: ( http://www.microsoft.com/download/en/details.aspx?id=9503 )由 Microsoft Expression Blend Preview 为 Silverlight 安装 5: ( http://www.microsoft.com/download/en/details.aspx?id=9503 )
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries

The quick and dirty solution is to install the Blend SDK for Silverlight .快速而肮脏的解决方案是为 Silverlight 安装 Blend SDK From what you described these assemblies should already be on your system, but for some reason they're not (or they're in a weird place).根据您的描述,这些程序集应该已经在您的系统上,但由于某种原因它们不在(或者它们在一个奇怪的地方)。 The reason for the error you described is that you're trying to add the WPF version of the assembly to a Silverlight project and that's obviously a no-no.您描述的错误的原因是您试图将程序集的 WPF 版本添加到 Silverlight 项目,这显然是一个禁忌。 (Two ways to solve that problem: the WPF version should have a version of 4.x while the Silverlight version will have either 2.x for SL4 or 5.x for SL5. So you can discriminate by version number. Or you can get a Visual Studio extension like Productivity Power Tools that gives you better ways of adding references.) (解决这个问题的两种方法:WPF 版本应该有 4.x 版本,而 Silverlight 版本有 2.x 用于 SL4 或 5.x 用于 SL5。所以你可以通过版本号来区分。或者你可以得到一个 Visual Studio 扩展,例如 Productivity Power Tools,它为您提供了添加引用的更好方法。)

Note that if you're doing Silverlight 5, the only way to get these assemblies is to install the Blend Preview for Silverlight 5 .请注意,如果您正在执行 Silverlight 5,获取这些程序集的唯一方法是为 Silverlight 5 安装 Blend Preview A stand alone installer for the Blend SDK for Silverlight 5 does not yet exist. Blend SDK for Silverlight 5 的独立安装程序尚不存在。

The files are in Program Files (x86)这些文件位于程序文件 (x86) 中

C:\Progra~2\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\System.Windows.Interactivity.dll
C:\Progra~2\Microsoft SDKs\Expression\Blend\Silverlight\v4.0\Libraries\System.Windows.Interactivity.dll
C:\Progra~2\Microsoft SDKs\Expression\Blend\Silverlight\v5.0\Libraries\System.Windows.Interactivity.dll

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM