473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Corrupt C# source file?

I have a problem with one of the classes in my project; when I step through
the code the IDE appears to be stepping through lines that do not "exist"
such as blank lines and random lines within comment blocks!

I fixed the problem by pasting the code into Notepad, deleting the class and
recreating it.

Has anyone seen this happen before? Is it a symptom of something serious
going on?
Nov 15 '05 #1
3 1956
Ed,

It's most likely an outdated .pdb (Program DataBase) file is being used.
First, remove all produced binaries and rebuild the whole solution. Second,
if you deploy the resultant assembly to GAC/web server/etc., be sure to
deploy the up-to-date PDB file as well.

The reason is that PDB contains mapping between the compiled IL and the
lines of source code that correspond to that IL. When the lines stored in
PDB do not match actual source code lines, you see strange things happening
like stepping into comment blocks.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ed Crowley" <cu******@pacbell.net> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
I have a problem with one of the classes in my project; when I step through the code the IDE appears to be stepping through lines that do not "exist"
such as blank lines and random lines within comment blocks!

I fixed the problem by pasting the code into Notepad, deleting the class and recreating it.

Has anyone seen this happen before? Is it a symptom of something serious
going on?


Nov 15 '05 #2
For what is it worth, you will also see a similar behavior if you edit your
code in the midst of debugging (stepping through) the code and then choose
to resume excution rather than restarting. In that case, all you need to do
is stop and restart your application.
--Ken

"Ed Crowley" <cu******@pacbell.net> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
I have a problem with one of the classes in my project; when I step through the code the IDE appears to be stepping through lines that do not "exist"
such as blank lines and random lines within comment blocks!

I fixed the problem by pasting the code into Notepad, deleting the class and recreating it.

Has anyone seen this happen before? Is it a symptom of something serious
going on?

Nov 15 '05 #3
I've had this happen to me frequently in the past. It happened when I would
check an assembly into sourcesafe that was once a part of my solution (not
anymore) and then someone would change it and I would end up with their
changed version. Debuggin, I would get "phantom" breakpoints and such. The
solution to the problem was simple: uncheck the read-only flag on the
assembly in question -- problem solved. Not sure why that happened or what
it really was. But unchecking the readonly flag solved it in those cases.
Perhaps not every case is this, but in our case it was.
Thanks,
Shawn

"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:eQ**************@TK2MSFTNGP10.phx.gbl...
Ed,

It's most likely an outdated .pdb (Program DataBase) file is being used.
First, remove all produced binaries and rebuild the whole solution. Second, if you deploy the resultant assembly to GAC/web server/etc., be sure to
deploy the up-to-date PDB file as well.

The reason is that PDB contains mapping between the compiled IL and the
lines of source code that correspond to that IL. When the lines stored in
PDB do not match actual source code lines, you see strange things happening like stepping into comment blocks.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ed Crowley" <cu******@pacbell.net> wrote in message
news:OK**************@tk2msftngp13.phx.gbl...
I have a problem with one of the classes in my project; when I step

through
the code the IDE appears to be stepping through lines that do not "exist" such as blank lines and random lines within comment blocks!

I fixed the problem by pasting the code into Notepad, deleting the class

and
recreating it.

Has anyone seen this happen before? Is it a symptom of something serious going on?

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hal Vaughan | last post by:
I am writing out archive files using ZipOutputStream with the following code: aEntry is a global Array of ZipEntries llData is a LinkedList of the data corresponding to the the ZipEntry of the...
5
by: Vinay | last post by:
Hi I have a corrupt word file. I am able to open it with the code given below tr Dim pInfo As System.Diagnostics.ProcessStartInfo = New System.Diagnostics.ProcessStartInfo( pInfo.UseShellExecute...
4
by: SS | last post by:
We built an MSI file to deploy a .net app to the workstation. We created an HTML page that has a link to the MSI file. On a very sporadic basis, when the MSI is run we get the following message:...
4
by: nepdae | last post by:
Well, after reading and hunting all over the web, including here, I still haven't been successful in my attempts to resolve my situation. So, I thought maybe I'd just ask. Here's the situation: ...
17
by: shineofleo | last post by:
Here is the situation: I wrote a VB programm, which stores all the information in a single Access database file using jet engine. It worked well, however one of my customs reported that there was...
0
by: Fredo | last post by:
I have an app that I'm writing to manage jpgs. Sometimes the photos are corrupt. If I use something like ACDSee, it will show the image, but it will have a note in the status bar that the image is...
3
by: rdemyan via AccessMonster.com | last post by:
One of my users had a corrupt front end that wouldn't open. My app is launched using a launching application (logon app). The logon app has a button for downloading a "fresh" copy of the front...
13
by: Owen Jenkins | last post by:
Following on from an earlier post... I can reliably corrupt a record by doing the following ... Open two separate but identical front ends on one PC each linking to the same back end. Edit a...
2
by: Sven | last post by:
Hello, I have a crashing application and tried to find out what is going wrong. So I run this application with the gdb debugger. I found the position of the crash in a function which searches...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.