This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
// Just try to check whether the actual service instance can be created. | |
var svc = container.GetExportedValue<AppStoreServiceImpl>(); | |
Debug.Assert( | |
svc != null, | |
"container.GetExportedValue<AppStoreServiceImpl>() != null"); | |
} | |
catch (CompositionException ce) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When testing in an NLB environment, it's helpful to test | |
// with a WCF client which doesn't reuse open TCP connections | |
// for HTTP... | |
var bindingElements = wcfBinding.CreateBindingElements(); | |
var httpBe = bindingElements.OfType<HttpTransportBindingElement>().FirstOrDefault(); | |
if (httpBe != null) | |
{ | |
httpBe.KeepAliveEnabled = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Binding DisableRequireSecurityContextCancellation(Binding binding) | |
{ | |
var bindingElements = binding.CreateBindingElements(); | |
var securityBindingElement = bindingElements.OfType<SymmetricSecurityBindingElement>().FirstOrDefault(); | |
if (securityBindingElement == null) | |
{ | |
throw new NotSupportedException("Cannot locate SymmetricSecurityBindingElement"); | |
} | |
var protectionTokenParameters = securityBindingElement.ProtectionTokenParameters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<WebRole name="Cloud.WebRole" vmsize="Small"> | |
<Sites> | |
<Site name="Web"> | |
<VirtualApplication name="App1" physicalDirectory="..\Site.App1" /> | |
<VirtualApplication name="App2" physicalDirectory="..\Site.App2" /> | |
<VirtualApplication name="App3" physicalDirectory="..\Site.App3" /> | |
<VirtualApplication name="App4" physicalDirectory="..\Site.App4" /> | |
<Bindings> | |
<Binding name="HttpPort80" endpointName="HttpPort80" /> | |
<Binding name="HttpsPort443" endpointName="HttpsPort443" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<sources> | |
<source name="System.ComponentModel.Composition" switchValue="All"> | |
<listeners> | |
<add name="fileListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="composition.log" /> | |
</listeners> | |
</source> | |
</sources> | |
<trace autoflush="true"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IEnumerable<string> allNames = new List<string> | |
{ | |
"deployment(400).GenericWorkerRole.Cloud.WebRole.0_Web", | |
"deployment(400).GenericWorkerRole.Cloud.WebRole.1_Web", | |
"deployment(400).GenericWorkerRole.Cloud.WebRole.2_Web", | |
"deployment(400).GenericWorkerRole.Cloud.WebRole.3_Web", | |
"deployment(400).GenericWorkerRole.Cloud.WebRole.4_Web" | |
}; | |
Func<string, string> escapeMutexName = instanceId => instanceId.Replace("(", ".").Replace(")", ".").Replace(".", ""); | |
allNames = allNames.Select(escapeMutexName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Net; | |
namespace curry | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var url = "http://www.microsoft.com/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Recurse -Force -Filter Thumbs.db | foreach ($_) { Remove-Item -Force -Path $_.fullname } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MEFExistingInstanceInjection | |
{ | |
using System; | |
using System.ComponentModel.Composition; | |
using System.ComponentModel.Composition.Hosting; | |
/// <seealso href="http://stackoverflow.com/questions/7684766/is-it-possible-to-inject-an-existing-instance-into-a-mef-plugin"/> | |
class MEFExistingInstanceInjectionSample | |
{ | |
static void Main(string[] args) |
OlderNewer