views:

32

answers:

2

When debugging into the .NET framework using Visual Studio 2008 Professional, the source files appear corrupted somehow, and the yellow debug line doens't hit the correct lines in the source. For example, a source file might start like this:

// Copyright (c) Microsoft Corporation. All rights reserved.

namespace System.Web.Mvc { 
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Globalization;

Any ideas?

This is really annoying and I haven't been able to find a solution on Google.

+1  A: 

IT looks like you hade an Unicode (UTF-16) encoded file that was opened as UTF-8 or ANSI.

Try to save your source file as UTF8.

Yann Schwartz
OK, thanks for the unicode observation, but this isn't my OWN source file, it is loaded from Microsoft servers.
JacobE
Ok, so it's likely to be a problem in the way it's encoded. Is there a way you can look at the http headers when the source is downloaded from MS? There's maybe a mixup in the way the files are encoded.
Yann Schwartz
+1  A: 

It looks like the tool that Microsoft used to add the copyright header wasn't Unicode friendly.

The bad characters are the UTF-8 form of the Byte Order Mark (BOM, 0xFEFF) that (if it appears) should be at the start of file.

devstuff
Yes your scenario is more likely than mine.
Yann Schwartz