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

Home Posts Topics Members FAQ

ReflectionTypeLoadException with service installer

Bob
I created a windows service and added an installer by following the tutorial
in MSDN. But when I run the installutil.exe tool I get an error. Below is
the log.

Installing assembly 'c:\temp\serv\prorec.exe'.
Affected parameters are:
assemblypath = c:\temp\serv\prorec.exe
logfile = c:\temp\serv\prorec.InstallLog
An exception occurred while trying to find the installers in the
c:\temp\serv\prorec.exe assembly.
System.Reflection.ReflectionTypeLoadException: One or more of the types in
the assembly unable to load.
Aborting installation for c:\temp\serv\prorec.exe.
Rolling back assembly 'c:\temp\serv\prorec.exe'.
Affected parameters are:
assemblypath = c:\temp\serv\prorec.exe
logfile = c:\temp\serv\prorec.InstallLog
An exception occurred while trying to find the installers in the
c:\temp\serv\prorec.exe assembly.
System.Reflection.ReflectionTypeLoadException: One or more of the types in
the assembly unable to load.
Aborting installation for c:\temp\serv\prorec.exe.

If I change the Main() function to create my service class and call the
start & stop manually it runs fine as an application. Can anyone tell me
how to find out what the problem is? Is there anyway to get a better
description of what type could not be loaded?

Bob
Nov 1 '05 #1
1 5521
Bob
I was getting this error because I had the below structure in my project.
Once I removed the strucutre it started working. It would be nice if the
error log created by the installutil actually had some useful information in
it. I still don't no why removing this structure fixed the problem. It
works when I run it as an application.

[StructLayout(LayoutKind.Explicit, Size=318)]
struct MSGRECORD
{
[FieldOffset(0)]
public long nFlag;
[FieldOffset(4)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst=50)]
public string szUID;
[FieldOffset(54)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst=260)]
public string szData;
[FieldOffset(314)]
public long Created;
} ;
"Bob" <ms****@hotmail.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I created a windows service and added an installer by following the
tutorial in MSDN. But when I run the installutil.exe tool I get an error.
Below is the log.

Installing assembly 'c:\temp\serv\prorec.exe'.
Affected parameters are:
assemblypath = c:\temp\serv\prorec.exe
logfile = c:\temp\serv\prorec.InstallLog
An exception occurred while trying to find the installers in the
c:\temp\serv\prorec.exe assembly.
System.Reflection.ReflectionTypeLoadException: One or more of the types in
the assembly unable to load.
Aborting installation for c:\temp\serv\prorec.exe.
Rolling back assembly 'c:\temp\serv\prorec.exe'.
Affected parameters are:
assemblypath = c:\temp\serv\prorec.exe
logfile = c:\temp\serv\prorec.InstallLog
An exception occurred while trying to find the installers in the
c:\temp\serv\prorec.exe assembly.
System.Reflection.ReflectionTypeLoadException: One or more of the types in
the assembly unable to load.
Aborting installation for c:\temp\serv\prorec.exe.

If I change the Main() function to create my service class and call the
start & stop manually it runs fine as an application. Can anyone tell me
how to find out what the problem is? Is there anyway to get a better
description of what type could not be loaded?

Bob

Nov 2 '05 #2

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

Similar topics

5
by: krisk | last post by:
Could not find ansewr: in ProjectInstaller, RunInstallerAttribute: ..... this.serviceInstaller1.ServiceName = MyServiceName; in the code: public class MyService :...
2
by: Mark | last post by:
I've created a windows service that has a reference to another class library project. This all exists in VS.NET as a single solution. It is in release mode, and I'm ready to create an installer. ...
1
by: Stu | last post by:
Hi, I am trying to create a Windows Service installer but it just dumps the service executable in the application folder and doesn't install it as a service. I have gone through this tutorial...
1
by: Bob | last post by:
I created a windows service and added an installer by following the tutorial in MSDN. But when I run the installutil.exe tool I get an error. Below is the log. Installing assembly...
11
by: kshetgar | last post by:
I am experiencing a wierd problem... I have a C#.Net application Server which uses Sockets. It listens on port 11000. and it runs as a Windows Service. If I run it as a consple Application,...
1
by: Dave | last post by:
I have a Console app, a related Service Project and Service Setup / Installer Project. I would like to have the result of running the installer.msi file register the service to run with certain...
0
by: Dave | last post by:
I have a Console app, a related Service Project and Service Setup / Installer Project. I would like to have the result of running the installer.msi file register the service to run with certain...
1
by: James | last post by:
I've created an installer for a windows service. When you install the service, the user is prompted for Windows Service credentials. If the username and/or password don't match (ie mispelling),...
0
by: =?Utf-8?B?SmVzc2FyZA==?= | last post by:
Hi All, I'm having trouble deploying a Windows Service installer (.NET 1.1) onto some machines. It gets half way through the installer and gives me a dialog box saying "Access Is Denied". When...
0
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
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
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,...
1
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
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...
1
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
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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.