I can tell you in .NET 2.0 you can easily see when it happens... setup
your debugger with the instructions here
http://codebetter.com/blogs/gregyoung/archive/2006/06/09/146298.aspx.
This will allow you to run optimized code with the debugger. Set a
break on your static construction .. run in debug and release mode.

in debug mode it will happen how you want it to happen. In release
mode it will happen when the assembly is loaded.

He says "it could" because the spec does not define a particular point
of it occurring only that it could happen.

Cheers,

Greg

On 7/25/06, Brad Wilson <[EMAIL PROTECTED]> wrote:
It's interesting that he says that it COULD happen, but not that it actually
DOES happen. It's not clear under what circumstances he thinks the runtime
would end up being more eager than writing an explicit .cctor.

On 7/24/06, gregory young <[EMAIL PROTECTED]> wrote:
>
> It depends on how you define you static construction ...
>

--
Brad Wilson
http://www.agileprogrammer.com/dotnetguy/

"Constraints are liberating."
  - David Heinemeier Hansson (author of Ruby on Rails)

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



--
If knowledge can create problems, it is not through ignorance that we
can solve them.

Isaac Asimov

Reply via email to