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 Spring.net, 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

/D

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

foreach (var task in tasks)
{
      task.Execute();
}

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?

Thanks

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)
            {
                task.Execute();
            }
        }
    }

[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=9.0.0.0, 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=9.0.0.0, 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 

 

Hi,

Does this happen on all your projects?

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

Check out this http://msdn.microsoft.com/en-us/library/bb882689.aspx

Regards

Hi, 

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.

http://msdn.microsoft.com/zh-cn/library/cc488277.aspx

http://msdn.microsoft.com/zh-cn/library/bb918183.aspx

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 asp.net 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.

http://easylistbox.com/demoCustomized.aspx

Refer this codeproject link for creating colored dropdown

http://www.codeproject.com/Articles/7691/ASP-NET-Color-DropDown-Control



Here are some resources for CSS:

but try this

The arrow code can be found on 

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

.navbar .dropdown-menu:after {
  content
: '';
  display
: inline-block;
  border
-left: 6px solid transparent;
  border
-right: 6px solid transparent;
  border
-bottom: 6px solid #000; /* change color here, modified for a black arrow */
  position
: absolute;
  top
: -6px;
  left
: 10px;
}
http://bavotasan.com/2011/style-select-box-using-only-css/
http://www.noupe.com/tutorial/drop-down-menu-jquery-css.html

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

Ha

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 ?

itsvineethpv

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

http://www.codeproject.com/Questions/256147/How-to-use-app-config-connectionstring-with-sql-se

http://www.ezzylearning.com/tutorial.aspx?tid=8067328

sriramabi

itsvineethpv

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

http://www.codeproject.com/Questions/256147/How-to-use-app-config-connectionstring-with-sql-se

http://www.ezzylearning.com/tutorial.aspx?tid=8067328

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:

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

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:

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



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

http://blogs.msdn.com/b/drnick/archive/2007/01/26/disabling-security-timestamps.aspx

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

How to: Set a Max Clock Skew

http://msdn.microsoft.com/en-us/library/aa738468.aspx

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.