gpt4 book ai didi

.net-3.5 - MSB3245 无法解析此引用。 "Microsoft.VisualStudio.SmartDevice.UnitTestFramework"

转载 作者:行者123 更新时间:2023-12-05 08:01:16 24 4
gpt4 key购买 nike

我正在尝试使用 MSBuild(版本 3.5 ofc)编译 .NET 3.5 解决方案,但它在编译单元测试文件时失败。

C:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.VisualStudio.SmartDevice.UnitTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

一些附加信息:- 当我用 Visual Studio 2008 编译它时,一切(编译和测试运行)都工作正常。- 我确定此 dll 存在于公共(public)(或私有(private))程序集文件夹中。- 此解决方案中的某些项目用于 .NET 3.5 Compact Framework。这可能是导致此问题的原因吗?

问候,

编辑:我找到了解决此问题的方法。我只是将“C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies”引用路径添加到我的 MSBuild 脚本,它现在可以工作了。但是 - 我仍然觉得应该有更好的方法。

我正在使用 C#。

最佳答案

Pawel Wrobel 的解决方案(帮助了我):

EDIT: I have found a workaround for this issue.I have simply added"C:\Program Files (x86)\Microsoft Visual Studio9.0\Common7\IDE\PublicAssemblies" reference path to my MSBuild script and it works now. However - I still feel there should be a better way.

你必须像这样传递参数:

msbuild.exe /p:ReferencePath="C:\Program Files (x86)\Microsoft Visual Studio
> 9.0\Common7\IDE\PublicAssemblies"

关于.net-3.5 - MSB3245 无法解析此引用。 "Microsoft.VisualStudio.SmartDevice.UnitTestFramework",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14956158/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com