I just installed visual studio, (not new to coding) and I keep getting an error that goes like «error: unable to open file C:user…main.obj Error code = 0x80070002»
an Image of the error
this error shows up whenever there is something wrong with my code like for example if i do:
#include <iostream>
int main()
{
std::cout << "Hello World!n";
}
everything runs normal, but if I make a mistake say:
#include <iostream>
int main()
{
std::cout std::cout << "Hello World!n";
}
I get the error, it’s so annoying I don’t want to get that error every time there is something wrong with my code the error list bar is enough, what do I do ?
asked Mar 26, 2020 at 12:50
4
Could you please tell us what version of Visual Studio are you using?
If you are using vs2017 or later, I suggest you could try to use /DEBUG:FULL property in «Linker/Debugging/Generate Debug Info.

I suggest you could refer to the Doc:
When you specify /DEBUG with no additional options, the linker
defaults to/DEBUG:FULLfor command line and make file builds, for
release builds in the Visual Studio IDE, and for both debug and
release builds in Visual Studio 2015 and earlier versions. Beginning
in Visual Studio 2017, the build system in the IDE defaults to
/DEBUG:FASTLINKwhen you specify the /DEBUG option for debug builds.
Other defaults are unchanged to maintain backward compatibility.
answered Mar 27, 2020 at 2:32
Jeaninez — MSFTJeaninez — MSFT
3,0501 gold badge4 silver badges20 bronze badges
Rebuild the program in a different disk or reinstall the VS could be the final solution I think.
answered Mar 27, 2020 at 2:37
ChrisChris
2531 silver badge10 bronze badges

- Remove From My Forums
-
Question
-
I have this problem (The system cannot find the file specified. (Exception from HRESULT: 0x80070002)) when create new project on visual studio 2015
-
Edited by
Ashraf alngar
Sunday, March 20, 2016 4:14 PM -
Moved by
Angie Xu
Monday, March 28, 2016 1:28 AM
this is visual studio issue
-
Edited by
All replies
-
Hi Ashraf,
Welcome on MSDN forum.
Could you please provide some details, is it related to BizTalk Server?
This forum is related to Microsoft BizTalk Server related queries. If you issue is not related to BizTalk, please post it on Visual Studio forum to get proper solution.
https://social.msdn.microsoft.com/Forums/en-US/home?category=visualstudio
Thanks,
If my reply is helpful please mark as
Answer or vote as
Helpful.My blog |
Twitter | LinkedInThis post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
-
Solution: Some users had already faced the same issue and Visual Studio 2015 Express Web and had the same problem. Please try below solutions and see if it worked,
- 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
If all above solution not worked then only thing that you need to Repair-install of Visual Studio:
- Press Windows + R
- Enter appwiz.cpl and press Enter
- Right-click the entry «Microsoft Visual Studio Express 2015 for Web» and click «Repair»
Note: This is going to reinstall all packages that you have uninstalled, because you weren’t needing them (eg. Microsoft SQL Server Native Client).
Reference: http://stackoverflow.com/questions/28299341/the-system-can-not-find-the-file-specified-in-visual-studio-exception-from-hres
Thanks,
If my reply is helpful please mark as
Answer or vote as
Helpful.My blog |
Twitter | LinkedInThis post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.
-
Proposed as answer by
Weiwei Cai
Monday, March 28, 2016 9:39 AM
-
Thanks for [Kamlesh Kumar]’s help.
Hi Ashraf alngar,
Which version or Visual Studio 2015 are you using? Please install the latest update for VS2015 to check whether it can be fixed. The latest update for VS 2015 current now is Update 1. Please download and install from below link.
https://www.microsoft.com/en-us/download/details.aspx?id=49989
Please try [Kamlesh Kumar]’s steps first to check whether it can fix your problem or not. If the problem has been fixed, please mark the helpful reply as answer, which is benefit to other communities who has the same problem.
If the problem still exist, please use http://aka.ms/vscollect to gather the VS and .Net Frameowrk installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file
to Onedrive and share the link here.Best Regards,
Weiwei
Вопрос:
Я пытаюсь создать новый проект в visual studio.it дает некоторую ошибку
пожалуйста, дайте мне несколько предложений….. 
Я этого не знаю.
Я пытаюсь переустановить, и снова появляется такая же ошибка.
Я пробую эту работу…
Ответ №1
Попробуйте 1 первый, если не другой
- Перейдите в
Extentions and updates, затем найдитеNugetи удалите его,
перезапустите визуальную студию, снова установитеNuget, затем снова перезапустите.
вы должны иметь возможность создать свой новый проект. - Восстановите свою Visual Studio 2013 или 2015
Ответ №2
Я использую Visual Studio 2015 Express Web и имею ту же проблему. Я много искал для решений, и ни одна из них не работала:
- Переустановите Nuget для Visual Studio 2015
- Замените Nuget для Visual Studio 2015 с прежним Nuget
- Запустить Visual Studio как администратор
- Изменить/Удалить файл IISExpress applicationhost.config
- Переустановите IISExpress
Единственное, что разрешило это: Repair-install Visual Studio:
- Нажмите Windows + R
- Введите
appwiz.cplи нажмите Enter - Щелкните правой кнопкой мыши запись “Microsoft Visual Studio Express 2015 для Интернета” и нажмите “Восстановить”
- Будьте терпеливы…
Примечание.. Это приведет к переустановке всех удаленных вами пакетов, поскольку вам не нужны они (например, собственный клиент Microsoft SQL Server).
Ответ №3
Перейдите по ссылке: VS2013- > Инструменты- > Расширения и обновления- > Онлайн-поиск для NuGet и установка. Исправлена проблема в 2013 году REL
Ответ №4
Я столкнулся с аналогичной проблемой при создании основного проекта .NET в VS 2015, и он разрешил восстановление .NET Core. Возможная причина: ядро .NET было установлено, связанное с версией сообщества VS, но позже я удалю сообщество VS и переустановил профессиональную версию, но .NET Core не был удален с удалением версии сообщества. После восстановления ядра .NET с панели управления он работает сейчас.
Ответ №5
Вам нужно установить менеджер пакетов Nuget из Tools- > Extensions and Updates → online- > и найти “Nuget package manager” из панели поиска и нажать “Установить”.
Ответ №6
Решение Андрея Свирида:
Изменение установки Visual Studio 2015 и снятие флажка Microsoft Web Developer Tools
Удаление папки C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDEExtensionsMicrosoftWeb ToolsDNX, оставленной из предыдущей версии инструментов.
Удаление% LocalAppData%MicrosoftVisualStudio14.0ComponentModelCache
Удаление% LocalAppData%MicrosoftVisualStudio14.0devenv.exe.config
Выполнение ремонта инструментария предварительного просмотра.
Ответ №7
У вас есть соответствующие компоненты, установленные вместе с Visual Studio?
Я получал эту ошибку при попытке добавить новый проект Axure Mobile Services. Зная, как долго восстанавливается Visual Studio, я надеялся избежать этого.
Для меня исправлено открытие программ и функций и выбор “Изменить” Visual Studio, а не “Ремонт”.
Я не уверен, была ли ошибка в предыдущей установке, которую я не заметил, но веб-инструменты не были выбраны в установленных компонентах. После выбора этого, установки и перезагрузки моего компьютера, я больше не получаю ошибку при попытке добавить новый проект.
Ответ №8
Я столкнулся с той же проблемой, когда пытаюсь создать веб-приложение ASP.NET MVC 4 в VS 2012.
Чтобы устранить эту проблему В VS 2012 нажмите “Инструменты” (меню) → “Расширения и обновления” (пункт меню) → в окне “Расширения и обновления” нажмите “Обновить”.
Установите ожидающие обновления для VS 2012, а также для Nuget.
Перезапустите VS 2012.
Ответ №9
У меня была такая же ошибка с использованием сообщества VS 2017 (и предыдущего) при попытке открыть файл .cs или попытке открыть свойства проекта.
Все это на новой установке VS на новой установке Windows 10…
Я нашел 2 решения:
Запустите VS как admin (что не является хорошим выбором и может препятствовать отладке drag & drop в ваше приложение).
или лучше:
Измените параметры безопасности вашей папки% temp% на “все – полный контроль”.:)
Currently doing a school project using Visual Studio and C++. I can’t seem to compile and test my code because I keep getting a Visual Studio pop up that reads
Error: Unable to open file U:ProjectOneDebugSource.obj. Error Code = 0x80070002.
I’m not entirely sure how to go about this as I am still new to programming and have no idea how file management works yet. The only files I am using thus far are a Source.cpp file and a Header.h file in my project folder.
asked Mar 19, 2022 at 22:34
9
Load 7 more related questions
Show fewer related questions
Ну, я написал простой код, чтобы проверить возможность создания объектов с помощью оператора «new». Когда я пытался скомпилировать код, MS Visual Studio выдавала ошибку примерно так: «Ошибка: невозможно открыть файл C: Users … test1 Debug main.obj. Код ошибки = 0x80070002.Error: Could not find ‘C: Users … test1 Debug main.obj’. test1.exe был собран с / DEBUG: FASTLINK, который требует объектные файлы для отладки.
Что здесь происходит? Пожалуйста помоги.
Код:
#include <iostream>
class czlowiek {
int wiek;
char plec;
czlowiek();
czlowiek(int Wiek, int Plec);
};
czlowiek::czlowiek(int Wiek, int Plec) {
wiek = Wiek;
plec = Plec;
}
int main()
{
czlowiek *first;
first = new czlowiek();
delete first;
std::cin.get();
return 0;
}
0
Решение
Код, который вы разместили, не будет ссылаться:
- Конструктор
czlowiek()не имеет реализации. - Оба конструктора являются закрытыми (в классах члены и методы по умолчанию закрыты).
В качестве предупреждения вы назначаете int для char (plec).
1
Другие решения
Других решений пока нет …
