Код ошибки 0х80070002 visual studio

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

Dissoantn Void's user avatar

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.

enter image description here

I suggest you could refer to the Doc:

When you specify /DEBUG with no additional options, the linker
defaults to /DEBUG:FULL for 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:FASTLINK when you specify the /DEBUG option for debug builds.
Other defaults are unchanged to maintain backward compatibility.

answered Mar 27, 2020 at 2:32

Jeaninez - MSFT's user avatar

Jeaninez — MSFTJeaninez — MSFT

3,2581 gold badge5 silver badges21 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

Chris's user avatar

ChrisChris

2611 silver badge10 bronze badges

i trying to create a new project in visual studio .it give some error

please give me some suggestions…..enter image description here

i don’t know this happen.
i am trying to reinstall and again same error is coming .

i try this cant work …

Krisztián Balla's user avatar

asked Feb 3, 2015 at 12:47

Sankar's user avatar

5

Try 1 first if not other one

  1. Go to Extentions and updates then Search Nuget and uninstall it,
    restart visual studio, again install Nuget then again restart.
    you should be able to create your new project.
  2. Repair your Visual Studio 2013 or 2015

answered Jul 12, 2016 at 18:01

Charitha Goonewardena's user avatar

1

I am using Visual Studio 2015 Express Web and had the same problem. I searched a lot for solutions and none of these 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

The only thing that solved it was a 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»
  • Be patient…

Note: This is going to reinstall all packages that you have uninstalled, because you weren’t needing them (eg. Microsoft SQL Server Native Client).

answered Feb 20, 2016 at 10:40

Krisztián Balla's user avatar

Krisztián BallaKrisztián Balla

19.3k13 gold badges68 silver badges84 bronze badges

1

Go to: VS2013->Tools->Extensions and Updates->Online Search for NuGet and install. Fixed my problem in 2013 REL

answered Feb 2, 2016 at 10:05

Amol's user avatar

AmolAmol

1,4312 gold badges18 silver badges32 bronze badges

1

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.

answered Oct 12, 2016 at 8:49

Kaka's user avatar

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…

I found 2 solutions:

Start VS as admin (which is not a good choice, and may prevent debugging drag&drop into your app).

or better:

Change security settings of your %temp% folder to «everyone — full control». :)

answered May 3, 2017 at 8:46

Sylvain's user avatar

SylvainSylvain

2732 silver badges11 bronze badges

You need to install Nuget package manager from Tools-> Extensions and Updates -> online-> and search ‘Nuget package manager’ from search bar and click install.

answered May 7, 2017 at 15:05

rubizky's user avatar

Solution by 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.

answered Jan 11, 2017 at 14:01

Naresh Narasimhalu's user avatar

Do you have the relevent components installed along with 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.

What fixed it for me was opening up Programs and Features, and selecting «Modify» Visual Studio rather than «Repair».

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.

answered Jan 21, 2017 at 21:16

alaskanloops's user avatar

I encountered the same problem when I try to create ASP.NET MVC 4 web application in VS 2012.

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.

Install pending updates for VS 2012 and also for Nuget.

Restart the VS 2012.

answered Feb 17, 2017 at 6:24

Byre Gowda's user avatar

My version of the problem was caused by VS extensions running in the background.
My solution: disable non-critical extension «Extension» -> «Manage Extensions» -> «Installed» -> disable: «Visual Studio IntelliCode», and also disable other extensions not currently in use.
-> restart VS

answered Feb 23, 2022 at 10:34

siggi_pop's user avatar

siggi_popsiggi_pop

5687 silver badges10 bronze badges

RRS feed

  • 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

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 | LinkedIn

    This 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 | LinkedIn

    This 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

Ну, я написал простой код, чтобы проверить возможность создания объектов с помощью оператора «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

Другие решения

Других решений пока нет …

Вопрос:

Я пытаюсь создать новый проект в visual studio.it дает некоторую ошибку

пожалуйста, дайте мне несколько предложений….. enter image description here

Я этого не знаю.
Я пытаюсь переустановить, и снова появляется такая же ошибка.

Я пробую эту работу…

Ответ №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.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX, оставленной из предыдущей версии инструментов.
Удаление% LocalAppData%\Microsoft\VisualStudio\14.0\ComponentModelCache
Удаление% LocalAppData%\Microsoft\VisualStudio\14.0\devenv.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% на “все – полный контроль”.:)

Понравилась статья? Поделить с друзьями:
  • Код ошибки 0х80070002 как исправить windows 10
  • Код ошибки 0х490 windows 10 как исправить
  • Код ошибки 0х80040154 0х90018 как исправить
  • Код ошибки 0х80070002 win 10
  • Код ошибки 0х80070002 0ха001в