473,493 Members | 2,229 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Event on Module Load:

Hi,

Is there anyway I can determine when exactly a module file I have (part of a
bigger assembly) gets loaded into memory?

The AssemblyLoad event tells me when exactly an assembly gets loaded, but
not a module.

Basically, I want to confirm that a module will NOT get loaded into memory
UNTIL a type defined in that module is referenced. That's what I have read,
but, I am finding it difficult to confirm.

Any feedback will be appreciated.

Thanks
Praveen
Jul 21 '05 #1
6 2297
A module, behind the scenes is nothing but a Class with only static members.
So if your experiment succeeds with a Class with static members you can rest
assured that the result holds good for a module.
Jul 21 '05 #2
Thanks for the feedback.

The static const. gets called only when the Type gets referenced explicitly,
but the file (.netmodule file) itself gets locked (cannot delete it) at
around app start.

What I also observed was that I could run the app without the above
..netmodule, until a type in that module gets referenced.

So, it does seem like the module gets loaded only as necessary, but I am
wondering why the file gets "locked" ahead of time!

-Praveen
"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
A module, behind the scenes is nothing but a Class with only static members. So if your experiment succeeds with a Class with static members you can rest assured that the result holds good for a module.

Jul 21 '05 #3
I am not able to get what exactly you are after. Source files are locked by
Visual Studio not by CLR. Once compiled your module will be incorporated
into the assembly and there would be no question of locking the mod file.

"Praveen Ramesh" <rp******@syncfusion.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Thanks for the feedback.

The static const. gets called only when the Type gets referenced explicitly, but the file (.netmodule file) itself gets locked (cannot delete it) at
around app start.

What I also observed was that I could run the app without the above
.netmodule, until a type in that module gets referenced.

So, it does seem like the module gets loaded only as necessary, but I am
wondering why the file gets "locked" ahead of time!

-Praveen
"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
A module, behind the scenes is nothing but a Class with only static

members.
So if your experiment succeeds with a Class with static members you can

rest
assured that the result holds good for a module.


Jul 21 '05 #4
I am not able to get what exactly you are after. Source files are locked by
Visual Studio not by CLR. Once compiled your module will be incorporated
into the assembly and there would be no question of locking the mod file.

"Praveen Ramesh" <rp******@syncfusion.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Thanks for the feedback.

The static const. gets called only when the Type gets referenced explicitly, but the file (.netmodule file) itself gets locked (cannot delete it) at
around app start.

What I also observed was that I could run the app without the above
.netmodule, until a type in that module gets referenced.

So, it does seem like the module gets loaded only as necessary, but I am
wondering why the file gets "locked" ahead of time!

-Praveen
"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
A module, behind the scenes is nothing but a Class with only static

members.
So if your experiment succeeds with a Class with static members you can

rest
assured that the result holds good for a module.


Jul 21 '05 #5
Yes, that sounds wierd doesn't it? But that's what I see.

There is no VS.Net in the picture here.
Let's say I have modulex with just TypeX, then when I run my app, before
TypeX's static const. gets hit my moudlex file gets locked. By locked, I
mean that I cannot delete that file. Running FileMon util., I see that my
Client app has a reference to that module file and so I cannot delete it.

I am inclined to believe though that the module file has not been loaded
into memory but just been "locked". That is how I would like to behave. But
I am not sure.

Thanks for the feedback.

-Praveen

"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
I am not able to get what exactly you are after. Source files are locked by Visual Studio not by CLR. Once compiled your module will be incorporated
into the assembly and there would be no question of locking the mod file.

"Praveen Ramesh" <rp******@syncfusion.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Thanks for the feedback.

The static const. gets called only when the Type gets referenced

explicitly,
but the file (.netmodule file) itself gets locked (cannot delete it) at
around app start.

What I also observed was that I could run the app without the above
.netmodule, until a type in that module gets referenced.

So, it does seem like the module gets loaded only as necessary, but I am
wondering why the file gets "locked" ahead of time!

-Praveen
"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
A module, behind the scenes is nothing but a Class with only static

members.
So if your experiment succeeds with a Class with static members you
can rest
assured that the result holds good for a module.



Jul 21 '05 #6
Yes, that sounds wierd doesn't it? But that's what I see.

There is no VS.Net in the picture here.
Let's say I have modulex with just TypeX, then when I run my app, before
TypeX's static const. gets hit my moudlex file gets locked. By locked, I
mean that I cannot delete that file. Running FileMon util., I see that my
Client app has a reference to that module file and so I cannot delete it.

I am inclined to believe though that the module file has not been loaded
into memory but just been "locked". That is how I would like to behave. But
I am not sure.

Thanks for the feedback.

-Praveen

"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:uf**************@TK2MSFTNGP09.phx.gbl...
I am not able to get what exactly you are after. Source files are locked by Visual Studio not by CLR. Once compiled your module will be incorporated
into the assembly and there would be no question of locking the mod file.

"Praveen Ramesh" <rp******@syncfusion.com> wrote in message
news:eY**************@TK2MSFTNGP09.phx.gbl...
Thanks for the feedback.

The static const. gets called only when the Type gets referenced

explicitly,
but the file (.netmodule file) itself gets locked (cannot delete it) at
around app start.

What I also observed was that I could run the app without the above
.netmodule, until a type in that module gets referenced.

So, it does seem like the module gets loaded only as necessary, but I am
wondering why the file gets "locked" ahead of time!

-Praveen
"Nice Chap" <Ni******@PlasmaDyne.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
A module, behind the scenes is nothing but a Class with only static

members.
So if your experiment succeeds with a Class with static members you
can rest
assured that the result holds good for a module.



Jul 21 '05 #7

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

Similar topics

4
2156
by: Tim Werth | last post by:
I am trying to use reflection to add an event handler for the RowUpdated event of the OracleDataAdapter object (ODP.NET), but the same thing can be said for SqlDataAdapter if you only use...
15
26485
by: Amit D.Shinde | last post by:
I am adding a new picturebox control at runtime on the form How can i create click event handler for this control Amit Shinde
12
18365
by: Adil Akram | last post by:
I want to cancel an event from its event procedure on some condition, I know how to do this in VB6 i.e. by setting cancel=true. Please tell me how can I do this in VB.net I don't know how to use...
4
340
by: Praveen Ramesh | last post by:
Hi, Is there anyway I can determine when exactly a module file I have (part of a bigger assembly) gets loaded into memory? The AssemblyLoad event tells me when exactly an assembly gets loaded,...
0
1428
by: Artur | last post by:
After trying to solve this, I noticed another strange thing. When in secure connection Page_Load method of page is not invoked (Load event not fired). I looked where this method is assigned to this...
1
1406
by: peter shaw | last post by:
Hi, I got an error message after I created a new event procedure for a grid control. But I can write a new procedure without any problem. The error is...
4
5334
patjones
by: patjones | last post by:
Hi everyone: I have a form in my database called "frmChecks". In the properties for this form, I set On Load to , which points to some code in VB that maximizes the form window and sets a...
1
5279
by: AMD_GAMER | last post by:
Hi, I am trying to print address labels. I have a form which asks for the user to input the first name, middle initial, and last name. On the button click to print the label, I have an event...
1
3124
by: Lila Godel | last post by:
My VB.NET 2008 application is setup with a Sub Main and no forms. At run time a NotifyIcon is created with one context menu choice (Close which terminates app). I have no trouble running the...
0
7119
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
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.