Visual Studio 2005 - strange characters rendered for ANSI text - visual-studio-2005

Has anyone seen this odd text rendering issue in VS2005 before?
image http://tinyurl.com/3y2ebze
The first line of using statements actually says "using System;". If I copy the line as it is displayed and paste into notepad, the text appears correctly, so clearly the character codes are correct. In addition, the solution compiles and runs correctly.
I was thinking it might be due to ClearCase using a different character encoding as all the solutions we're using were freshly checked-out yesterday on to a new build machine, but this is only happening in 2 of our ~30 solutions.
Incidentally the same .cs files when opened in VS2008 render correctly on this machine, could this be a corruption in VS2005?

Install latest service pack to VS2005.

Related

Blazor Intellisense in .razor file stops working after publishing

I have a Blazor application using Visual Studio 2019 version 16.10.4. Every time I publish to an IIS server using the Publish... command from the Solution Explorer, Intellisense stops working in the .razor file that I have open and all text coloring goes away, so that all the text becomes the same color (and all auto-indentation stops working). If I close the .razor file and reopen it, Intellisense and colors start working again.
Is that a known issue, or is it a problem that I can fix? I've seen other posts about Intellisense not working in Blazor, but those all seem to be older posts with older minor version numbers of Visual Studio, and they don't mention the problem occurring only when publishing.
This kind of thing happens all the time. The solution is to jiggle it a little bit: close and re-open the file, restart VS, delete bin files, etc. etc.
In Blazor, there are a couple other common culprits. EventCallback with a declared Type often complains that it can't covert the type, even though if you ignore it, it will still compile and run.
It appears a fix is coming for this. As much as it's a frustrating issue, at least it will be resolved soon.
https://github.com/dotnet/razor-tooling/issues/5103

Unexpected pinned projects in Visual Studio

I am running Visual Studio 2017 on my laptop. I usually work on several different projects/solutions everyday, and there are one project and one solution "pinned" on the MRU list of start screen and file list (the Explorer one).
The problem is, they are both quite old (~2 months since last opened), and I have never pinned them. They just stuck there. So now when I open Visual Studio, the third item is actually the real most recently used one.
I tried to remove the two entries from start screen and file list, they would just automatically pop up the next time I launch Visual Studio. I also tried to stop synchronizing settings via cloud, but it does not help (so it seems like a local issue). I cannot stand it anymore. I did not encounter this problem in previous versions.
What is the possible cause? Is this a bug that I should report to Microsoft (well, it may be recognized as an unimportant one though)? And how can it be solved?
I've encountered the same issue under VS2017 and after few attempts I figured out a solution that may fix your problem.
First of all, after having closed all VS instances, delete the hex keys in your system registry that contains the path of your undesired projects.
In order to do that I've exported all the keys in a backup file, then searched for the occurences with a text editor.
Just for reference, in my case the path was:
Computer\HKEY_USERS\S-1-5-21-2840329424-3192507804-1387616012-2346\Software\Microsoft\Windows\CurrentVersion\Search\RecentApps{0D6B9660-F302-4C2A-82E4-FF89D03814E0}\RecentItems{AC7C50DF-34F3-4DA3-A6ED-45A6CF489220}
Then you have to remove from "ApplicationPrivateSettings.xml" file, the occurences of your projects that you want to remove.
The file is located here:
C:\Users{Username}\AppData\Local\Microsoft\VisualStudio\15.0_0dae6c36
At last, update your visual studio to the latest version with all those tricks done. You shouldn't see all your annoying projects anymore.

Visual Studio 2013 Update 2 - code files corrupt randomly

This has been happening to me and others on my team, maybe once a week. We'll be debugging a web application project and then edit and save a text file that is part of the site (like a .aspx or .css files). The file will initially be fine in visual studio and look normal, but the output to the browser will be garbage. It's hard to know what's going on until you close the file in visual studio and try to re-open it. Visual studio will open the file in notepad for some reason, and you'll see all garbage characters.
To fix the problem I have to revert the file from TFS and any work not in TFS is lost.
We have Resharper 8.2.1 and the latest Telerik UI for Asp.net Ajax controls installed. Everything else is pretty standard setup for Visual Studio.
The web application project is set to use IIS Express.
Does anyone else ever have this problem, and know what might be causing it?
Edit: This just happened again, but this time with a class library project. So it doesn't seem to be exclusively a problem with web application projects.
In my case the problem had to do with the encryption software that is installed on my Dell laptop - "CREDANT Mobile Guardian Shield". If you have administrative access to this, then you can add exceptions so that it doesn't encrypt your project / solutions folders.
I don't have access to modify the exception list, so what I did was look through the exception list and found a path listed that looked suitable for placing files I work with. In my case I chose "C:\sources\". I reinstalled all of my tooling into c:\sources\apps\, and use c:\sources\projects\ for all my solution files / TFS workspaces. My apps run faster now because there's no encryption overhead, and I haven't had the file corruption problem since doing this about 2 months ago.
Notepad is believing that the text file is Unicode but it is ANSI. Change the file encoding to Unicode.

What does 'inconsistent line ending' mean in Visual Studio 2010?

What does 'inconsistent line ending' mean in Visual Studio 2010?
I also see this error in a dialog when I'm coding in VS2010. How can I stop this error from showing in the dialog?
Windows, Unix, and older Mac OSs use different line endings. (Newer MacOS uses the Unix convention).
Windows uses CR/LF, Unix uses only LF.
Visual Studio is telling you it found messed up line endings on your file, indicating it was probably edited on different operating systems, and has fixed them all for you to be consistent. If you're getting that message more than once per file, then you have to stop whatever is causing the line endings to get borked in the first place, which is most likely not Visual Studio but some other editor.
Billy and Sean has already described the cause of the problem, however one potential fix is to set up your version control system to enforce the correct line endings for .h and .cpp files. For instance if you're using Subversion then this is a matter of setting the svn:eol-style property to native. You can also do File -> Advanced Save Options to force the EOL style for each file you have problems with.
Microsoft's response from http://connect.microsoft.com/VisualStudio/feedback/details/538108/inconsistent-line-endings-dialogue-in-ide:
What that usually means is that you have lines ending with something other than a carriage return/line feed pair. It often happens when you copy and paste from a web page into the code editor.
Since you're developing in Visual Studio, you'll obviously want to choose "Windows" from the drop down.

how to change source file encoding in csharp project (visual studio / msbuild machine)?

Is there a way to force VS to use Unicode always, instead of weird ISO-something?
I'm working on a winapp csproject using Visual Studio 2008 on Vista (Polish locale). The problem appears when I build the project on Win Server 2003 (English locale) - then Polish diacritic is gone.
I investigated that the issue is caused by improper source file encoding. It looks that source files aren't using UTF-8 encoding.
Problem: Compiler launched from command line cannot process the source file because of international characters that I’ve just added.
Solution: Save source file explicitly in UTF-8 encoding to preserve international characters.
How To:
open the problematic file in Visual Studio.
on the File menu click “Advanced Save Options“
from “Encoding” combo select “Unicode (UTF-8 …“
click OK.
You’re set. Commit to please the build server and rest of the team waiting for green.
In the latest Visual Studio 2017 the interface is changed a bit and you have to chose File -> Save [filename] As…. Then in the opened dialog you can chose Save with Encoding….
I've had the same problems with VS2015 vb.net project and solved it by adding <CodePage>1250</CodePage> marker to your vbproj/csproj file. I did it after <SchemaVersion> marker, rebuilt the project and it worked for me. I've had trouble with polish letters such as ż,ą etc.
You can also try the UTF-8 - 65001 but I didn't check if it works.

Resources