I have a page open writing some code and then out of nowhere after some random time my page reformats and my spaces get turned into tabs. I have to close the file and re-open in order for it to get fixed. Please have a look at the screenshot below.
I am using c# and Visual Studio 2019. I Recently updated to the latest version of visual studio and this is when this started happening. I am now on version 16.11.4. I also installed .NET 5 at the same time so not sure if something there could be messing with visual studio.
Edit: I Think I figured out why the spaces are added. If you look at this new screenshot you will see that it injected the gray lettering where spaces were. I tried clicking around in the empty spaces few times and those gray letters showed up. I Guess the page is having trouble loading all these in until I click on them?
Anyone has any idea why?
I had the same problem when I had Resharper installed, and I upgraded to the latest version of Visual Studio.
Are you using Resharper? If yes, disable it or downgrade Visual Studio to a version compatible with your version of Resharper.
I believe this is caused by your word wrapping preferences and then resizing your window. Go to File - Preferences - Settings and then search for "wrap" and play around with the settings or turn it off.
Starting up a new Unity game project, and using Visual Studio 2019 Community (VS) for my C# development. Unity shows errors in the console window but I find that limiting and inconvenient. I would like to enable all errors, warnings, and suggestions in Visual Studio itself.
I have "Disable the full build of projects" set to false in VS (in the "Tools for Unity" Options tab). I have my error list dropdown set to "Build + Intellisense". Changing any of those flags doesn't seem to do much of anything. I am using Visual Studio 2019 and Unity 2020.2.4f1. I don't see a csproj file or any other project files in VS or Unity or my Windows Explorer. It appears to build because I can play in the Unity editor.
Is it possible to show the errors in VS's Error List window with Unity projects or not? How do I set it up to show errors in VS for Unity projects?
EDIT: One more thing, I am unable to see Intellisense suggestions at all for my project as I write code in VS so it makes coding that much slower and inaccurate.
Found the answer on a different site than StackOverflow and verified it this morning.
In Unity, go to Edit->Preferences->External Tools.
Change the External Script Editor to your instance of Visual Studio.
In the new options below for Generate .csproj files for:, make sure Embedded packages and Local Packages are selected.
Click the button Regenerate project files below and close the Preferences window.
Close Visual Studio.
Double click on any of you scripts in Unity to open up Visual Studio again with your scripts.
You should see your script in Visual Studio opened up with the .csproj files setup for your Unity Project's Solution in the Solution Explorer panel (if you have it open), with the whole project open in Project mode. Go through your Assembly-CSharp solution to see your code (typically within Assets).
Open the Error List panel, and in the drop down, select Build + IntelliSense.
Purposefully make a mistake to see IntelliSense in action producing errors, warnings, and suggestions in the Error List below.
Bonus Step: If you want to granularize the suggestions in the Error List, change your Code Style settings in Visual Studio in Tools->Options->Text Editor->C#->Code Style to change how you wish Visual Studio to prefer to act with your code style. You can look through the C#, C#_LSP, and All Languages to make changes to tabbing, formatting, and so on. Up to you. Remember that Unity 20.2.4f1 supports up to C# 7.3 using the Roslyn compiler (so make code style changes and suggestions as appropriately).
We had this issue and after 4 days testing all the possible solutions we found on the internet we tracked down the problem being that the project's file path had the character "%20", after renaming the folder to a name with only letters and numbers both Visual Studio Community and Rider started working properly.
I'm using Windows 10 ver. 1909. Installer hangs or does nothing. No feedback.
I had exactly this problem. Same version of Windows 10. I tried both vs_community.exe and vs_professional.exe. On a Microsoft Surface Pro 4. The installer launches, a brief unpacking screen appears, that vanishes, and you're left with the task manager showing the installer but no user interface. I tried numerous different suggestions from Googling as well as the Collect.exe tool. None of that helped. Someone had a similar problem that hinted that a display could cause the problem. My Surface had Duet installed, which allows you to use an iPad as a second monitor. Uninstalling that allowed Visual Studio to install normally. Apparently the Visual Studio installer is finicky about displays so if you have any unusual display drivers, or screen sharing utilities, they should be removed to allow installing. I suspect that the driver or utility could be put back after installation.
In my case, the issue was that I have downloaded and launched the installer to a user folder that contains non-English characters. Moving the installer to another folder fixed the issue. I´ve diagnosed the issue by looking into an installer log file in C:\Users<username>\AppData\Local\Temp\dd_vs_professional__143315035.1628536728_decompression_log.txt.
At first you need to download this tool Event Collect for visual studio, open your CMD as administrator,then run Collect.exe , after that you need to run your visual studio installer in the event of an error you will find and file named C:\Users{username}\AppData\Local\Temp\VSSetupEvents.txt that you can check to see the error messages.
For more details you can check documentation .
My case is very embarrassing for Microsoft. I downloaded Visual Studio Setup and started it right away from browser. It was opened and then immediately closed. Nothing I could read on the Internet about this problem was not helping. Then I did one very simple thing. Moved setup from original location: C:\Users(user name)\Downloads, to c:\Temp -> worked like a charm. The thing is that my user name contains international characters (plus containing a space). All in all 21. century, full unicode support everywhere, but not in windows. Really embarrassing.
Visual Studio 2019 Installer doesn't start
I lost time about something I shouldn't have, I couldn't install vscode studio 2019 (I've installed it on multiple machines before).
I don't know exactly why, observed there might be something in my folder blocking it, I just moved it to a new folder and I could install. Good luck and don't make the same mistake as me
Intellisense will still give suggestions, but Visual Studio will not highlight any errors until I click "Start". I can write absolute gibberish and no red squiggles will appear. However, when I do click "Start", the Error List will finally populate and the build will fail. (It will also check errors after I click "ReBuild" or "Clean Solution").
However, when I do edit the errors, the red squiggles will remain. Even when I remove the entire line, a two space long red squiggle will remain. Clicking "Start", "Rebuild", or "Clean Solution" does not make these old error highlights disappear and the Error List does not change. Only closing and restarting VS 2015 Community will clear them. Rebooting the computer did not re-enable the error checking function.
System Details: This is a fresh install of Windows 7 Pro 64bit on a Macbook Pro with Bootcamp. This is the first project I have made since installing VS 2015 Community yesterday. I am writing a Windows Forms app using C#. To the best of my knowledge, it was working fine for a few hours this morning. I have already tried resetting all my settings. I have already tried rebooting and deleting the bin/obj folders in the solution directory.
Has anyone experienced such an issue? Do you think it is an issue with my install, or did my solution get corrupted somehow?
A few things to try that often fix weird Visual Studio problems:
Restart Visual Studio.
Delete the .suo file. This file should be right beside the .sln file, and is a temp file used for tracking things like which files/tabs you had open in the editor between sessions
Clear out some temp VS cache files.
Another thing you can try is running VS in safe mode to run with all extensions disabled. This may at least hint if the problem is native to VS, or if it's one of your installed extensions that is the problem.
Creating a new Project caused the error checking functionality to come back. I didn't even type any new code, I only made a new, blank project and everything started working again.
I have no idea why, but if someone else encounters this issue, make a new Visual Studio project and try re-loading your old one afterwards.
Somehow part of my syntax highlighting for C# code has disappeared in the VS 2012 IDE. Uninstalling, rebooting, and reinstalling does nothing, nor does resetting the colors in the options dialog.
Here are some examples of items which all appear in default (black) that normally have color which don't:
Attributes
System classes
My own classes
And here are some keywords that still have color:
using
public
void
var
for
Has anyone else experienced this and managed to fix it?
Here is a simple solution. Go to the directory where devenv is (for 2012 RC), and type devenv.exe /setup. It will fix your problem.
devenv.exe is usually in something like C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE.
Edit: It has been suggested that you do this from the Visual Studio command prompt (Start>Microsoft Visual Studio>Tools>Visual Studio Command Prompt), and/or make sure your command prompt has administrator permissions.
Note for others: This has a very good chance of working for many other versions of Visual Studio, including 2008, 2010, 11 beta, ...
My problem was limited to having the "DateTime" type not showing up in light blue like other class names. I fixed it by simply switching back-and-forth between VS Themes. Discovered by accident. Much quicker than reset settings or repair install...
VS menu Tools -> Change Color Theme
This is what worked for me:
1 - delete all in C:\Users\userNAme\AppData\Roaming\Microsoft\VisualStudio\11.0
2 - open vs console as administrator, and run:
devenv.exe /setup
devenv.exe /ResetSettings
This will reset all your environment settings.
If none of the above work for you, delete all GUID-named folders under this registry key (make sure your Visual Studio instance is closed):
If you're using Visual Studio 2012:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\FontAndColors
If you're using Visual Studio 2013:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors
If you're using Visual Studio 2015:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\FontAndColors
Restart Visual Studio, and you should see a few various "User Types" to configure. You can then import your Fonts and Colors that you backed-up, and everything will be good to go. This may also work for previous and future versions of VS, but I have not tested.
Disclaimer: Make sure you export/backup your current Fonts and Colors settings before making these registry adjustments. I cannot be held responsible for you losing your configs :)
If you still have this issue try ResetSettings (worked for me)
NOTE: this will reset the Visual Studio 2012 settings :)
1) close vs.
2)open cmd (as administrator).
3) go to devnev.exe folder (something like "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE" ).
4) type "devnev.exe /ResetSettings"
5) open vs and look at the beautiful colors
Found the source of the problem:
If you have the "Productivity Power Tools 2012" installed,
you should go to Tools -> Options -> Productivity Power Tools
and turn off the "Colorized Parameter Help" option.
This fixed the syntax highlight problem.
If anybody runs in to the same problem for Visual Studio 2013 as I did, the only solution that worked for me was to first close VS2013 and then delete the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors
After reopening VS2013, my syntax highlighting for types was restored.
Prior to deleting the registry key, I noticed that all of the "User Types..." settings in the Fonts and Colors section of Tools > Options were missing. Deleting the registry key restored them. They attained their default values which gave me the syntax highlighting colors I was looking for.
This was the only solution that worked for me. Switching themes, resetting my personalized settings to defaults, running devenv.exe with various command line switches to setup/reset Visual Studio did not work.
I also created the following bug report with Microsoft on their Connect site:
http://connect.microsoft.com/VisualStudio/feedback/details/810985/incorrect-syntax-highlighting-for-c-types.
For me "Productivity Power Tools 2012" was the cause. Nothing suggested here helped. After removing the Power Tools the colors came back.
I did all the things listed here and still nothing (VS2013 Update 3). I tried /setup, /resetsettings, deleting the stuff in AppData, deleting the registry keys. Still, User Types wouldn't be highlighted even in the default color scheme.
What helped in the end was opening the Fonts and Colors dialog, selecting Identifier, and making it Bold. Then removing the Bold. Instant fixage!
I had the same issue....just uninstalling and re-installing alone did not correct the problem. After I un-installed, deleted all remnants of VS 2012 in program files, removed all related registry keys, and deleted the VS 2012 folder from My Documents, then re-installed, user types showed up in the display items in fonts and colors and everything went back to normal. My guess is that it was an issue with one or more of the registry keys but I can't be sure of that.
exit devenv
go to below path
hkey_current_user\software\microsoft\visualstudio!
remove 9.0 , 10.0 , 10.0_config (i mean to say all other folders except 11.0 and 11.0_config)
Now start devenv and see the magical colors get back normal
1 - delete all in C:\Users\userNAme\AppData\Roaming\Microsoft\VisualStudio\11.0
2 - open vs console as administrator, and run:
devenv.exe /setup
devenv.exe /ResetSettings1 - delete all in C:\Users\userNAme\AppData\Roaming\Microsoft\VisualStudio\11.0
2 - open vs console as administrator, and run:
devenv.exe /setup
devenv.exe /ResetSettings
This is what helped me...
delete all in C:\Users\userNAme\AppData\Roaming\Microsoft\VisualStudio\11.0
open vs console as administrator, and run:
devenv.exe /setup
devenv.exe /ResetSettings
This solution worked for me. Thanks alot Gaz Winter
If you've installed the preview of Roslyn, unintstall it. This worked for me.
After trying several of the solutions listed here, I eventually found that my issue was caused by a very large (488000+ characters) string variable. Highlighting was working up to that line, but not after it. Once I reduced the length of the string, highlighting in the rest of the file resumed working normally.
I already had VS 2012 Pro installed on my machine. I then installed VS 2013 Pro and started facing this color issue. I then deleted the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors key and opened VS 2013. This approach solved my issue and the colors were back.
If the windows desktop is configured with a high contrast theme the syntax coloring seems to disappear completely from Visual Studio. If this is the case, select a normal windows theme and set a solid background color (if you don't want a background pictures) to restore syntax coloring in VS.
Problem : Class name and Syntax showing in black color
Solutation:
Step 1: Remove Key :
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\FontAndColors
Step 2: Remove folder :
C:\Users\UserName\AppData\Roaming\Microsoft\VisualStudio\12.0
Step 3: Open command prompt (admin mode) and run below command line :
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>devenv.exe /setup
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>devenv.exe /ResetSettings
It work for download this "Productivity Power Tools 2012" and install, after install this tool get this steps go to Tools -> Options -> Productivity Power Tools and turn off the "Colorized Parameter Help" option.
This fixed the keyword as syntax ActionResult is not set for default black color and highlight problem resolved.