473,320 Members | 1,881 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,320 software developers and data experts.

InstallUtil, PerformanceCounterInstaller interactions

Hi...

I've got some perf counters that I install with a
PerformanceCounterInstaller. I've got new code I want to test and legacy
code installed on the same system. I *thought* that the
PerformanceCounterInstaller would fail if the counter category was already
installed. It appears, however, that InstallUtil just installs over the old
copy (so my legacy code starts freaking out).

It this the case? Is there any way to have InstallUtil at least warn if the
counters are already there and not do it?

I made my new code backward compatible but the legacy code won't work with
the new counters.

Thanks
Mark

Mar 11 '07 #1
4 3967
Hi Mark,

Currently the PerformanceCounterInstaller will indeed overwrite the
existing category and counter information in registry by default. If you
use Reflector (http://www.aisto.com/roeder/dotnet/) to view the source of
PerformanceCounterInstaller (in
%windir%\Microsoft.NET\Framework\v2.0.50727\system .configuration.install.dll
), you will see it delegates call to PerformanceCounterCategory.Create() to
add the category and counter.

To workaround this, I think you could create a custom class to inherit from
PerformanceCounterInstaller and override the Install method, and call into
PerformanceCounterCategory.Exists() before call base.Install(). According
to your requirement, you could prompt the user if the category already
exists.

Please feel free to let me know there's anything unclear.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 12 '07 #2
Hi Walter...

Thank you very much; that's a great suggestion.

On a related point, the assembly I was using InstallUtil on creates both a
set of perf counters and an event log source. When the new dll installs over
the old, I notice some odd behavior. I don't gac my assemblies; they're all
deployed in the directory where the other consuming assemblies live, so they
should all resolve to using the ones in their directory. But after running
InstallUtil on the new dll in one directory, I noticed it breaking a number
of things in the other running app in the different directory. It seemed
that installing perfcounters and an event log source changed how assembly
paths got resolved and which ones got pulled in. I could tell because the
old app suddenly started to log messages (using log4net) using properties
defined in the new code.

When I check the registry, a framework dll, netfxperf.dll, is listed as the
maintainer of those perf counters and EventLogMessages.dll is listed as the
message definition source for my event log source. I understand the new
Installers whacked over my definitions with the new ones, but I don't see the
trail of assembly linkages that overrode local-dir resolution.

Does netfxperf.dll load the assemblies that contain the counter definitions
or something?

Thanks
-Mark
"Walter Wang [MSFT]" wrote:
Hi Mark,

Currently the PerformanceCounterInstaller will indeed overwrite the
existing category and counter information in registry by default. If you
use Reflector (http://www.aisto.com/roeder/dotnet/) to view the source of
PerformanceCounterInstaller (in
%windir%\Microsoft.NET\Framework\v2.0.50727\system .configuration.install.dll
), you will see it delegates call to PerformanceCounterCategory.Create() to
add the category and counter.

To workaround this, I think you could create a custom class to inherit from
PerformanceCounterInstaller and override the Install method, and call into
PerformanceCounterCategory.Exists() before call base.Install(). According
to your requirement, you could prompt the user if the category already
exists.

Please feel free to let me know there's anything unclear.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 13 '07 #3
Hi Mark,

I'm not very sure about your question about how the log4net will use new
properties when the event log source gets updated. Do you mean that you're
using the .NET's event log source installer to create a new event log
source but you're using log4net to write to event log? Is your old
application an .NET 1.1 application?

Basically the EventLogMessages.dll is a resource only dll with a
messagetable that has 65535 simple strings all have values "%1". You can
use Resource Hacker (http://www.angusj.com/resourcehacker/) to open it
(%windir%\Microsoft.NET\Framework\v2.0.50727\Event LogMessages.dll or
%windir%\Microsoft.NET\Framework\v1.1.4322\EventLo gMessages.dll). This
seems strange at first, it's because messages written to event log file are
only a ReplacementStrings array, a complete event log message will be
composed by three parts:

* EventID
* the ReplacementStrings array
* a template string in the message resource file

In this case, the template here in .NET will be always "%1", which means
the whole message written to event log file will be simply returned as it
is.

Given that the .NET 1.1 EventLogMessages.dll is similar to .NET 2.0, I
don't think updating the message resource file of the event log source will
change the messages shown in event log.

Anyway, would you please elaborate more on the details of the issue? Thanks.

Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 14 '07 #4
Hi Mark,

I am interested in this issue. Would you mind letting me know the result of
the suggestions? If you need further assistance, feel free to let me know.
I will be more than happy to be of assistance.

Have a great day!
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 16 '07 #5

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

Similar topics

0
by: Mike R | last post by:
I have 2 questions about custom options in InstallUtil. The help screen for InstallUtil says this: --- quote --- Options take the form /switch= <...a list of options follows...> Individual...
0
by: TT (Tom Tempelaere) | last post by:
Hi there The following is a description to reproduce the problem. I do not know if this is a bug in the .NET environment/framework (I suspect it is), or if there is something that I am doing...
7
by: scarred wind | last post by:
when i run my program, an error message prompt me that i should add the installutil.exe. How do i checked for the installutil.exe? How can i add it to my Timer program? ...
0
by: Benny Ng | last post by:
Hi,All, When i deploy Enterprise library with my application ,i used XCOPY to deploy it into my test server. But when application runs, shown some error related registry. (But actually I haven't...
5
by: Jamin Mace | last post by:
I'm trying to create a batch script that will allow me to use the .Net installutil.exe to install a windows service. I want to be able to specify the username and pasword in my script so that I...
3
by: Installutil System.BadImageFormatExcepti | last post by:
I've tried to make a Windows Service using the 2005 C# and when I go to use Installutil it returns with an System.BadImageFormatException error while intializing the installation. I've even gone as...
1
by: vovan | last post by:
My VB 6 program uses Windows Service I developed with VB 2005. Setup for VB 6 project, created in InstallShield 12, installs Framework 2 if it is not presented on the client machine. I ran setup...
0
by: meo45 | last post by:
All i want to do is add a service line to the SCM. I searched the net to do this in code with C# but found no decent way to do this. The only workable way was to use the .net utility...
2
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi all people, everybody I create several windows services in VS 2005. The services can be installed by MSI, and too using installutil command. If the service has Installer class, all is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.