.net 如何修复 Visual Studio 中的“系统找不到指定的文件。(来自 HRESULT:0X80070002 的异常)”错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28299341/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix the "The system cannot find the file specified. (Exception from HRESULT:0X80070002)" error in Visual Studio?
提问by Sankar
i trying to create a new project in visual studio .it give some error
我试图在 Visual Studio 中创建一个新项目。它给出了一些错误
please give me some suggestions.....
请给我一些建议......
i don't know this happen. i am trying to reinstall and again same error is coming .
我不知道这会发生。我正在尝试重新安装,再次出现同样的错误。
i try this cant work ...
我试试这行不通...
回答by Charitha Goonewardena
Try 1 first if not other one
如果不是其他,请先尝试 1
- Go to
Extentions and updatesthen SearchNugetand uninstall it, restart visual studio, again installNugetthen again restart. you should be able to create your new project. - Repair your Visual Studio 2013 or 2015
- 转到
Extentions and updates然后搜索Nuget并卸载它,重新启动visual studio,再次安装Nuget然后再次重新启动。您应该能够创建新项目。 - 修复您的 Visual Studio 2013 或 2015
回答by Jenny O'Reilly
I am using Visual Studio 2015 Express Web and had the same problem. I searched a lot for solutions and none of these worked:
我正在使用 Visual Studio 2015 Express Web 并且遇到了同样的问题。我搜索了很多解决方案,但这些都没有奏效:
- Reinstall Nuget for Visual Studio 2015
- Replace Nuget for Visual Studio 2015 with the former Nuget
- Run Visual Studio as Administrator
- Modify/Delete IISExpress applicationhost.config file
- Reinstall IISExpress
- 为 Visual Studio 2015 重新安装 Nuget
- 用以前的 Nuget 替换 Visual Studio 2015 的 Nuget
- 以管理员身份运行 Visual Studio
- 修改/删除 IISExpress applicationhost.config 文件
- 重新安装 IISExpress
The only thing that solved it was a Repair-installof Visual Studio:
解决它的唯一方法是修复安装Visual Studio:
- Press Windows+ R
- Enter
appwiz.cpland press Enter - Right-click the entry "Microsoft Visual Studio Express 2015 for Web" and click "Repair"
- Be patient...
- 按Windows+R
- 输入
appwiz.cpl并按下Enter - 右键单击“Microsoft Visual Studio Express 2015 for Web”条目,然后单击“修复”
- 要有耐心...
Note:This is going to reinstall all packages that you have uninstalled, because you weren't needing them (eg. Microsoft SQL Server Native Client).
注意:这将重新安装您已卸载的所有软件包,因为您不需要它们(例如 Microsoft SQL Server Native Client)。
回答by Amol
Go to: VS2013->Tools->Extensions and Updates->Online Search for NuGet and install. Fixed my problem in 2013 REL
转到:VS2013->工具->扩展和更新->在线搜索NuGet并安装。在 2013 REL 中修复了我的问题
回答by Sylvain
I had the same error using VS community 2017 (and previous), when trying to open a .cs file, or trying to open project properties. All that on a fresh VS install on a fresh Windows 10 install...
在尝试打开 .cs 文件或尝试打开项目属性时,我在使用 VS 社区 2017(及之前)时遇到了同样的错误。所有这些都在全新的 Windows 10 安装上的全新 VS 安装上...
I found 2 solutions:
我找到了2个解决方案:
Start VS as admin (which is not a good choice, and may prevent debugging drag&drop into your app).
以管理员身份启动 VS(这不是一个好的选择,并且可能会阻止调试拖放到您的应用程序中)。
or better:
或更好:
Change security settings of your %temp% folder to "everyone - full control". :)
将 %temp% 文件夹的安全设置更改为“everyone - full control”。:)
回答by rubizky
You need to install Nuget package manager from Tools-> Extensions and Updates -> online-> and search 'Nuget package manager' from search bar and click install.
您需要从工具-> 扩展和更新-> 在线-> 安装 Nuget 包管理器,然后从搜索栏中搜索“Nuget 包管理器”,然后单击安装。
回答by Kaka
I encountered a similar problem when creating a .NET core project in VS 2015, and it's resolved by repairing .NET Core. The possible reason is, my .NET core was installed associated with VS community version, but later I uninstall VS community and reinstall professional version, but .NET Core was not uninstalled with community version uninstall. After repairing .NET core from control panel, it works now.
我在VS 2015中创建.NET Core项目时遇到了类似的问题,通过修复.NET Core解决了。可能的原因是,我的.NET Core是和VS社区版关联安装的,后来我卸载了VS社区,重新安装了专业版,但是没有卸载社区版的.NET Core。从控制面板修复 .NET core 后,它现在可以工作了。
回答by Naresh Narasimhalu
Solution by Andriy Svyryd:
Andriy Svyryd 的解决方案:
Modifying Visual Studio 2015 installation and unchecking Microsoft Web Developer Tools Deleting C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX folder that was left from a previous version of the tools. Deleting %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache Deleting %LocalAppData%\Microsoft\VisualStudio\14.0\devenv.exe.config Running repair on the preview2 tooling.
修改 Visual Studio 2015 安装并取消选中 Microsoft Web Developer Tools 删除 C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX 文件夹,该文件夹是以前版本的工具留下的。删除 %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache 删除 %LocalAppData%\Microsoft\VisualStudio\14.0\devenv.exe.config 在 preview2 工具上运行修复。
回答by alaskanloops
Do you have the relevent components installed along with Visual Studio?
您是否与 Visual Studio 一起安装了相关组件?
I was getting this error when trying to add a new Axure Mobile Services project. Knowing how long repairing Visual Studio takes, I hoped to avoid that.
尝试添加新的 Axure 移动服务项目时出现此错误。知道修复 Visual Studio 需要多长时间,我希望避免这种情况。
What fixed it for me was opening up Programs and Features, and selecting "Modify" Visual Studio rather than "Repair".
对我来说修复它的是打开程序和功能,然后选择“修改”Visual Studio 而不是“修复”。
I'm not sure if there was an error in a previous installation that I didn't notice, but Web Tools wasn't selected in the installed components. After selecting that, installing, and restarting my computer, I no longer got the error when trying to add a new project.
我不确定以前的安装中是否存在我没有注意到的错误,但是在安装的组件中没有选择 Web Tools。选择它,安装并重新启动计算机后,尝试添加新项目时不再出现错误。
回答by Byre Gowda
I encountered the same problem when I try to create ASP.NET MVC 4 web application in VS 2012.
我在 VS 2012 中尝试创建 ASP.NET MVC 4 Web 应用程序时遇到了同样的问题。
To resolve this issue In VS 2012 click on Tools (menu)>>Extensions and Updates (menu item) >> in the Extensions and Updates window click on Updates menu.
解决此问题 在 VS 2012 中,单击工具(菜单)>>扩展和更新(菜单项)>> 在扩展和更新窗口中单击更新菜单。
Install pending updates for VS 2012 and also for Nuget.
为 VS 2012 和 Nuget 安装待处理的更新。
Restart the VS 2012.
重新启动 VS 2012。

