VSIX newtonsoft不在软件包中(VS> 15.5)抑制软件包 [英] VSIX newtonsoft isn't in package (VS>15.5) suppress package

查看:98
本文介绍了VSIX newtonsoft不在软件包中(VS> 15.5)抑制软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个针对vsix项目的解决方案.在使用newtonsoft.json.dll生成Visual Studio软件包的15.4版之前,但是从该版本开始,软件包中就不再包含newsoft.

We have a solution for vsix projects. Until version 15.4 of visual studio packages were produced with newtonsoft.json.dll, however, since that version, newsoft were excluded from the package.

对于我所看到的,这是由于位于"C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v15.0 \ VSSDK \ Microsoft.VsSDK.targets具有新的排除规则""

For what I have seen, this is caused because "Microsoft.VsSDK.targets" located in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\VSSDK\Microsoft.VsSDK.targets" has a new exclusion rule ""

我们的解决方案需要NewtonSoft,如果我在VS> = 15.5上安装vsix,则由于newtonsoft不在软件包中,因此无法在%appdata%\ microsoft \ visualstudio \ extensions中请求此程序集.

Our solution needs NewtonSoft, if I install vsix with VS >=15.5, regarding newtonsoft isn't in package, it fails requesting this assembly in %appdata%\microsoft\visualstudio\extensions.

我们已经完成的测试: 我从VsSDK.targets中删除了此排除项,它之所以有效,是因为在软件包中插入了newtonsoft.

Tests we have done: I remove this exclusion from VsSDK.targets, and it works because newtonsoft is inserted on package.

我已在清单的资产上插入了程序集,但未插入程序集,因此失败.

I have inserted the assembly on Assets of manifest, but assembly is not inserted, so, it fails.

我们已经更新了依赖项,以确保我们使用相同的版本NewtonSoft 9.0.0.

We have update our dependendies, to make sure we use the same version, NewtonSoft 9.0.0.

考虑到我们不希望在构建机器上更改SDK.targets的原因,我们将如何解决该问题,因为它将在开发人员机器上失败.

How can we solve that, taking in consideration we don't wan't to change the SDK.targets on build machine because it will fail in developer machine.

是否可以在Assets中添加相对路径?如果是,怎么办?因为我已经尝试过了并且没有插入newtonsoft.

Is it possible add relative path in Assets? if yes, how? because I have tried and newtonsoft it wasn't inserted.

https://social.msdn.microsoft.com/Forums/zh-CN/550ddfdc-027c-41ba-9b32-31e6391bc038/newtonsoftjsondll-not-included-in-vsix?forum=vsx

** 更新 **

版本15.7.4仍然存在此问题

Version 15.7.4 still have this problem

谢谢

推荐答案

VS行为是为了防止您运送Newtonsoft.Json副本.这样做的原因是,VS会自己提供一个副本(或在某个时间点复制多个副本……),并包括对该版本的绑定重定向.即使您要在VSIX中放置一个,也绝不能加载它.

The VS behavior is meant to prevent you from shipping a copy of Newtonsoft.Json. The reason for this is that VS ships a copy itself (or several at one point in time...), and includes a binding redirect to that version. Even if you were to place one in your VSIX, it should never be loaded anyways.

如果通过某种方式强制VS加载您的Newtonsoft.Json版本,您将有机会打破VS中依赖于包含VS的版本的其他功能.

If you do by some means force VS to load your version of Newtonsoft.Json, you create an opportunity to break other features within VS that depend on the VS-included version.

这是在原始问题发布很长时间之后,但是如果您的%LocalAppData%\Microsoft\VisualStudio\15.0_<instanceID>\devenv.exe.config不包含代码库和Newtonsoft.Json的绑定重定向,我将打开反馈票证以跟进VS团队.

This is long after the original question was posted, but if your %LocalAppData%\Microsoft\VisualStudio\15.0_<instanceID>\devenv.exe.config does not contain a codebase and a binding redirect for Newtonsoft.Json, I would open a feedback ticket to follow up with the VS team.

这篇关于VSIX newtonsoft不在软件包中(VS&gt; 15.5)抑制软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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