OK semi new, so you may not think my brilliant discovery is oh so brilliant.. But the reprocussions knocked me dead.

I found to make code more readable, I can sub class things.

So I had in different class files (for readability)
File # 1 had...

namespace MyLibrary
{
   public partial class  Dates
   {
      public class  Payroll
      {
       }
   }
}

file # 2 had...

namespace MyLibrary
{
   public partial class  Dates
   {
      public class  General
      {
       }
   }
}

Now I can call MyLibrary.Dates.Payroll and MyLibrary.Dates.General

This all compiled well in the library and the calling programs.

But when I went to debug and step into the Library code I got this

"There is no Sourcecode availabe for the current Location. Show disassembly.. (Disassembly may make sense to some Geeks, but not me..)..

So was it the second Class level or the Partial? I found out it was the Partial when I changed the code to this, and was given back priveledge to step into it.

(One file)

namespace MyLibrary
{
   public class  Dates
   {
      public class  Payroll
      {
       }
       public class  General
      {
       }
   }
}

I still can call MyLibrary.Dates.Payroll and MyLibrary.Dates.General same as before but although in this simple example the second code looks more readable, you have to shove in all the muck inside each class (And add several other Date Related classes) and really it is a very long hard to interpret file..

So can anyone tell me how I can get Partial classes sourcecode to be readable in the debugger??? Also can anyone explain why Partial makes the sourcecode unavailable?

Yes it is a dll, added through a reference.

The way to get to the library code is as follows.

First you can put a break in the project code just before the library is called. then step into the code in the library.. This opens a code window in the project form with the entire library file that has the called method in it. At that time you have free reign of the library code while in your project. (Partially good & Partially bad in my opinion.) Good because you can set breaks in the library code anywhere you wish, and it will stop directly into the library code, and you can use any and all functions that the debugger gives you directly in the library.

Bad, because alot of times I have the library project open & the main project open. I make changes to the library code, hit the build on the library project, then the main project and the main project picks up the changes. Sometimes though with the library code window open in both projects I have mistakenly made changes in the main project to the library. after saving it, the next time I move the focus to the library, I will get the message "This file has been modified outside of the source editor do you want to reload it." if you say yes the code changes you made in the main program do come over, so does work, but it gets confusing and sometimes I have lost the code changes.

I know you can add a project to the library code and set that to be the starting project. But that only seems to work with window forms and not web forms.. We are basically using our libraries to build web forms.

I hope I interpreted you question correctly.

This article has been dead for over six months. Start a new discussion instead.