NuGet“无法为我的项目生成绑定重定向"错误“未将对象引用设置为对象的实例."

编程入门 行业动态 更新时间:2024-10-26 00:22:32
本文介绍了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“无法为我的项目生成绑定重定向"错误“未将对象引用设置为对象的实例."

本文发布于:2023-11-07 14:50:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566745.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   设置为   绑定   重定向   实例

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!