472,779 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 software developers and data experts.

Install custom action fails when assembly signed w/ strong name ke


I have a solution that contains a C# application that is installed and runs
as a service. The solution also contains several DLLs, some of which are C#
assemblies and some are C++ DLLs. The service application references the
DLLs. The service app also has an installer class that is set up to run as a
custom action in the Setup Project.

I am having a problem with signing an assembly. If I add a strong name key
to one of the C# DLLs, the setup project builds fine, but when I attempt to
install it on a client machine, installation fails during the service's
custom action step. I get "Unable to get installer types in the [my service]
assembly. --Unable to load one ore more of the requested types. Retrieve
the LoaderExceptions property for more information."

Why does adding a strong name key to one of the referenced assemblies cause
the custom action to fail this way? And how can I sign my assemblies and
still have custom actions?

Apr 20 '07 #1
10 2655
Hi Jack,

From your description, I understand you've developed an windows service
through Visual Studio, the windows service application reference some other
c++ dll and .net class library assemblies(some of which are strong-named).
However, you found that the setup program of the windows service project
will fail(when executing the service's installer custom action class),

According to the solution structure and assembly settings, I have performed
some test on my local side. Here is my test steps:

1.Create a VS 2005 windows service project (add a installer class)

2. Create two class library(c#) projects in the same solution and reference
them in the main windows service project

3. use a keyfile to strong-name of of the class library project

4. add a setup project (reference to windows service project's primary

However, when launching the setup package, the windows service can be
correctly deployed, with the referenced class library(strong-named and
private ones) copied. Therefore, I think the problem should be specific to
something else of your solution. Is there any particular type referencing
scenario in your solution?

BTW, for general assembly loading/binding troubleshooting, you can use the
"fuslogvw.exe" utility to track how the runtime locating and binding the

#Assembly Binding Log Viewer (Fuslogvw.exe)


Steven Cheng

Microsoft MSDN Online Support Lead


Get notification to my posts through email? Please refer to

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


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

Apr 23 '07 #2
Thank you for replying, Steven. I will take a look at using fuslogvw.exe to
gain more insight.

In the steps you have listed to reproduce my issue, I believe there is one
thing that you left out: I have added an Installer class to my windows
service project and have added a Custom Action for the Install and Commit
steps that calls the Service' installer class. Please try this and see if
you then run into the problem I am seeing. If I remove the custom actions,
there is no problem with deployment. The custom actions trigger the problem.

Apr 23 '07 #3

I have copied fuslogvw.exe to the client machine and set it to "Log all
binds to disk." After saving this setting, I restarted fuslogvw.exe then ran
my installer to capture the binds that occur leading up to the "Unable to get
installer types" error. Fuslogvw.exe shows no binding errors. Every bind
that it lists states that the operation completed successfully. This
suggests that it is not a binding error that is triggering this problem.

Apr 23 '07 #4
Thanks for your reply Jack,

If the fuslogvw utility can not capture the error, it seems the assembly is
correctly located and bound. For the "installer class custom action", I did
have added a installer class in the windows service and create custom
action item for it in the setup project. Do you mean any other custom
actoin? I've added the installer class(in windows service project) and
custom action(in setup project) follow this kb article:

#How to create a setup project for a Windows Service application in Visual
C# .NET and in Visual C# 2005

Please let me know if this is what you mean. If you feel necessary, I can
send you my test solution through email since it is a quite simple and
typical one.


Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 24 '07 #5

Yes. That is what I meant regarding a custom action. I wasn't sure if you
used that step in your test as the steps 1-4 that you have listed didn't
mention specifically adding the custom action to the setup project.

Please do send your sample project for me to take a look at.


Apr 24 '07 #6

It has been a nearly full day and I haven't yet received your sample
solution via email. Please send it my way as soon as you can.


Apr 25 '07 #7
Hi Jack,

Sorry for the delay. Would you send a mail to my email (the one in my
signature and remove the "online") so that I can get your address and send
it to you offline?


Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 26 '07 #8
Hi Jack,

I have sent you a test setup solution package, have you received it and
tested it on your side? If there is any new finding or anything need help,
please feel free to post here.


Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 1 '07 #9
Hi Steven,

I apologize - I didn't realize you had posted back to here, as for some
reason this thread is not being bumped to the top of the listing for this
forum after a new post is added when viewed using the web-based MSDN Managed
Newsgroups viewer. Also, I didn't receive an email notification of your
reply, even though I have "notify me of replies" checked whenever I post to
this forum using the web-based MSDN Managed Newsgroups viewer.

In any event, I sent an email to you today with the results of my search and
am posting them here for posterity. Your simple sample solution seems to
work, but it didn't help me to figure out why my real-world solution failed
to perform my custom actions when I strong name keyed any of the assemblies.
However, through a bunch of UseNet searching and reading of MSDN blogs, I
found a lot of information about using managed code to write custom actions.
Basically, it's not a good idea and is not even supported by Windows
Installer. Why Visual Studio makes it so easy to do via Installer Classes is
a philosophical question that I haven't found an answer for, but the advice
given is that your custom actions should be written in native C++. So that's
what I've done over the past couple of weeks. I have re-written our custom
actions in native, unmanaged C++ and everything seems to be working well now.
Thanks for your help on this matter.

May 7 '07 #10
Thanks for your followup Jack,

So you've changed the custom action to a pure unmanaged c++ one and make it
working. For .net managed custom action, it it provided for those ones who
prefer .net programming language and want to develop custom actions
conveniently. Also, this require that .net framework runtime become a
prerequisiute for such setup package.

Here, I'm not sure what's the exact cause make managed custom action not
working for your scenario. Anyway, glad that you've found a way to make it

Thanks again for your posting .


Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

May 9 '07 #11

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

Similar topics

by: Bilo Aga | last post by:
The installation of MSDE fails and I dont find any solution to get it work. If I start the setup than a windows with the time bar appears and says it will take 1 minute. After nearly 1 minute it...
by: Mr. Mountain | last post by:
Hi, I am building a custom wizard engine in C# following the example in "Mastering Visual Studio.NET" by Griffiths, Flanders and Sells (pg 304). Unfortunately, I'm having several problems that the...
by: Bob | last post by:
Could anyone suggest me some examples/articles on creating a setup program in VS.NET that can install the assembly into the GAC? I have done some search and research myself and have some basic...
by: Eric | last post by:
Using VS.Net 2003 .Net framework 1.1 SP1 Our installation project calls a Custom Action dll to perform post install actions. It fails if the .msi file is launch from a directory that contains...
by: Sky | last post by:
Hello: I'm trying to make sense of snk files, when to use, under what conditions to regenerate new ones,...can someone take a look if these statemes make sense? And then the final questions at the...
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
by: Atul Thombre | last post by:
Hello, I am developing a custom membership provider. For that I built a prototype that uses a SQL Server 2005 database as a backend store. I implemented the class...
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. ...
by: =?Utf-8?B?S2VuIExlbWlldXg=?= | last post by:
My clickonce app fails when the install button on the publish.htm page is clicked. User is prompted with a "Cannot Start Application" dialog. Details provided from the dialog are: PLATFORM...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: lllomh | last post by:
How does React native implement an English player?
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.