NuGet“无法为我的项目生成绑定重定向"错误“未将对象引用设置为对象的实例." [英] NuGet "Failed to generate binding redirects for My Project" with error "Object reference not set to an instance of an object."

查看:110
本文介绍了NuGet“无法为我的项目生成绑定重定向"错误“未将对象引用设置为对象的实例."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 SquishIt 和 DotNetOpenAuth 等几个不同的软件包上,我收到一条错误消息:

On several different packages like SquishIt and DotNetOpenAuth i get an error saying:

未能为MyProject"生成绑定重定向.未将对象引用设置为对象的实例.

Failed to generate binding redirects for 'MyProject'. Object reference not set to an instance of an object.

我看过很多关于其他人在绑定重定向"方面遇到问题的帖子,但没有找到对该问题的单一引用以及未将对象引用设置为对象的实例.".

I've seen a lot of post about other people having problems with "binding redirects" but not found a single reference to this problem combined with "Object reference not set to an instance of an object.".

NuGet 在这个阶段到底想做什么?它是否尝试更新 Web.Config 中的绑定重定向?我的 Web.Config 有问题吗?我该如何调试?

What exactly is NuGet trying to do at this stage? Does it try to update the binding redirects in Web.Config? Could i have some issue with my Web.Config? How can i go about debugging this?

我会说这不会发生在干净"的项目中.

I shall say that this does not happen in a "clean" project.

推荐答案

我在一个项目中处理 MVC 版本时遇到了同样的问题.我认为任何尝试将绑定重定向添加到您的配置文件的 NuGet 包都可能发生这种情况.

I had the same issue mucking around with MVC versions in one project. I think it could happen for any NuGet package that tries to add Binding Redirects to your config file.

我最终将Web.config"重命名为Web.Temp.Config",然后安装包.

I ended up renaming "Web.config" to "Web.Temp.Config", then installing the package.

然后我手动将包放入我的配置文件的更改合并到临时文件中,然后删除它并将我的原始文件重命名回 web.config.

I then I manually merged the changes that the package put into my config file into the temp one, then deleted it and renamed my original back to web.config.

这为我解决了问题 - 希望对您有所帮助.

This resolved the issue for me - hopefully it helps you.

这篇关于NuGet“无法为我的项目生成绑定重定向"错误“未将对象引用设置为对象的实例."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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