473,785 Members | 2,867 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_messag e
An exception occurred during the Install phase
System.InvalidO perationExcepti on: Unable to get installer types in the c:\...\visual studio projects\servic e bug test\service bug test\obj\debug\ service bug test.exe assembly
The inner exception System.Reflecti on.ReflectionTy peLoadException 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 7870
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
5910
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 access is not allowed' (using both InstallUtil or by creating an installer). I have tracked the registry access failure using RegMon and found that it fails on
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, then I configured the properties of the installers When I run InstallUtil on the executable, it fails with the following message "An exception occurred while trying to find the installers in the c:\...\obj\debug\MyService.exe assembly...
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 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....
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.