Category Archives: Bootstrap

[RESOLVED] Get all instances of a class

Hi all

I am writing a web forms app at work with .net 4. We don't use any DI, IoC at present so no, Castle Windsor or StructureMap.

However I need to implement a "Bootstrapper" for the application on start. Is there a way to get all instances of a class. The only examples I can find are related to IoC Containers and DI in MVC apps.

Any help would be great. Thanks


var tasks = MyServiceLocator.GetAllInstances<IBootstrapperTask>();

foreach (var task in tasks)

I hope this help.  Get all Instances click the link

I suppose what I am looking for is a web forms bootstrapper example. The only ones I can find are related to DI, IoC and MVC.

What is th best way to handle startup calls in the Global.asax?


Managed to sort a simple solution to my problem:

class Bootstrapper
        /// <summary>
        /// Runs all required application startup tasks
        /// </summary>
        public static void Run()
            // Add necessary tasks into the list as required
            var tasks = new List<IBootstrapperTask>
                                new ConfigureEntityFactory()

            // Execute tasks
            foreach (var task in tasks)

[RESOLVED] Requirement of Assembly "Microsoft.VisualBasic.PowerPacks.Vs"

What is the requirement of Assemblies "Microsoft.VisualBasic.PowerPacks.Vs"? 

And,  What if I remove the  line <add assembly="Microsoft.VisualBasic.PowerPacks.Vs, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> from web.config file in my web application? 


Because , This line is give me error ,

"Could not load file or assembly 'Microsoft.VisualBasic.PowerPacks.Vs, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. "

If, I remove that   Add Assembly  line from  web.config then its work  perfectly.

Thank you 



Does this happen on all your projects?

The PowerPacks .dll should be installed on the target machine.

Check out this



It run perfectly on localhost , But when I Upload my web application on server , It gives error that "could not load assembly...." , 

Then I remove that line (add assembly from web.config) , and now it is also run perfectly on server.

So, I think that Assembly "Microsoft.VisualBasic.PowerPacks.Vs" is not necessary, is it?

The Microsoft.VisualBasic.PowerPacks namespace contains classes for the Visual Basic Power Packs controls. Visual Basic Power Packs controls are additional Windows Forms controls. They were originally released as free add-ins and are now included in Visual Studio.

You can search whether there is any reference to namespace Microsoft.VisualBasic.PowerPacks or not.

You can find the installation package here

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\VBPowerPacks\en

[RESOLVED] Change DropDownList Style in ASP.NET

I want to change the style for Dropdownlist control like border color (it does not come only in IE), Arrow Color.


How can it possible?

Avoid using styles for drop down lists.. It will behave differently in different browsers.

Instead use some div and use script and style to make and appear as a combobox.

You can try this third party free control.

Refer this codeproject link for creating colored dropdown

Here are some resources for CSS:

but try this

The arrow code can be found on 

 of the 
. You can manipulate its position and color by modifying its css, e.g.:

.navbar .dropdown-menu:after {
: '';
: inline-block;
-left: 6px solid transparent;
-right: 6px solid transparent;
-bottom: 6px solid #000; /* change color here, modified for a black arrow */
: absolute;
: -6px;
: 10px;

[RESOLVED] How to deploy a windows application with Mysql database i,


ou dont need to start another msiexec.exe. Visual Studio also lets you use an executable as a custom action. So the custom action

See below. Image is from this link: Custom Action

Check out the Calling an executable as a custom action section in above link. Now if this does not work other way out is to modify the default bootstrapper.

Check out the reply by 0xA3 in this link. 
Running another program from c# setup project

And its not complex as it looks. :)

Some more links for adding prequisites to bootstrapper:
Authoring a Custom Bootstrapper Package for Visual Studio 2005
Visual Studio Setup & Deployment: Adding Pre Requisits

Plus you should take a look at this:
MYSQL installation with a .NET winforms app

thanks for your reply. But i have no idea about these things.

i have a created a deployment project for the windows app. Where to add my db ?


i have a created a deployment project for the windows app. Where to add my db ?

App config ...and use connection string...

for more detail ref this



i have a created a deployment project for the windows app. Where to add my db ?

App config ...and use connection string...

for more detail ref this

sorry for disturbing...... 

i have to place the mysql databse with msi file ..right ?  can i just add the dump file of the database to the application folder ?

will it work if the mysql server is already installed in the client machine ?

[RESOLVED] WCF updating wsHttpBinding to use maxClockSkew

I am running into an issue with my WCF service clocks between host and client are more than 5 min apart.  I have seen where I can correct this by using the maxClockSkew in a custom binding.  I am having issues converting my wsHttpBinding to a custom binding.  Any help is very appreciated.  thanks.

this is what I currently have:

		<binding name="wsHttpEndpointBinding">
			<security mode="Message">
				<message establishSecurityContext="false" clientCredentialType="Certificate"/>

You have an article on MSDN... How to: Set a Max Clock Skew

I have got it working in VS now when I try to publish it I am getting Keyset Does not Exist.  I was using an x509 cetrificate with no issues when  I am using  wsHttpBinding but with the customBinding I get the error.  Any help is Appreciated.

this is my current Config file:

    <binding name="customEndpointBinding">
     <transactionFlow />
     <security authenticationMode="MutualSslNegotiated" messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
      <localClientSettings maxClockSkew="00:15:00" />
      <localServiceSettings maxClockSkew="00:15:00" />
       <localClientSettings maxClockSkew="00:30:00" />
       <localServiceSettings maxClockSkew="00:30:00" />
     <textMessageEncoding />
     <httpTransport />

Usually this means that IIS user doesn't have access to the private key of your certificate. You can read more about it here.

What I thought was strange was it works fine when I convert and use the wsHttpBinding but when I use the customBinding it get the error. 

Unfortunatelly I was never in this situation before. I'll have to create a test project and see if I can replicate this behaviour and then inspect it.

If the issue is caused by timestamp difference between WCF client and service side, I think we have 3 options:

Option 1:

Sync the timestamp of the client side with the WCF service server side manually.

 Option 2:
DISABLE  the timestamp of WCF binding by using custom binding. 

For more details, you can refer to below article:

Disabling Security Timestamps

Option 3: Set   a Max Clock Skew to  mitigate this possibility

How to: Set a Max Clock Skew

Time-critical functions can be derailed if the clock settings on two computers are different. To mitigate this possibility, you can set the MaxClockSkew property to a TimeSpan.