写入文件'http:packages.config'时发生错误 [英] An error occurred while writing file 'http:packages.config'

查看:66
本文介绍了写入文件'http:packages.config'时发生错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的小网站项目。 nuget一直运作良好,直到今天我突然无法更新包。我试图删除SOLUTION\packages并进行恢复,但得到这个持久性错误:

写入文件'http:packages.config'时出错:失败将packages.config写为XML文件'http:packages.config'。错误:'不支持URI格式。'。


解决此问题的任何解决方法?谢谢。




无知是幸福的

解决方案

嗨Neo,


欢迎来到MSDN论坛。


什么是你的VS版本这个网站项目是否映射到本地IIS?


我发现其他一些社区成员向VS产品团队报告了类似的问题,请检查一下:

Nuget在IIS上运行的Web表单网站上查找错误的packages.config位置
,如果你也遇到同样的问题,那么请尝试使用以下内容:


在记事本中打开解决方案文件并查找以下行:

Project(" {E24C65DC-7377-472B-9ABA- BC803B73C61A}")=" WebSite1",

" http:// localhost / website1",   " {F8AAD21F-B817-4561-A49C-65983F6487E8}"


如果解决方案文件在网站内,则将URL更改为"。"
如果解决方案文件在网站之外,您可以将属性更改为"WebSite1 \":

Project(" {E24C65DC-7377 -472B-9ABA-BC803B73C61A}")="WebSite1(1)","WebSite1 \","{F8AAD21F-B817-4561-A49C-65983F6487E8}"


如果您对上述内容有不同的问题,请尝试创建一个新的网站项目,以检查此问题是否仍然存在。




最好的问候,


萨拉


I have a simple small website project. The nuget had been working well until today I suddenly cannot update packages. I tried to delete SOLUTION\packages and do a restore, but get this peristent error:

An error occurred while writing file 'http:packages.config': Failed to write packages.config as XML file 'http:packages.config'. Error: 'URI formats are not supported.'.

Any workaround to fix this? Thanks.


Ignorance is blissful

解决方案

Hi Neo,

Welcome to the MSDN forum.

What’s your VS version and this website project is mapped to the local IIS?

I found some other community members reported a similar issue to the VS Product Team, please check this: Nuget looking in wrong location for packages.config in web forms web site running on IIS and if you also got the same issue, then please have a try with the following:

Open the Solution-file in notepad and look for this line:
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1",
"http://localhost/website1", "{F8AAD21F-B817-4561-A49C-65983F6487E8}"

Change the Url to "." if the solution-file is inside the website.
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1", ".", "{F8AAD21F-B817-4561-A49C-65983F6487E8}"

If the solution-file is outside of the website you can change the property to "WebSite1\":
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebSite1(1)", "WebSite1\", "{F8AAD21F-B817-4561-A49C-65983F6487E8}"

If you have a different issue with the above, please try to create a new website project to check if this issue persists or not.

Best regards,

Sara


这篇关于写入文件'http:packages.config'时发生错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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