Tuesday, July 21, 2015

Script to enable WCF SVC handler in IIS

Refered from  http://stackoverflow.com/questions/11116134/wcf-on-iis8-svc-handler-mapping-doesnt-work?rq=1

Windows 8 with IIS8

  • Hit Windows+X
  • Select Programs and Features (first item on list)
  • Select Turn Windows Features on or off on the left
  • Expand .NET Framework 4.5 Advanced Services
  • Expand WCF Services
  • Enable HTTP Activation

Alternate way to do the same via script  
REM install the needed Windows IIS features for WCF
dism /Online /Enable-Feature /FeatureName:WAS-WindowsActivationService
dism /Online /Enable-Feature /FeatureName:WAS-ProcessModel
dism /Online /Enable-Feature /FeatureName:WAS-NetFxEnvironment
dism /Online /Enable-Feature /FeatureName:WAS-ConfigurationAPI
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation
dism /Online /Enable-Feature /FeatureName:WCF-HTTP-Activation45

REM Feature Install Complete
pause

Sunday, July 5, 2015

Running xUnit.net tests in Visual Studio


http://xunit.github.io/docs/running-tests-in-vs.html 

Wednesday, December 17, 2014


https://social.msdn.microsoft.com/Forums/vstudio/en-US/dde72fbe-e741-48fd-a9e1-253800d5227a/is-any-way-to-change-wcf-test-client-config?forum=wcf

Answer
The reason timeouts and MaxReceivedMessageSize can't be propagated to the generated client config is because that data is not propagated to the wsdl published by the service.  Only operation ports, and WS* standards are in metadata.  Further, MaxReceivedMessageSize on the service has nothing to do with MaxReceivedMessageSize on the client.  You can have a request-reply scenario where the request sent to the service is very small, but the service returns a large response.  In that scenario you MUST manually modify the MaxReceivedMessageSize on the client.  There's nothing in metadata about this.

Thursday, October 9, 2014

Reference : http://www.kindblad.com/2009/03/how-to-generate-sha-1-hash-of-string.html


How to generate the SHA-1 hash of a string using C#

The namespace System.Security.Cryptography contains classes for working with cryptography such as hashing. Within this namespace you will find the SHA1Managed class which we can utilize to generate the SHA-1 hash of a string. Below you will find a helper method using this class:

public static string GetSha1(string value)
{
 var data = Encoding.ASCII.GetBytes(value);
 var hashData = new SHA1Managed().ComputeHash(data);

 var hash = string.Empty;

 foreach (var b in hashData)
  hash += b.ToString("X2");

 return hash;
}

Saturday, May 3, 2014

Workaround for CORS Support in IE 8 and 9



The solution by

Jonas Gauffin 

 

helped a lot to make a workaround for IE 8 and 9 , CORS support


http://stackoverflow.com/questions/11487216/cors-with-jquery-and-xdomainrequest-in-ie8-9
http://blog.gauffin.org/2014/04/how-to-use-cors-requests-in-internet-explorer-9-and-below/


Thursday, September 5, 2013

Serving web fonts from IIS

 Content copied from http://sebduggan.com/blog/serving-web-fonts-from-iis/ for reference.


I’ve just started playing with web fonts for a site redesign. I came across the following gotcha (thanks, Firebug, for alerting me to it!).
If you are running IIS 6 or higher on your web server, some of the fonts will be disabled by default.
Your typical @font-face declaration might look like this:
@font-face {
 font-family: 'VegurRegular';
 src: url('Vegur-R_0500.eot');
 src: local('Vegur'),
  local('Vegur-Regular'),
  url('Vegur-R_0500.woff') format('woff'),
  url('Vegur-R_0500.ttf') format('truetype'),
  url('Vegur-R_0500.svg#Vegur-Regular') format('svg');
}
This will deliver one of four different font formats, depending on your browser’s capabilities. (The font is Vegur, a really nice-looking free font I found over at Font Squirrel).
By default, the MIME types in IIS 6 are configured to deliver EOT (as used by IE) and TTF files. But WOFF (Firefox) and SVG (iPhone, iPad & others) will not be served.
Simply add the following MIME type declarations via IIS Manager (HTTP Headers tab of website properties):
.woff  application/x-woff
.svg   image/svg+xml
…and everything should work fine.

Thursday, April 26, 2012

WPF: Reference to bind the combobox selected item


Resource to Bind Combo box selected item
http://stackoverflow.com/questions/1306159/binding-combobox-selectedvalue-to-textbox

Create an implementation of IValueConverter
http://stackoverflow.com/questions/4956521/text-of-text-box-based-on-combobox-item-in-wpf