项目文件旁边的 UWP 应用 Microsoft.Bcl.Build 和 packages.config 的构建错误 [英] Build Error for UWP app Microsoft.Bcl.Build and packages.config next to the project file

查看:20
本文介绍了项目文件旁边的 UWP 应用 Microsoft.Bcl.Build 和 packages.config 的构建错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建 Windows 通用应用程序时遇到一个奇怪的构建错误.

I am getting a strange build error when building Windows Universal apps.

严重性代码描述项目文件行抑制状态错误无法定位C:\Users\me\Source\Repos\TT\Windows\MyCommonLibrary\packages.config.确保此项目已安装 Microsoft.Bcl.Build 并packages.config 位于项目旁边文件.我的应用

Severity Code Description Project File Line Suppression State Error Could not locate C:\Users\me\Source\Repos\TT\Windows\MyCommonLibrary\packages.config. Ensure that this project has Microsoft.Bcl.Build installed and packages.config is located next to the project file. MyApp

MyApp"有一个对MyCommonLibrary"的项目引用.

'MyApp' has a project reference to 'MyCommonLibrary'.

真正奇怪的是,即使它显示为构建错误".这不会影响我构建MyApp"或MyCommonLibrary"的能力!

What is really weird is that even though it is displayed as a build 'error'. This does not effect my ability to build 'MyApp' or 'MyCommonLibrary'!

它也不会阻止我在本地或以其他方式部署和运行我的应用程序.当它没有破坏构建时,看到它被列为构建错误真是令人讨厌!

It also does not prevent me from deploying and running my app locally or otherwise. It is just a annoying to see this listed as a build error when it doesn't break the build!

推荐答案

我跟进了 Bcl.Build 包所有者并得到了 Eric St. John 的回复.他说你不应该在你使用 project.json 的 UWP 项目中引用 Bcl.Build,并且有一个项目属性来抑制告诉你这样做的警告.

I followed up with the Bcl.Build package owners and got a response from Eric St. John. He says that you shouldn't reference Bcl.Build in your UWP project that uses project.json, and there's a project property to suppress the warning that is telling you to do so.

正确,问题是大多数使用它的包也不知道 UWP,如果它们针对 UWP 进行更新,我们希望它们删除此依赖项而不是使其工作.UWP 或任何支持 project.json 的框架根本不需要该包.

Correct, the problem is most of the packages out there that use it also don’t know about UWP either and if they update for UWP we want them to drop this dependency rather than make it work. The package isn’t needed at all for UWP or any framework that supports project.json.

要解决旧包的错误,请执行以下操作:

To work around the error with the old package do the following:

添加 <SkipValidatePackageReferences>true</SkipValidatePackageReferences>到你的 csproj/vbproj 的顶部

Add <SkipValidatePackageReferences>true</SkipValidatePackageReferences> to the at the top of your csproj/vbproj

这篇关于项目文件旁边的 UWP 应用 Microsoft.Bcl.Build 和 packages.config 的构建错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆