Skip to main content

Posts

Changing the WCF Data Service request headers

The WCF Data Service client component works great out-of-the-box. However for a project we wanted to send some extra header data which each request. On the server-side we could handle this by adding a custom WCF behavior on top of the data service, but on the client side this is not possible. How can we do this on the client side? The MSDN site brought the answer: http://msdn.microsoft.com/en-us/library/gg258441.aspx The DataServiceContext exposes a SendingRequest event. By subscribing to this even we can add a new header to the request message before it is sent to the data service. // Create the DataServiceContext using the service URI. NorthwindEntities context = new NorthwindEntities(svcUri); // Register to handle the SendingRequest event. context.SendingRequest += new EventHandler<SendingRequestEventArgs>(OnSendingRequest); The following method handles the SendingRequest event and adds an Authentication header to the request. private static void OnSendingRequest(obj...

MSBuild Extension Pack–October 2012 Release

Good news for everyone who wants to get the most out of their build environment. A new release is available of the MSBuild Extension Pack . This release contains around 40 new Tasks/ TaskActions. Some information from the CodePlex site : The MSBuild Extension Pack provides a collection of over 475 MSBuild Tasks, MSBuild Loggers and MSBuild TaskFactories. A high level summary of what the tasks currently cover includes the following: System Items: Active Directory, Certificates, COM+, Console, Date and Time, Drives, Environment Variables, Event Logs, Files and Folders, FTP, GAC, Network, Performance Counters, Registry, Services, Sound Code: Assemblies, AsyncExec, CAB Files, Code Signing, DynamicExecute, File Detokenisation, GUID’s, Mathematics, Strings, Threads, Xml, Zip Files Applications: BizTalk 2006 / 2009, Email, IIS6, IIS7, MSBuild, SourceSafe, SQL Server 2005, SQL Server 2008, StyleCop, Subversion, Twitter, Team Foundation Server, Visual Basic 6, Windows Virtual PC, ...

An update on runAllManagedModulesForAllRequests.

I talked about disabling the runAllManagedModulesForAllRequests setting in your web.config before. It seems that the story is a little bit more complex then I thought. Rick Strahl’s wrote a great article about some of the caveats of with the runAllManagedModulesForAllRequests in IIS 7/8 . He mentions that setting the runAllManagedModulesForAllRequests=”false”  has a different behavior as I originally expected. I expected that non-ASP.NET requests no longer passes through the ASP.NET Module pipeline. But that's not what actually happens. Rick gave the following sample: If you create a module like this: <add name="SharewareModule" type="HowAspNetWorks.SharewareMessageModule" /> by default it will fire against ALL requests regardless of the runAllManagedModulesForAllRequests flag. Even if the value runAllManagedModulesForAllRequests="false", the module is fired with unmanaged requests going through it. So what is the runAllManagedModulesF...

Click Once certificates stopped working after a Windows Update

At a customer we are using Click Once to deploy our Windows Client Applications. These applications are signed by a certificate to improve security and differentiate between the available environments(we’ve created a different certificate for each environment). This all worked fine for years until 2 weeks ago. Developers started to complain that they could no longer publish their application using these certificates. They got the following error in Visual Studio: Error     4          An error occurred while signing: Failed to sign bin\x86\Acceptatie\app.publish\\setup.exe. SignTool Error: The signer's certificate is not valid for signing. SignTool Error: An error occurred while attempting to sign: bin\x86\Acceptatie\app.publish\\setup.exe   AppName The certificates were still valid, their were not revoked or expired, the root certificate was available and trusted… To make it even stranger, the prob...

Get the table size in SQL Server

Last week I noticed that our TFS database size was getting out-of-control. So I decided to have a look at what tables consumed the most disk space. SQL Server makes this easy by providing a built-in stored procedure that shows the size of a table, including the size of the indexes: sp_spaceused ‘Tablename’ A sample:

Windows Azure Poster

Looking for a new bedroom poster, or you just want to have a nice overview of all the components of Windows Azure? Microsoft released the Windows Azure Poster .

Callisto: A control toolkit for Windows 8 XAML applications.

Building Windows 8 applications can be hard, there is a lot of stuff you need to implement to pass the Application Certification process. So every tool,framework or library that can help you save some time and focus on the application experience itself is more then welcome. One of these libraries is Callisto . If we look on the project page on GitHub, we’ll find following information: What Is It? Callisto is a library for use in Windows 8 XAML applications (aka Metro style apps). The XAML framework in Windows.UI.Xaml is great, but has some functionality that isn't provided in-the-box in a few controls and APIs. Callisto provides added functionality on top of the XAML UI framework for Windows. What's In It? So far Callisto includes: Flyout - a primitive that includes positioning and 'light dismiss' logic NumericUpDownControl - a "spinner" control for numeric values WatermarkTextBox - derivative of TextBox that adds only the functiona...