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

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 7792
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
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
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
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.