Ошибка при сборке visual studio

Посмотрев ваш проект, сообщаю: вы компилируете файлы Unit.cpp и Source.cpp. И все бы ничего, на вы же ухитрились в Unit.cpp внести строку

#include "Source.cpp"

так что все функции и иже с ними, имеющиеся в Source.cpp, скомпилированы дважды! Уберите эту строку.

И как только вы сделаете это и добавите отсутствующие у вас реализации Employee::Print() и Housewives::Print(), все соберется. Заработает ли — это уже совсем второй вопрос, я не смотрел сам код, только сборку…

Я понимаю, что это может показаться бредом, но я у меня глаз начинает дергаться уже. На всех сайтах пишут давайте мол сделаем первый проект и бла бла бла, я установил себе visual studio 2019, создаю проект, копирую текст кода

C++
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <cstdlib> // для system
using namespace std;
 
int main()
{
    cout << "Hello, world!" << endl;
    system("pause"); // Только для тех, у кого MS Visual Studio
    return 0;
}

и у меня вываливается куча ошибок.
Первым выскакивает окно — Возникли ошибки сборки… Продолжить и запустить последний успешно построенный вариант?

Жму Да

Не удается запустить программу (путь к экзешнику)

Не удается найти указанный файл

Жму ОК
И внизу под кодом 17 ошибок, которые ругаются на код…

Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x7» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x1b» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2146 синтаксическая ошибка: отсутствие «;» перед идентификатором «щюь» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1

Это я некоторые скопировал.

Я пробовал в VSCode попробовать, но там тоже ничего не запускается…. Проблема с файло JSON. МОжет какие-то предварительные настройки нужно сделать?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь

I recently updated from Visual Studio 2017 Community Edition to Visual Studio 2019 Community Edition.

Now, if I build my solution with errors, they will show up in the build output, but not all of them will appear in the error list. It would appear only errors of open files will show up in the error list. This is incredibly annoying.

I am not alone in this issue. It has been reported many times on Microsoft’s forums, but no one has a definitive solution.

I have tried a variety of solutions people suggested in those threads:

  • I have ensured the filters are legitimate: Entire Solution, Errors enabled, Build + Intellisense.
  • I have tried deleting the .vs folder and restarting Visual Studio.
  • I just updated to the very latest Visual Studio 2019 version. Supposedly there are many different versions of this error, happening in versions of Visual Studio all the way back to 2017. Some supposedly have been fixed…?
  • I have disabled parallel project loading.

I have experienced this before in other versions of Visual Studio with Razor pages. To my knowledge, that’s to be expected in Razor though.

The only other factor that I severely doubt impacts anything is that it’s a Visual Studio project generated by Unity editor. From what I’ve read, ASP.NET, Razor, Xamarin, and other frameworks have each had their own version of issue reported. Perhaps Unity is afflicted by it too, but I don’t see how or why. I doubt Unity’s auto-generated Visual Studio projects are that different from your standard library projects.

You’re in Visual Studio… you press F5 (Run) and are greeted by this dialog:

There were build errors. Would you like to continue and run the last successful build?

Wonderful.

I’m sure there are cases where running the last successful build is useful, however, I have never purposefully answered yes to this question. Oh sure, I’ve clicked Yes plenty of times, and waiting in frustration for the first opportunity to undo my blunder, but nothing more.

So, have you ever found this feature useful? And if so, under what circumstances did it become helpful for you to be able to run the last successful build of your application?

How often do you accidentally click Yes and kick yourself while waiting for the app to start?

asked Feb 27, 2009 at 19:02

joshuapoehls's user avatar

joshuapoehlsjoshuapoehls

31k11 gold badges50 silver badges61 bronze badges

4

In VS2008 there are the following options you can set to change the behavior (not sure if there are similar options in other versions of Visual Studio):

Projects and Solutions/Build and Run

    - On Run, when projects are out of date:

          Always build
          Never build
          Prompt to build <== default setting

    - On Run, when build or deployment errors occur:

          Launch old version
          Do not launch
          Prompt to launch <== default setting

Set the above options to «Always build» and «Do not launch» and you get what I consider a more ueseful behavior. Though sometimes when I try to launch the debugger and there’s a build error it takes me a few seconds to realize why I’m not getting to the breakpoint I thought I’d be hitting (it might be nice to get some sort of ‘toaster’ type of message to knock me out of my stupor).

answered Feb 27, 2009 at 19:31

Michael Burr's user avatar

Michael BurrMichael Burr

329k50 gold badges528 silver badges755 bronze badges

6

This behaviour can be defined under
Tools->Options->Projects and Solutions->Build And Run->
On Run, when Build or Deployment Errors occur

here you can select:
— Launch old version
— Do not launch
— Ask to launch

answered Apr 9, 2009 at 8:56

This can be useful when you debug a web application and one of the pages does not compile, because some other developer checked in a bad version, or you can’t check out the latest code for whatever reason, but you know you will not hit that page. I do it all the times.

answered Feb 27, 2009 at 19:06

cdonner's user avatar

cdonnercdonner

36.6k22 gold badges105 silver badges149 bronze badges

Interesting. I’ve actually never seen that dialog — I know there’s an option to enable/disable running the previous successful build, so perhaps it shows a dialog first. You can look into disabling it if you won’t use it.

One reason this can be useful, however, is if you want to remind yourself what the bug was that you were working on. Not all things can be fixed in edit-and-continue, and you might need a memory jog.

answered Feb 27, 2009 at 19:07

lc.'s user avatar

lc.lc.

112k20 gold badges157 silver badges185 bronze badges

It’s also helpful on web applications, because it will force the cassini servers to start. You need this if you are working on one project in the solution that won’t compile, and you need to refresh the web services in another project.

answered Feb 27, 2009 at 19:23

kemiller2002's user avatar

kemiller2002kemiller2002

113k27 gold badges196 silver badges251 bronze badges

When using VS 2008 Express, there is a box to never show this dialog again. Just tried it and it will take away the dialog, leaving only a build failed message in the bottom left hand portion of the screen.

As for how often do I hit it, quite often. Frustrating as sometimes I have changed the code complete while testing things and will get something completely unrelated to the task at hand. Not sure when Microsoft figured this would be useful.

answered Feb 27, 2009 at 20:05

Terry's user avatar

TerryTerry

3191 gold badge3 silver badges13 bronze badges

It works on the preference of selection of appropriate dll on runtime. Executables are not generated if there is any built error so the compiler looks for the executable which is existing which is obviously the last successful compiled.

answered Jun 9, 2009 at 12:03

You’re in Visual Studio… you press F5 (Run) and are greeted by this dialog:

There were build errors. Would you like to continue and run the last successful build?

Wonderful.

I’m sure there are cases where running the last successful build is useful, however, I have never purposefully answered yes to this question. Oh sure, I’ve clicked Yes plenty of times, and waiting in frustration for the first opportunity to undo my blunder, but nothing more.

So, have you ever found this feature useful? And if so, under what circumstances did it become helpful for you to be able to run the last successful build of your application?

How often do you accidentally click Yes and kick yourself while waiting for the app to start?

asked Feb 27, 2009 at 19:02

joshuapoehls's user avatar

joshuapoehlsjoshuapoehls

31k11 gold badges50 silver badges61 bronze badges

4

In VS2008 there are the following options you can set to change the behavior (not sure if there are similar options in other versions of Visual Studio):

Projects and Solutions/Build and Run

    - On Run, when projects are out of date:

          Always build
          Never build
          Prompt to build <== default setting

    - On Run, when build or deployment errors occur:

          Launch old version
          Do not launch
          Prompt to launch <== default setting

Set the above options to «Always build» and «Do not launch» and you get what I consider a more ueseful behavior. Though sometimes when I try to launch the debugger and there’s a build error it takes me a few seconds to realize why I’m not getting to the breakpoint I thought I’d be hitting (it might be nice to get some sort of ‘toaster’ type of message to knock me out of my stupor).

answered Feb 27, 2009 at 19:31

Michael Burr's user avatar

Michael BurrMichael Burr

329k50 gold badges528 silver badges755 bronze badges

6

This behaviour can be defined under
Tools->Options->Projects and Solutions->Build And Run->
On Run, when Build or Deployment Errors occur

here you can select:
— Launch old version
— Do not launch
— Ask to launch

answered Apr 9, 2009 at 8:56

This can be useful when you debug a web application and one of the pages does not compile, because some other developer checked in a bad version, or you can’t check out the latest code for whatever reason, but you know you will not hit that page. I do it all the times.

answered Feb 27, 2009 at 19:06

cdonner's user avatar

cdonnercdonner

36.6k22 gold badges105 silver badges149 bronze badges

Interesting. I’ve actually never seen that dialog — I know there’s an option to enable/disable running the previous successful build, so perhaps it shows a dialog first. You can look into disabling it if you won’t use it.

One reason this can be useful, however, is if you want to remind yourself what the bug was that you were working on. Not all things can be fixed in edit-and-continue, and you might need a memory jog.

answered Feb 27, 2009 at 19:07

lc.'s user avatar

lc.lc.

112k20 gold badges157 silver badges185 bronze badges

It’s also helpful on web applications, because it will force the cassini servers to start. You need this if you are working on one project in the solution that won’t compile, and you need to refresh the web services in another project.

answered Feb 27, 2009 at 19:23

kemiller2002's user avatar

kemiller2002kemiller2002

113k27 gold badges196 silver badges251 bronze badges

When using VS 2008 Express, there is a box to never show this dialog again. Just tried it and it will take away the dialog, leaving only a build failed message in the bottom left hand portion of the screen.

As for how often do I hit it, quite often. Frustrating as sometimes I have changed the code complete while testing things and will get something completely unrelated to the task at hand. Not sure when Microsoft figured this would be useful.

answered Feb 27, 2009 at 20:05

Terry's user avatar

TerryTerry

3191 gold badge3 silver badges13 bronze badges

It works on the preference of selection of appropriate dll on runtime. Executables are not generated if there is any built error so the compiler looks for the executable which is existing which is obviously the last successful compiled.

answered Jun 9, 2009 at 12:03

Недавно я обновился от Visual Studio 2017 Community Edition в Visual Studio 2019 Community Edition.

Теперь, если я создаю свое решение с ошибками, они будут отображаться в выходе на сборку, но не все они будут отображаться в списке ошибок. Поягиваются бы только ошибки открытых файлов в списке ошибок. Это невероятно раздражает.

Я не одинок в этом вопросе. Об этом сообщалось много раз на форумах Microsoft, но никто не имеет окончательного решения.

Я пробовал различные решения, которые люди предложили в этих потоках:

  • Я гарантировал, что фильтры являются легитимными: все решение, ошибки включены, построить + Intellisense.
  • Я пытался удалить папку .vs и перезапустить Visual Studio.
  • Я только что обновил до последней версии Visual Studio 2019. Предположительно, есть много разных версий этой ошибки, происходящее в версиях Visual Studio, вплоть до 2017 года. Некоторые предположительно были исправлены …?
  • Я отключил параллельную загрузку проекта.

Я испытал это раньше в других версиях Visual Studio с помощью страниц бритвы. Насколько мне известно, это следует ожидать в бритве, хотя.

Единственным другим фактором, который я серьезно сомневаюсь, что это то, что это проект Visual Studio, созданный Unity Editor. Из того, что я прочитал, ASP.NET, бритва, ксамарин и другие рамки у каждого была представлена собственная версия вопроса. Возможно, единство поражено этим тоже, но я не вижу, как или почему. Я сомневаюсь, что автоматически генерируемые проекты Visual Studio Studio Unity могут отличаться от ваших стандартных библиотечных проектов.

4 ответа

Лучший ответ

Теперь я установил Visual Studio 2019 на две отдельные машины, и кажется, что «анализ полного решения» отключен по умолчанию.

Просто проверьте флажок в параметры, и все, кажется, работает, как это было ранее: Включить полный анализ решений« SRC = »HTTPS: //i.stack.imgur. com / enwvr.png


19

Zoop
20 Сен 2019 в 04:05

В моем случае это был тот факт, что я строил под профилем выпуска. Как только я выбрал «Отладка» в раскрывающемся списке рядом с кнопкой «Начать отладку», через несколько секунд в списке ошибок стали отображаться мои ошибки.


0

Jeff Zizzi
7 Июл 2021 в 04:17

Для тех, кто использует Visual Studio 2019 v16.9.1 Убедитесь, что ваше сообщение об ошибках выглядит что-то подобное:

Error List Window

Важная часть для меня выбрала build + intellisense (ранее его было установлено на building только , что объясняет, почему список ошибок только будет обновляться только на сборке).


2

Eric Mutta
3 Апр 2021 в 04:27

В моем случае решением было отключить «Инструменты-> Параметры-> Проекты и решения-> Общие-> Показывать окно вывода при запуске сборки». Несмотря на то, что в окне «Вывод» было показано «0 выполнено успешно, 1 не удалось», оно не переключилось обратно в окно «Список ошибок», даже если флажок над «Всегда показывать список ошибок, если сборка завершена с ошибками» должна была переместить его в «Ошибка. Список’. Очевидно, это ошибка в Visual Studio 2019, которой не было в Visual Studio 2017 (я только что закончил обновление).


0

AndresRohrAtlasInformatik
17 Май 2021 в 13:33

У меня возникла ошибка при отладке кода Java в коде Visual Studio.
Ошибка ниже

build failed, do you want to continue?

Я попытался очистить рабочее пространство, но это не сработало.
Пожалуйста, как я могу исправить эту проблему?

Перейти к ответу
Данный вопрос помечен как решенный


Ответы
7

Обновлять. Задача решена Я решил эту проблему, очистив кеш рабочей области в VS-коде. Вот ссылка на соответствующую страницу: Каталог чистой рабочей области VSCODE. Я переименовал несколько папок, имен классов и пакетов. Видимо плагину RedHat-Developer удалось рассинхронизировать. Файл .classpath не синхронизировался с файлом POM. Очистка кеша рабочей области заставила плагин воссоздать данные проекта из спецификации maven. Задача решена. Не уверен, но если кто-то из проекта RedHat это прочитает, мне это покажется ошибкой или недостатком. В любом случае это можно обойти.

Исходный ответ следует:

Я думаю, что Лю Бэй был недостаточно ясным. У меня такая же проблема. У меня есть проект, который отлично строится в Maven, и когда я запускаю отладчик в Visual Studio Code, это уведомление появляется в правом нижнем углу окна VSCode.

Очевидно, расширение «Отладчик для Java» считает, что существует проблема сборки. Однако нет сообщений об ошибках на вкладках ПРОБЛЕМЫ, ВЫВОД, ОТЛАДКА КОНСОЛИ или ТЕРМИНАЛ.

Сборки проекта и пакеты в Maven прекрасны, и его можно отлаживать в режиме присоединения, что в лучшем случае утомительно.

В VSCode что-то происходит, о чем я нигде не сообщаю. Я подозреваю, что подключаемый модуль RedHat VSCode для Java тоже используется, но мне нужна помощь в выяснении того, как обойти эту проблему.

Я должен сказать, что мы тратим слишком много времени на решение проблем с инструментами и зависимостями и недостаточно времени на приложение. Проект, над которым мы работаем, предназначен для распространения с открытым исходным кодом. Spring Framework кажется идеальным для наших целей, но инструменты не так уж и много. Мы не очень далеко продвинулись в этом проекте, и меня уже настаивают на переходе на .NET core MVC.

Действительно нужна небольшая помощь …

У меня это не сработало, но я выяснил, что сработало.

Прежде всего, глядя на плагин Java Dependencies, я намекнул, что что-то не синхронизировано. Имя моего приложения (артефакта) не соответствует имени в древовидном представлении Java Dependencies.

Это было исправлено путем полной очистки папки VSCode workspaceStorage!

В моем случае эта папка находилась в (Windows 10):

C:Users<myuser>AppDataRoamingCodeUserworkspaceStorage

Если вы не можете найти его в этом месте, просто найдите папку workspaceStorage.

Затем нажмите ctrl + shift + p (в моем случае), чтобы открыть запрос действия VSCode. Затем выберите команду:

Java: Open Java Language Server Log File

Это откроет файл журнала, который обычно не отображается при построении вашего кода Java, и сообщит вам, что именно пошло не так при сборке.

В моем случае это был конфликт, так как у меня было два файла AppConfig.java, один в основном и один в тестовом. Maven прекрасно справляется с этим, но, очевидно, построитель VSCode Java — нет.

Очевидно, это ошибки в плагинах, о которых я сообщу участникам GitHub, но пока нам придется немного поработать вручную.

Тем не менее, я надеюсь, что это поможет всем вам, разочаровавшимся разработчикам VSCode Java.

Попробуйте очистить кеш или
Попробуйте добавить свои файлы в новую рабочую область, у меня это сработало!

Итак, прочитав на этой странице несколько комментариев о кеш-памяти и рабочей области, я предпочел сделать что-нибудь простое. Я просто закрыл и открыл свой VS и Voilá Build up все мои решения

Ошибка сборки в VsCode

Эта ошибка возникает из-за того, что в папке вашей рабочей области в другом исходном коде есть ошибки.

Итак, создайте новую папку и сделайте ее папкой рабочей области, а затем напишите свои коды в этой папке и запустите ее.

У меня тоже была эта ошибка, и она работает для меня, поэтому проверьте свою.

Используя OSX, мне удалось преодолеть эту проблему: вы можете получить доступ либо из своего терминала, либо просто использовать ярлык (сдвиг команды и c) выберите «Базовая система», затем «Библиотека», найдите папку Java, затем нажмите папку виртуальных машин Java. Проверьте, есть ли актуальная версия jdk (самая последняя). Я заметил, что у меня было две папки jdk, одна, вероятно, унаследованная от предыдущей установки, и самая последняя версия jdk-15. Перетащите jdk-14 в корзину, введите пароль, закройте искатель и перезапустите VSCode.
Теперь все работает нормально!

У меня такая же проблема.
Я только что загрузил это, предоставленное vs code
пакет расширений Java
щелкните ссылку, загрузите и откройте ее. он автоматически настроит vs code для java.
ссылка ниже…

Https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack

Другие вопросы по теме

В режиме отладки, если в нашем приложении есть ошибка, когда мы нажимаем F5, чтобы начать отладку, появляется диалоговое окно с предупреждением: «В вашей программе есть ошибка. Вы хотите запустить свою последнюю измененную программу?» или что-то в этом роде.

Я хочу включить или отключить этот диалог.

Как я могу это сделать?

1 ответы

Вы можете включить/выключить эту подсказку в настройках Visual Studio:

  1. В меню «Инструменты» выберите «Параметры».
  2. В появившемся диалоговом окне разверните «Проекты и решения» и нажмите «Сборка и запуск».
  3. С правой стороны вы увидите поле со списком с надписью «При запуске, когда возникают ошибки сборки или развертывания».

    • Если вы хотите отключить окно сообщения, выберите «Не запускать» или «Запустить старую версию» (что запустит старую версию автоматически).
    • Если вы хотите включить окно сообщения, выберите «Предлагать запуск», который будет спрашивать вас каждый раз.

   Варианты VS «Сборка и запуск»

Конечно, как люди предположили в комментариях, это означает, что где-то в вашем коде есть ошибки, которые мешают его компиляции. Вам нужно использовать «Список ошибок», чтобы выяснить, что это за ошибки, а затем исправить их.

Создан 17 янв.

Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками

c#
visual-studio
debugging

or задайте свой вопрос.

Студворк — интернет-сервис помощи студентам

Я понимаю, что это может показаться бредом, но я у меня глаз начинает дергаться уже. На всех сайтах пишут давайте мол сделаем первый проект и бла бла бла, я установил себе visual studio 2019, создаю проект, копирую текст кода

C++
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <cstdlib> // для system
using namespace std;
 
int main()
{
    cout << "Hello, world!" << endl;
    system("pause"); // Только для тех, у кого MS Visual Studio
    return 0;
}

и у меня вываливается куча ошибок.
Первым выскакивает окно — Возникли ошибки сборки… Продолжить и запустить последний успешно построенный вариант?

Жму Да

Не удается запустить программу (путь к экзешнику)

Не удается найти указанный файл

Жму ОК
И внизу под кодом 17 ошибок, которые ругаются на код…

Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x7» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x1b» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2146 синтаксическая ошибка: отсутствие «;» перед идентификатором «щюь» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1

Это я некоторые скопировал.

Я пробовал в VSCode попробовать, но там тоже ничего не запускается…. Проблема с файло JSON. МОжет какие-то предварительные настройки нужно сделать?

изображение ошибки сборкиЯ установил Visual Studio Community 2017 и выбрал Разработка для рабочего стола в C ++. Все установлено.

Я создал новый проект, как Файл -> Новый -> Visual C ++ -> Пустой проект.

После запуска программы, нажав Локальный отладчик Windows, Я получаю следующую ошибку.

Ошибка сборки:
ошибка сборки

Полная ошибка:
полная ошибка

Я также проверил предыдущие вопросы, но не смог найти решение.

Примечание. Я не получаю консольное приложение Win32 (Файл -> Создать -> Проект -> Visual C ++ -> Консольное приложение Win32). Я получаю только консольное приложение Windows. Даже в этом также я получаю ошибку сборки.

-1

Решение

-1073741515 означает: «Приложению не удалось правильно инициализироваться (0xc0000135)» Поскольку вы не зависите от CLR, щелкните правой кнопкой мыши имя проекта и отключите поддержку общеязыковой среды выполнения в свойствах проекта.

введите описание изображения здесь

0

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

Вместо выбора Пустой проект для ваших первых экспериментов с VS2017 выберите один из типов проектов, который даст вам рабочий скелет. Если вы хотите попробовать консольное приложение C ++, тип проекта будет Консольное приложение Windows. Это даст вам готовое приложение с Main() функция, которая просто имеет return 0; утверждение в нем.

Ударь F11 ключ или выберите отлаживать/Шаг в из меню, чтобы скомпилировать ваш проект и перейти в Main(), Он остановится на открывающейся фигурной скобке. Удар F11 снова, и это будет шаг к return 0; заявление. Удар F5 сейчас он продолжит работу и выйдет из программы. Теперь вы убедились, что можете успешно создавать, запускать и отлаживать свой код.

Как только вы убедились, что это работает, вы можете начать добавлять код и отлаживать его. Пустой проект предназначен для тех случаев, когда вы действительно знаете, что делаете, и хотите начать с нуля, в противном случае один из предопределенных проектов — гораздо более простой способ начать работу.

1

The only strange thing is a warning on the projects, but without any indication of what it is:

enter image description here

enter image description here

enter image description here

Any ideas?

marc_s's user avatar

marc_s

729k175 gold badges1327 silver badges1455 bronze badges

asked Dec 11, 2021 at 14:23

jcintra's user avatar

6

If you have multiple projects under same solution make sure the Target Framework (Right click project -> properties) of each project is feasible for the referencing project. I was trying to refer to a project (v4.8) from v4.6 and encountered this error.

And also try checking the build order of the project (Right click solution -> Project Build Order) and clean and build each projects according to that order.

answered Jun 12, 2022 at 10:05

Ishan's user avatar

IshanIshan

2852 silver badges8 bronze badges

2

If you have Symantec Antivirus running on your machine, it could block MSBuild.exe from Visual Studio resulting in the build failing.

You may re-install/ reconfigure Symantec to allow MSBuild.exe.

answered Aug 22, 2022 at 13:59

muhammed anseer's user avatar

1

Open Visual Studio Installer, click Modify on the version that’s not working, select the Individual Components tab, untick Intellicode and click Modify (bottom right).

Once it’s finished, go through the same process but tick it this time, restart VS (which you have to do anyway).

answered Jan 12 at 8:54

DavidWainwright's user avatar

DavidWainwrightDavidWainwright

2,8871 gold badge26 silver badges30 bronze badges

Go to location of the project, delete .vs folder and re-build again.

answered Jul 22, 2022 at 8:41

Adeel Ahmed's user avatar

open your terminal and run using shift +`` key in visual studio. Run dotnet run all errors will be shown on terminal

answered Sep 4, 2022 at 18:41

Bob Sarfo's user avatar

I recently updated from Visual Studio 2017 Community Edition to Visual Studio 2019 Community Edition.

Now, if I build my solution with errors, they will show up in the build output, but not all of them will appear in the error list. It would appear only errors of open files will show up in the error list. This is incredibly annoying.

I am not alone in this issue. It has been reported many times on Microsoft’s forums, but no one has a definitive solution.

I have tried a variety of solutions people suggested in those threads:

  • I have ensured the filters are legitimate: Entire Solution, Errors enabled, Build + Intellisense.
  • I have tried deleting the .vs folder and restarting Visual Studio.
  • I just updated to the very latest Visual Studio 2019 version. Supposedly there are many different versions of this error, happening in versions of Visual Studio all the way back to 2017. Some supposedly have been fixed…?
  • I have disabled parallel project loading.

I have experienced this before in other versions of Visual Studio with Razor pages. To my knowledge, that’s to be expected in Razor though.

The only other factor that I severely doubt impacts anything is that it’s a Visual Studio project generated by Unity editor. From what I’ve read, ASP.NET, Razor, Xamarin, and other frameworks have each had their own version of issue reported. Perhaps Unity is afflicted by it too, but I don’t see how or why. I doubt Unity’s auto-generated Visual Studio projects are that different from your standard library projects.

Студворк — интернет-сервис помощи студентам

Я понимаю, что это может показаться бредом, но я у меня глаз начинает дергаться уже. На всех сайтах пишут давайте мол сделаем первый проект и бла бла бла, я установил себе visual studio 2019, создаю проект, копирую текст кода

C++
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <cstdlib> // для system
using namespace std;
 
int main()
{
    cout << "Hello, world!" << endl;
    system("pause"); // Только для тех, у кого MS Visual Studio
    return 0;
}

и у меня вываливается куча ошибок.
Первым выскакивает окно — Возникли ошибки сборки… Продолжить и запустить последний успешно построенный вариант?

Жму Да

Не удается запустить программу (путь к экзешнику)

Не удается найти указанный файл

Жму ОК
И внизу под кодом 17 ошибок, которые ругаются на код…

Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x7» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2018 неизвестный знак «0x1b» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1
Серьезность Код Описание Проект Файл Строка Состояние подавления
Ошибка C2146 синтаксическая ошибка: отсутствие «;» перед идентификатором «щюь» Project4 C:Program Files (x86)Windows Kits10Include10.0.17763.0ucrtstddef.h 1

Это я некоторые скопировал.

Я пробовал в VSCode попробовать, но там тоже ничего не запускается…. Проблема с файло JSON. МОжет какие-то предварительные настройки нужно сделать?

broken building

I’m pretty good at getting Visual Studio projects building correctly – I’m a bit of a Visual Studio whisperer. In one job I could get the ‘flag ship’ application up and running on a new machine in half the time of anyone else – that still meant half a day’s work. Strangely that’s not on my CV.

So here are the steps I go through to get a rogue project building in Visual Studio. These steps range from the basic to the bizarre. They are in the order I would do them and by following them I can pretty much get any Visual Studio project back on track. So put on your tin hat and let’s get that errant Visual Studio solution building.

Sanity Check

Before embarking on a full blown Visual Studio troubleshooting endeavour it’s best just to do a few simple checks.

Have you got latest code?

Everybody has wasted hours trying to get an old version of the code working. I still do it. The developer that sits opposite me still does it. My boss still does it. Don’t do it. Get the latest version of the code from your repository.

Does it build for other people in your team?

Just see if other people are having the same problem. If you have continuous build – check that is still working and running through cleanly. The code might not work for anyone. More illuminating – it might work for some at not others.

Basics

Every few weeks you will probably be faced with a non-building Visual Studio project. Here are some basic steps to help. These will probably be enough.

Clean and rebuild

clean solution

Go to

Solution Explorer -> Right Click -> Select Clean -> Wait -> Select rebuild

Often the bin directories have gone all wonky and are full of junk. Who knows what has happen to them. Clean and rebuild will refresh them and often work when a normal build doesn’t. Standard stuff – but then we are just beginning.

Build each project individually

Often you are faced with mountains of errors which is misleading. It could be one of your low level library projects that is failing to build and causing all other projects to fail. Rebuild each project individually starting with the low level ones that are dependencies for others. Sometimes that’s enough to get the entire solution building. At a minimum, you will better be able to see where the actual issue is and not be swamped by a heap of irrelevant error messages.

Close and reopen Visual Studio

It’s time to restart your Visual Studio. Don’t leave this till the end – it is often the problem. Turn it on and off again – it might help.

As a note – in my experience restarting your computer rarely helps. By all means try it but don’t be surprised when the solution still stubbornly refuses to build.

Manually delete all bin folders

This is really worth a try if you are working with an application with language variants. The language specific resource (e.g. Messages.fr-CH.resx) files compile down into satellite resource files in your bin folder that are contain in their own subfolder e.g.

…binfr-CHMyApplication.resources.dll

Weirdly Visual Studio Clean can leave these satellite assemblies behind. Your application will still build but it can cause changes in languages variants not to shine through.

This might seem like an edge case but this exact thing kept a colleague of mine baffled for 6 hours. It was a very emotional moment when we finally sorted it out. So this is very much worth a try.

Start Visual Studio in admin mode

run as administrator

I’m master of my own machine (i.e. I’m a local admin) and I’ve got my Visual Studio set to always open as an administrator. You might not. Right click and run as administrator.

If it isn’t possible get someone who is an administrator to open Visual Studio on your behalf. Then complain bitterly about not being a local admin or your own machine – you are a developer; you really should be.

Have you got bad references?

bad references

Just check all projects and make sure that the references are all there. Look out for the little yellow triangle. If you have bad references then jump to section below dealing with that.

Check IIS

This isn’t relevant for all projects but if you are building a web project using IIS then it’s worth doing checks around that. Obviously it’s a completely legitimate setup to use IIS Express. In that case this isn’t relevant.

IIS pointing at the wrong folder

This is often a problem when changing branches. Visual Studio normally makes a good job of switching for you but not always. If you are hooked up to the wrong folder then your project will build but you won’t be able to debug it. Also changes that you are convinced you are made won’t shine through. This has driven me crazy before.

IIS explore folder

To check

  1. Open IIS (run -> inetmgr)
  2. Navigate to website
  3. Press explore and confirm you are where you think you should be. You might not be in Kanas anymore.

Permissions on app pool

This won’t manifest itself as a build failure but the project won’t be running as expected particularly when accessing external resources. It might be worth checking what the app pool is running as.

application pool settings

To check

  1. Open IIS (run -> inetmgr)
  2. Application Pool -> select the one for the website
  3. Advanced settings

You can now check the user.

The application pool runs under ApplicationPoolIdentity by default. What I’ve sometimes seen is that it’s been changed to a normal user whose password has expired. This is typically fallout from previous Visual Studio failures echoing through the ages.

Bad references

bad references

If you are noticing a yellow triangle on your project references then Visual Studio can’t find a dependency. Sometimes there is no yellow triangle and all looks fine but it still can’t find the dependencies.

With the advent of nuget this is less of a problem now but it does still happen. There are instances where incorrect use of nuget makes it worse and more baffling.

Check reference properties

Go to the references -> right click -> properties

references properties

There are two things to look for

  1. Is it pointing to where you think it should be? It might not be
  2. Copy Local. Bit of witchcraft but I always set this to copy local. It will copy the dll into the bin folder so at least I can satisfy myself that it has found it and is copying it through OK.

Have you checked in the packages folder – don’t!

Even if you are using nuget your bad reference problem might not be at an end. Checking in the packages folder can cause the references not to be found. This is especially baffling since looking at the reference properties reveals no problems. The path to the required dlls is definitely valid and the dlls are definitely there. But it cannot be found – frustration and finger biting.

To resolve delete the packages folder then remove the folder from source control. Rebuild and all will be well.

Resetting Visual Studio

Resetting Visual Studio can (probably will) cause your environment to lose all your custom defaults – so all your shortcuts, settings perhaps plugins will go. Therefore I’ve left this step towards the end as it is not without consequences. That said it is often the resolution so it’s not a bad idea to do it earlier in the ‘what on earth is going wrong with Visual Studio’ resolution process.

Delete all temporary and cache files

This was a fix that often worked in slightly older versions of Visual Studio. I’m using VS 2015 currently and this often isn’t a problem. Still it is worth clearing out these folders and rebuilding

C:Users{user name}AppDataLocalMicrosoftWebsiteCache

C:Users{user name}AppDataLocalTemp

Delete project setting files

Your user settings for a project are stored in files with the extension *.csproj.user i.e

BookShelf.MVC.csproj.user

It’s worth deleting all those and rebuilding so reset user specific settings. Also if you have these checked into source control then remove them. They are specific to you and shouldn’t be in a shared repository.

Reset Visual Studio on the command line

When Visual Studio appears utterly broken and you are reaching for the uninstall button, this can often help. It takes Visual Studio back to its initial settings you will need to reapply any custom settings that you have.

Close VS then in a command prompt go to the folder that has the Visual Studio.exe (devenv.exe) i.e.

cd C:Program Files (x86)Microsoft Visual Studio {Version code}Common7IDE

For VS 2015 it is

cd C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE

Then

devenv /setup

Reopen visual studio

A similar approach can be used with devenv.exe /Resettings as detailed here.

Reset Visual Studio through file explorer

If the command line doesn’t work then try resetting Visual Studio via the file system. This often works when the command line doesn’t. Try this when Visual Studio is undergoing a profound collapse particularly when it keeps popping up an alert box detailing errors being written here…

C:Users{user name}AppDataRoamingMicrosoftVisualStudio{VS version}ActivityLog.xml

i.e. for Visual Studio 2013

C:UserscodebucketsAppDataRoamingMicrosoftVisualStudio12.0ActivityLog.xml

To resolve for Visual Studio 2013

  1. Close VS
  2. Go to C:UserstbrownAppDataLocalMicrosoftVisualStudio12.0
  3. Rename the folder to C:UserstbrownAppDataLocalMicrosoftVisualStudio12.0.backup
  4. Reopen VS. The folder C:UserstbrownAppDataLocalMicrosoftVisualStudio12.0 will be regenerated.

The process is the same for other versions of Visual Studio except the version number at the end will be different i.e C:UserstbrownAppDataLocalMicrosoftVisualStudio14.0 for VS 2015.

Disable plugins

Leave this one till last because it’s a pain. Go to Tools -> Extensions and plugins. Then disable each plugin you can one by one.

disable plugin box

It’s a pain because even if it is a plugin that causes it, you have a choice of uninstalling and living without it or contacting the vendor. Clearly if you didn’t buy it then the vendor isn’t going to be interested in helping you. I’ve found PostSharp and Resharper the likely culprits here. The Resharper vendor was very helpful. PostSharp weren’t (because we hadn’t bought it!!).

Bizarre Ones

Be careful what you check in

Checking files into source control that you really shouldn’t can cause difficult to diagnose problems. This often happens to me for continuous builds where the user building has fewer privileges than I’m used to. It does happen locally too. The following files shouldn’t be checked in

  • Bin folders
  • Obj folders
  • Autogenerated xml (i.e. documentation generated during build)
  • Packages folder
  • .csproj.user files

If you have checked them in then delete from your disk, remove from source control and rebuild.

Is your file path too long

Windows limits the file path to 260 characters. It could be that you have exceeded this and Visual Studio has started to complain. The awkward thing is that it complains in a very oblique way. The error that you see will be something on the lines of…

“objDebugLongFileName.cs” has an invalid name. The item metadata “%(FullPath)” cannot be applied to the path “objDebugLongFileName.cs “. objDebug\LongFileName.cs           ContainingProject.proj            C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets

So not obvious. Double click the error and it will take you to the Microsoft.Common.CurrentVersions.targets file in the depths of the framework folder. Less than illuminating.

Once you have diagnosed this then the resolution is easy – move your project to a shorter file path. I’ve found this a problem when switching branches which can have longer file paths than the Main branch.

If all else fails

If all else fails uninstall Visual Studio and reinstall. But honestly, I have reached this frustrating point, uninstalled, reinstalled, waited hours and the problem persists. This might not be the cure that you were looking for. Go into a corner and have a good long think before you resort to this one.

So congrats if you have read this far (or commiserations as your Visual Studio install is clearly in a bad way) but hopefully this guide will enable you to have a healthy and happy Visual Studio for years to come.

Useful Links

http://stackoverflow.com/q/1880321/83178
Good stack overflow explanation on why the 260 character filepath limit exists in windows.

https://msdn.microsoft.com/en-us/library/ayds71se.aspx
Official advice from Microsoft about bad references.

http://stackoverflow.com/questions/1247457/difference-between-rebuild-and-clean-build-in-visual-studio
There is a difference between Clean + Build and ReBuild as detailed here.

  • Ошибка при сборке ресурсов win32 формат потока значков отличается от ожидаемого
  • Ошибка при регистрации на госуслугах что делать
  • Ошибка при сборе данных для административные шаблоны
  • Ошибка при сборке развертывании проекта во время выполнения этапа qmake
  • Ошибка при самотестировании телефона обратитесь к поставщику nokia e52