473,766 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 LoaderException s 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 2739
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.e xe" 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

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

Similar topics

1
6888
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 closes the window and gives no additional information. But I see that it generates first all the directories and files in c:\Programme but after the setup is end everything is deleted. Nearly everything , I see a service "MSSQLServerADHelper" is...
7
1689
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 book isn't helping me overcome. (It is a good book, but O'Reilly hasn't made code available and so far not a single example I've tried from the book has worked!) To build a COM server in C# that implements the IDTWizard interface, does the...
4
2630
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 understanding on how to create a setup program. All the articles about Windows Installer 2.0 is the best way to install your assembly into GAC but I haven't found one shows what exactly I need to do differently in my VS.NET setup project in order...
3
7280
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 spaces, such as: My Install Folder\SetupDir The exception thrown is:
2
2440
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 end that they first statements bring up in my mind... a) Because two developers, unbeknownst to each other, can end up releaseing different dll's with the same name, one should sign an assembly with a unique tag. right?
7
10828
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 code. The configuration section is contained within the exe (it's a simple test case!) and everything works well debugging within the IDE or if the application is deployed on a drive or share that has been granted full trust. For the share the...
0
2118
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 System.Web.Security.MembershipProvider and implemented few necessary methods. The methods use SQL for interacting with the SQL Server database. I put all this code in a class library. I also created a simple Website using Visual Studio 2005 and configured the Web.config to...
1
2845
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. Can I use a strong named DLL outside the GAC with Copy Local = false by providing a reference to the public key? If yes to above, please tell me how to reference the public key within
3
5237
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 VERSION INFO Windows : 5.1.2600.196608 (Win32NT) Common Language Runtime : 2.0.50727.3053 System.Deployment.dll : 2.0.50727.3053 (netfxsp.050727-3000) mscorwks.dll : 2.0.50727.3053 (netfxsp.050727-3000)
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10168
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...
1
9959
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
8835
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...
0
6651
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
5279
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...
1
3929
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 we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.