473,511 Members | 15,581 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Service Problem, InstallUtil fails. I'm stuck ...

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 wrong. But I am definitely stuck on this one. I cannot find a solution

Make a new C# service project, and add an installer for the service (using menu). Set properties for a test scenario, don't modify code. Run InstallUtil, everything installs fine. Uninstall afterwards
Then, add a reference to an assembly, and add to the service project a class that derives from a class in the other assembly. In my case, the referred assembly contains a base threading class, then in the service project I derive from the base class to make the service main thread. Rebuild, then run InstallUtil. This fails with the following error message

<error_message
An exception occurred during the Install phase
System.InvalidOperationException: Unable to get installer types in the c:\...\visual studio projects\service bug test\service bug test\obj\debug\service bug test.exe assembly
The inner exception System.Reflection.ReflectionTypeLoadException was thrown with the following error message: One or more of the types in the assembly unable to load
</error_message

I don't know if this has something to do with the assembly I am referring to. Should this assembly be special in some way for the install utility to work? Is this a known issue perhaps? All help is appreciated

Dev Env : C
..NET Framework: v1.1.432
MDE 2003 : v7.1.308
InstallUtil : 1.1.4322.573, from .NET framework v1.1.432

Thank you very much
Tom Tempelaere.
Nov 16 '05 #1
7 7814
Hi there

After talking with other C# developers, I've come to the conclusion that this is a bug in some part of the .NET framework or the InstallUtil utility, I can't tell where. Someone from Microsoft ought to look at the problem, and fix it for the new release of C# (or the next SP, if there is one). That is, if it really _is_ a bug and not lack of my knowledge, but I suspect it is a bug

The workaround is to make a new assembly that contains the concrete threading class, and refer to that assembly from the service project. This works without problems

I downloaded several C# service projects from the net, and I noticed that these all avoid the problem. For instance, injecting the base classes in the service project (bad bad bad), or, make a new assembly with the service implementation classes (the workaround I described)

PS: Is there a newsgroup/site where one can address bugs in the framework

Thank you
Tom Tempelaere.
Nov 16 '05 #2
Hi people

The same problems with InstallUtil exist when the service assembly uses a static property defined in another assembly. The error message is the same. The (obvious) workaround is to not use static properties, and use static methods instead

Thanks
Tom Tempelaere

Nov 16 '05 #3
Hi

The workaround doesn't seem to work sometimes. I think either the InstallUtil utility is buggy, or the C# Service project is. I will try to send a bug report to MS

Tom

----- TT (Tom Tempelaere) wrote: ----

Hi people

The same problems with InstallUtil exist when the service assembly uses a static property defined in another assembly. The error message is the same. The (obvious) workaround is to not use static properties, and use static methods instead

Thanks
Tom Tempelaere

Nov 16 '05 #4
Hi again

Forget all I said in the other posts in this thread

The problem is not a bug, it is because I configured my InstallUtil as a tool in the Tool-menu (IDE), and gave as argument ($TargetPath). I thought that the target path was the path to the executable/dll of the startup project, well it isn't. There simply is no argument for the startup path ($StartupPath). I wonder why there isn't

So If you happen to be editing a class in a project that is not the startup project, the installutil with ($TargetPath) will install the wrong assembly. Hence the errors I got

IMHO, there should exist an argument like ($StartupPath) leading to the path of the Startup Project

My apologies for saying that this is a bug, it isn't

Thank you
Tom.
Nov 16 '05 #5
Hi people

The same problems with InstallUtil exist when the service assembly uses a static property defined in another assembly. The error message is the same. The (obvious) workaround is to not use static properties, and use static methods instead

Thanks
Tom Tempelaere

Nov 16 '05 #6
Hi

The workaround doesn't seem to work sometimes. I think either the InstallUtil utility is buggy, or the C# Service project is. I will try to send a bug report to MS

Tom

----- TT (Tom Tempelaere) wrote: ----

Hi people

The same problems with InstallUtil exist when the service assembly uses a static property defined in another assembly. The error message is the same. The (obvious) workaround is to not use static properties, and use static methods instead

Thanks
Tom Tempelaere

Nov 16 '05 #7
Hi again

Forget all I said in the other posts in this thread

The problem is not a bug, it is because I configured my InstallUtil as a tool in the Tool-menu (IDE), and gave as argument ($TargetPath). I thought that the target path was the path to the executable/dll of the startup project, well it isn't. There simply is no argument for the startup path ($StartupPath). I wonder why there isn't

So If you happen to be editing a class in a project that is not the startup project, the installutil with ($TargetPath) will install the wrong assembly. Hence the errors I got

IMHO, there should exist an argument like ($StartupPath) leading to the path of the Startup Project

My apologies for saying that this is a bug, it isn't

Thank you
Tom.
Nov 16 '05 #8

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

Similar topics

2
5874
by: René Beumer | last post by:
I am trying to install a windows service written in .net 2003 on my Windows 2000 computer. I have followed the walkthru given in msdn but the service fails to install with 'requested registry...
3
1081
by: TT (Tom Tempelaere) | last post by:
Hi there I am making a service project in C#, and I'm in the process of writing the installer. I made an installer class by using the "Add Installer" menu-item in the design window of the service,...
0
377
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...
0
7144
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...
0
7427
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...
0
7512
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
5671
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,...
1
5069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4741
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
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
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 ...

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.