0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
1 |
|
02.12.2018, 16:45. Показов 5739. Ответов 10
Скачал и установил Visual Studio, и решил значит, проверить как он работает. Я написал обычный Hello world но не могу никак его скомпилировать, выдается ошибка: Visual Studio обнаружена непредвиденная ошибка. Как ее исправить?
0 |
112 / 91 / 31 Регистрация: 24.10.2018 Сообщений: 336 |
|
02.12.2018, 16:54 |
2 |
У тебя в солюшне отсутствует какой-либо проект. Это нонсенс. Пересоздай решение по-нормальному с проектом, или добавь в существующее решение проект. И хватит давать файлам имена с пробелами, это жуть.
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
02.12.2018, 17:03 [ТС] |
3 |
какой еще солюшник? Что это? И что плохого в именах с пробелами? Так читабельнее Добавлено через 7 минут
0 |
112 / 91 / 31 Регистрация: 24.10.2018 Сообщений: 336 |
|
02.12.2018, 17:07 |
4 |
Написано же что «проектов: 0» в решении. Сорец, который ты редактируешь вообще никак не связан с открытым решением.
какой еще солюшник? По-русски — это идиотское слово «решение». Добавлено через 14 секунд
И что плохого в именах с пробелами? В них плохо — все.
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
02.12.2018, 17:13 [ТС] |
5 |
Ладно, с этим разобрался, но есть еще вопросы. Что за #include «pch.h» ? раньше я такого не видел.
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
02.12.2018, 17:35 [ТС] |
6 |
Теперь и компилятор исчез
0 |
112 / 91 / 31 Регистрация: 24.10.2018 Сообщений: 336 |
|
02.12.2018, 17:44 |
7 |
Ладно, с этим разобрался, но есть еще вопросы. Что за #include «pch.h» ? Это pre-compiled headers заголовок. Это отличный пример минуса использования IDE для обучения программированию. Так как вместо просто обучения в банальном редакторе с компилятором, внимание на себя обращает всякий мусор добавляемый IDE. Забей на этот инклуд.
И еще cout:необъявленный идентификатор — что? но я же написал #include <iostream>! Почитай про namespace’ы. В частности про std. Добавлено через 29 секунд
Теперь и компилятор исчез Не вижу ничего исчезнувшего.
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
02.12.2018, 17:52 [ТС] |
8 |
Исчезла кнопка «Компилировать». Using namespace писал, не помогало, сейчас работает, странно… А как в командную строку то вывести?
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
02.12.2018, 18:00 [ТС] |
9 |
Я про это говорил, когда сказал что исчезло.
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
03.12.2018, 11:08 [ТС] |
10 |
Почему в командную строку не выводит?
0 |
0 / 0 / 1 Регистрация: 05.04.2016 Сообщений: 134 |
|
03.12.2018, 11:30 [ТС] |
11 |
0 |
- Remove From My Forums
-
Question
-
I have enabled the Error List at the bottom of my visual studio 2010, and when I build my project, it tells me build failed, however the error list does not produce any errors?
Is this a settings? Has my project become corrupt? Someone help!
Answers
-
I found what was causing the issue. I looked at my output window when I was building and it displayed the issue.
-
Marked as answer by
IndigoMontoya
Wednesday, May 8, 2013 1:21 PM
-
Marked as answer by
All replies
-
Try deleting the bin folder in the prject which will force all the code to get recompiled. this normally works. don’t worry VS will recreate the bin folder when it doesn’t exist.
jdweng
-
Deleting the bin folder, did not correct my issue. I am still getting the build failed message, but nothing is showing in the error list.
-
I found what was causing the issue. I looked at my output window when I was building and it displayed the issue.
-
Marked as answer by
IndigoMontoya
Wednesday, May 8, 2013 1:21 PM
-
Marked as answer by
-
I get the same error, and my output windows shows the following message:
1>—— Rebuild All started: Project: DataLayer, Configuration: Debug Any CPU ——
2>—— Rebuild All started: Project: ManualTester, Configuration: Debug Any CPU ——
========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ==========What is this issue? I need to close VS and reopen it. Then it works for a while and without any reason it locks again.
-
Found my solution here:
https://github.com/versionone/VersionOne.Client.VisualStudio/issues/10
-
Thanks.. it worked for me.
-
I have the same issue, but in my case nothing is displayed in the output window. It is really annoying.
I found in another post that it should work after deleting the «.suo» files associated to the project. I searched for them in the project files and found nothing! I thought they were all refering to an older VS version. However I now realise that
by default, hidden files are not displayed in Windows 8. So that option should be tourned on first from the control panel.After all that mess, it should work.
-
Edited by
GuilleHaze
Thursday, August 20, 2015 7:22 AM
-
Edited by
-
I just dealt with a similar problem. If all else fails, you can always use the MSBuild.exe in command prompt to build a projects.
- Open «Developer Command Prompt» for your version of Visual Studio. In the case of VS 2013, it is located here (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts)
- In the command prompt. type «MSBuild.exe C:\Path\ToYourProject /verbosity:d»
For more information regarding MSBuild.exe, search MSDN
Also if you want to pipe the output to a text file to view the output easier.
«MSBuild.exe C:\Path\ToYourProject /verbosity:d > C:\buildOutput.txt»
-
Sometimes you should check if you have an external reference which targets .Net version higher than your project.
Raise your .Net Version and should solve the problem.
-
Proposed as answer by
cmreynol
Tuesday, April 18, 2017 6:09 PM -
Unproposed as answer by
cmreynol
Tuesday, April 18, 2017 6:09 PM -
Proposed as answer by
Morrisgrill
Friday, October 20, 2017 9:40 PM
-
Proposed as answer by
-
i has same error as you, so i try different way to fix this problem, but still has not solve this problem. Finally, I had to uninstall vs and reinstall visual Studio.
=> this is solution when i rebuild give result success.
thanks and best regards!
-
Simple.
1. Delete «bin» directory
2. Restart computer
My Experience Explanation: This usually occurs when you install a library and some cached temp files are properly removed or remain in memory thus creating a strange situation like so.
-
I just encountered the same problem — and the fix for me was so trivial, that I created this account so share my experience:
Before you start editing in your registry, deleting the bin folder and so on:
restart your machine. -
Hi All,
If none of the above work. You can try to relaunch VS. That worked for me.
-
This is often an issue of framework mismatch, especially when you’ve added references to new projects within a solution. Check the project properties page of your reference(s) and make sure they are targeting a version of the framework that is not
greater than the referencing project.
Brent
-
Following jdweng’s suggestion I introduced a compile error in the project MyLibrary, deleted MyLibrary’s bin folder, then compiled. I did see some errors in the Error List window, but these were all saying «Metadata file ‘MyLibrary.dll’ could
not be found». The actual compile error I had introduced was still not displayed in the Error List.However, after restarting Visual Studio, the Error List started reporting the compile error.
-
Edited by
OutstandingBill
Sunday, May 14, 2017 11:40 PM
found an answer
-
Edited by
-
Found my solution here:
https://github.com/versionone/VersionOne.Client.VisualStudio/issues/10
This workwed for me too. I have VS2017 (v15) and PendingDeletions were in v14 nodes in the registry. Deleting all worked, although I don’t really understand the underlaying reason…it all started with some NuGet reinstall due to target framework change.
-
I has the same error. I tryed build in MSVC2010 and here was error showed-missed one file from installer applications directory in source place….. But this error was not showed in MSVC2017, only Build failed…. I love advance!
-
Through this answer,
found out that I was missing a reference dll in the execution folder (bin). -
I’ve just had this, in my case it was due to following VS’s recommendation to inline a variable declaration. Eg initially I had:
int myVarInt; int myVarString = "1"; bool isValidInteger = int.TryParse(myVarString, out myVarInt);
When following the VS recommendation to inline the declaration, I ended up with the following…. and the elusive «Build failed» without any errors issue.
int myVarString = "1"; bool isValidInteger = int.TryParse(myVarString, out int myVarInt);
I assume this comes down to a similar «framework mismatch» error as others mention above, but figured it’s worth mentioning this specific example
-
Edited by
Audigex
Tuesday, February 19, 2019 3:06 PM -
Proposed as answer by
Code Mirror
Tuesday, May 7, 2019 10:05 AM -
Unproposed as answer by
Code Mirror
Tuesday, May 7, 2019 10:05 AM
-
Edited by
-
The solution:
Because Prerequisites not set for debug set only for release
01-Change solution configuration ( in main screen )
set (debug to release)
set solution platform to (Any CPU)
02-Set Prerequisites for debug ( If you want to continue in debug mode )
03-set target platform version same for all Projects-
Edited by
AlFailakawi
Tuesday, June 16, 2020 5:49 PM
-
Edited by
В интернете ничего толкового не нашел.
задан 17 дек 2017 в 9:36
8
Согласно данным на сайте Microsoft, эта ошибка связана с неправильным обновлением (или отсутствием обновления) системы.
Эта проблема возникает потому, что номер версии файла Mspdb110.dll не был правильно обновлен на момент последнего обновления.
Чтобы исправить ошибку, необходимо осуществить процесс обновления.
Чтобы загрузить это обновление Windows Embedded Compact 2013 ежемесячно, перейдите к Microsoft OEM Online или MyOEM.
После успешной загрузки и установки все должно заработать. Удачи!
Источник: https://support.microsoft.com/
ответ дан 17 дек 2017 в 16:19
Даниил ЧижевскийДаниил Чижевский
2,3073 золотых знака13 серебряных знаков39 бронзовых знаков
MS Visual Studio — это интегрированная среда разработки (IDE), используемая для создания приложений на языке программирования C++ и других языках. Однако, иногда при компиляции кода в MS Visual Studio возникают ошибки. В этой статье мы разберем основные причины таких ошибок и возможные пути их решения.
Причины ошибок при компиляции кода в MS Visual Studio
Синтаксические ошибки
Одна из основных причин ошибок при компиляции кода в MS Visual Studio — это синтаксические ошибки. Они возникают, когда в коде допущены ошибки синтаксиса, например, неправильно объявлены переменные или функции. В этом случае компилятор не может правильно интерпретировать код и сообщает об ошибке.
Ошибки логики программы
Другая причина ошибок при компиляции кода — это ошибки логики программы. Они возникают, когда в коде допущены ошибки в логике, например, не правильно рассчитан результат вычислений. В этом случае, компилятор может успешно скомпилировать код, но программа будет работать неправильно.
Ошибки компилятора
Иногда ошибки при компиляции кода могут возникать из-за ошибок в самом компиляторе. В этом случае, необходимо обновить компилятор до последней версии или установить патч, который исправит эту ошибку.
Решения ошибок при компиляции кода в MS Visual Studio
Исправление синтаксических ошибок
Синтаксические ошибки можно исправить путем внимательного анализа кода и поиска ошибок в нем. Однако, MS Visual Studio может самостоятельно подсказывать, где находится ошибка, если запустить компиляцию. В этом случае, необходимо щелкнуть на сообщение об ошибке, которое появится в списке ошибок, и исправить ошибку в коде.
Исправление ошибок логики программы
Ошибки логики программы можно исправить путем тщательного анализа кода и поиска ошибок в логике программы. В этом случае, необходимо пройти по коду поэтапно и убедиться, что все переменные правильно инициализированы и все вычисления выполняются правильно.
Установка патча или обновление компилятора
Если ошибка при компиляции кода возникла из-за ошибок в самом компиляторе, необходимо обновить компилятор до последней версии или установить патч, который исправит эту ошибку. Обновление компилятора можно выполнить через меню «Справка» -> «О программе» -> «Обновления Visual Studio».
Заключение
Ошибки при компиляции кода в MS Visual Studio могут возникать по разным причинам, от синтаксических ошибок до ошибок компилятора. Однако, большинство ошибок можно исправить путем тщательного анализа кода и поиска ошибок в нем. В случае ошибок компилятора, необходимо обновить компилятор до последней версии или установить патч, который исправит эту ошибку.
Problem Statement
When you are in between writing your logic and by mistake you press F5, what will happen? Boom… you will end up with the below dialog due to compilation errors:
Background
Now, think about it. If we are writing code, it means we need that to be executed whenever we are running the application. Isn’t it? It’s a very very rare case when someone still would like to execute previous logic, at least for me. I never ever want this to happen.
Solution
So, how to get rid of this rarely used, or better to say unused dialog? This can be done in 2 ways.
- Simply, check the checkbox ‘Do not show this dialog again’. But for me, on one of my machines, this checkbox has not even appeared. Hence, I opted for the second option.
- Go to Tools >> Options… >> Projects and Solutions >> Build and Run. On the right-hand side panel, just change the value in dropdown displayed under ‘On Run, when build or deployment errors occur:’ to ‘Do not Launch’ and we are done.
Now, going forward, you will never see that dialog until and unless the build is successful. Hope you like this small trick.