找回密码
 立即注册

QQ登录

只需一步,快速开始

[已处理] V17.2 MSBuild 出错

ANET
金牌服务用户   /  发表于:2024-1-12 16:12  /   查看:1234  /  回复:5
使用msbuild.exe 在另一台电脑上 编译项目(已安装 NET 4.6.2,  4.7.2),出现如下错误:


C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "GrapeCity.ActiveReports, Version=17.2.2.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.6.2". To resolve this problem, either remove the reference "GrapeCity.ActiveReports, Version=17.2.2.0, Culture=neutral, PublicKeyToken=cc4967777c49a3ff, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".


提示 System.Runtime.InteropServices.RuntimeInformation.dll 版本不对,
vbproj 里的 目标版本是4.6.2:
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>

5 个回复

倒序浏览
ANET
金牌服务用户   /  发表于:2024-1-17 15:25:13
来自 5#
本帖最后由 Eden.Sun 于 2024-1-31 09:18 编辑


************************************************最佳答案********************************************


这个试过了,这次变成最后一步build  ASP.NET Web Site 失败了,Web Site依赖其它几个Class Library, 我先研究下,解决不了再请教你们,多谢。
回复 使用道具 举报
Bella.YuanWyn认证
超级版主   /  发表于:2024-1-12 17:50:42
沙发
您好,看您的报错里面有对应的解决方案吗,您可以试试:
1)删除这个包:GrapeCity.ActiveReports, Version=17.2.2.0
2)安装这个包:System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0
推荐您用方法2,安装好对应的包后在测试看看。
回复 使用道具 举报
ANET
金牌服务用户   /  发表于:2024-1-13 09:19:38
板凳
本帖最后由 ANET 于 2024-1-13 19:23 编辑

System.Runtime.InteropServices.RuntimeInformation, Version=4.0.2.0 , 这个版本号不存在,版本不对应,你使用 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" "VBDemo.sln" /t:build /p:Configuration=Release       build下试试, vbproj里的 是<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>

主要是使用 msbuild.exe来编译就出错,在VS里就能编译成功,但是我们有一个build脚本,所以得使用命令行来build,不能用VS来build.



还有一个问题是命令行(msbuild.exe)编译 license.licx时报如下错误:

(CompileLicxFiles target) ->
  licenses.licx(1): error LC0003: Unable to resolve type 'GrapeCity.ActiveReports.PageReport, GrapeCity.ActiveReports'

回复 使用道具 举报
Felix.LiWyn认证
超级版主   /  发表于:2024-1-15 11:04:13
地板
本帖最后由 Eden.Sun 于 2024-1-31 09:18 编辑



您好,您用的
C:\Windows\Microsoft.NET\Framework64\v4.0.30319

这个是微软的msbuild。和VS自己的msbuild肯定不一样。两个所依赖的和使用的应该也是不一样的吧。如果vs可以编译通过。
是不是可以直接用vs的msbuild套件包。vs的我查了一下,位置应该在这里:
C:\Program Files (x86)\Microsoft Visual Studio\2019\
具体您可以在搜一下。
回复 使用道具 举报
Eden.SunWyn认证
超级版主   /  发表于:2024-1-17 17:21:15
6#
ANET 发表于 2024-1-17 15:25
这个试过了,这次变成最后一步build  ASP.NET Web Site 失败了,Web Site依赖其它几个Class Library, 我先 ...

好的,有其他的问题您再开新帖解决。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部