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

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

Hello,

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?

Thanks,
Jack
Apr 20 '07 #1
10 2708
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),
correct?

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
output)

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:

#Assembly Binding Log Viewer (Fuslogvw.exe)
http://msdn2.microsoft.com/en-us/lib...c4(VS.80).aspx

http://blogs.msdn.com/ianhu/archive/...12/663834.aspx
Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

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
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

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.
--
-Jack

Apr 23 '07 #3
Steven,

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.
--
-Jack

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
http://support.microsoft.com/kb/816169/

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.

Sincerely,

Steven Cheng

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


Apr 24 '07 #5
Steven,

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.

Thanks,
Jack

Apr 24 '07 #6
Steven,

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.

Thanks,
Jack

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?

Sincerely,

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.

Sincerely,

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.

--
-Jack
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
working.

Thanks again for your posting .

Sincerely,

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

1
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...
7
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...
4
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...
3
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...
2
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...
7
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...
0
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...
1
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. ...
3
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...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...
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...
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
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,...
0
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...

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.