gpt4 book ai didi

c# - 命令提示符下的 MsBuild 未生成 FakeAssemblies

转载 作者:行者123 更新时间:2023-11-30 15:28:04 25 4
gpt4 key购买 nike

我的解决方案中有一个测试项目,它使用伪造品进行测试,我正在同一解决方案的其他项目中伪造我的 dll 构建之一。

当我在 VS2013 中构建解决方案时,一切正常,我看到 FakesAssemblies 文件夹是用我的 dll 的假文件创建的。

但是,如果我在命令提示符下使用 msbuild,我看不到 FakesAssemblies 文件夹已创建,并且我的测试项目因未找到引用 dll 而失败。

来自 MSBuild 的日志:

(ResolveAssemblyReferences target) -> C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "CustomNetworkLib.Fakes". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
....
FakeNetworkHelper.cs(1,28): error CS0234: The type or namespace name 'Fakes' does not exist in the namespace 'CustomNetworkLib.Binding' (are you missing an assembly reference?)

感谢您的帮助...

最佳答案

我得到了答案..

我们需要从以下位置使用 MsBuild 版本 12“C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe”

它能够创建伪造的 dll.. 我认为它是与 VS 一起安装的。

我实际上是在使用 msbuild from..C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

关于c# - 命令提示符下的 MsBuild 未生成 FakeAssemblies,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26433501/

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