Skip to main content

Posts

Showing posts from November, 2012

WPF 4.5: Airspace problem solved(...or not)

The airspace problem was one of the most annoying issues when integration a Win 32 component(like WinForms) with WPF. The problem is that each render technology belongs to only one airspace only. So when you place Win32 components in your WPF application they behave as a black hole for input leading to all kind of issues. I blogged about this issue before and even showed a possible workaround . With WPF 4.5 the issue is finally solved! To do this 2 extra properties are added to the HwndHost class(the base class for WindowsFormsHost ): IsRedirected and CompositionMode . IsRedirected: Set this property to true to solve the airspace problem. (It’s not enabled by default.) CompositionMode: Specified how deep the integration should go. It has multiple possible values: None : this is the default behavior and no integration is done: the airspace problems are still here. OutputOnly : The airspace problem are solved but the user (and the input system) can’t interact with the hosted

Windows 8 Wireframe Templates for PowerPoint

If you don’t have access to the new Storyboarding features in Powerpoint, don’t worry. Andreas Wulf released a free set of Windows 8 Wireframe Templates for Powerpoint . Using these templates, you can quickly put together a Windows 8 app layout and iterate on it. All elements in the set are based upon regular PowerPoint vector shapes, and are fully editable and customizable. The wireframing set is available as a .pptx file (for PowerPoint 2007 or newer) that you can download using the link below: Download Windows 8 Wireframing Set for PowerPoint (.pptx, 0.5 mb) Thanks Andreas! Some screenshots: Example grid page displaying item previews arranged in groups. Example page displaying details for a single group with previews for each item in the group. Example page displaying one item in detail. Example page displaying a list of items and the details for the selected item. Example of a Metro app in snapped view state. Collection of common

Testing Responsive Web Design

Last week I discovered the Responsive Web Design Testing Tool by Matt Kersley . This tool has been built to help with testing your responsive websites while you design and build them. You can enter your website's URL into the address bar at the top of this page (not your browser's address bar) to test a specific page. The output will be rendered in different resolutions, giving you a quick overview of the design on different resolutions.

Installing the Web Deploy 3 publish components for Visual Studio 2010

I talked about some of the great features of Web Deploy 3 before. But how do you get the new publishing experience in Visual Studio 2010? It took me some to figure out what software should be installed. You’ll need the following component: Web publish 1.1 forVS 2010 The easiest way to get this software is by using the Web Platform Installer. Download it here or open it if you already installed it before. Go to the Products tab and search for Microsoft Web Publish 1.1 for Visual Studio 2010. Click on Add and start the installation by clicking Install. Once the installation has completed, you’ll see the new and improved Web Publishing wizard when you click Publish in a web application.

Getting DB2 .NET Provider to work on Windows 8(64bit)

With every new releases of the Microsoft OS, I’ll have to go through the same pain to get the DB2 providers working. IBM seems not able to release a driver that works out-of-the-box. So what are the hacks this time to get it working? Start with a normal installation of the DB2 client on your system(don’t forget to run as an administrator). The installation will end successfully but  when you try to connect to a DB2 database, you’ll probably get an error similar to this one: “sql1159 initialization error with db2 .net data provider reason code 7”   Go to Start -> Programs -> Visual Studio -> Developer Command Prompt. Open the prompt as an administrator Add the following assemblies to the GAC using gacutil: gacutil /if "C:\Program Files\IBM\SQLLIB\BIN\netf40\IBM.Data.DB2.dll" gacutil /if "C:\Program Files\IBM\SQLLIB\BIN\netf40\IBM.Data.DB2.entity.dll" gacutil /if "C:\Program Files\IBM\SQLLIB\BIN\netf40\

IIS 8.0 Application Initialization module

I talked about the application pool ‘auto-start’ feature before. In IIS 8 it is renamed to Application Initialization module. Activating it allows you to enable the following capabilities: Starting a worker process without waiting for a request (AlwaysRunning) Load the application without waiting for a request (preloadEnabled) Show a loading page while the application is starting To enable these features Set the startMode on the application pool  to AlwaysRunning . <system.applicationHost> <applicationPools> <add name="DefaultAppPool" autoStart="true" startMode="AlwaysRunning" /> </applicationPools> </system.applicationHost> Set preloadEnabled to true on the web application. <system.applicationHost> <sites> <site name="Default Web Site" id="1"> <application path="/"> <virtualDirectory path="/&q

Free e-book: Testing for Continuous Delivery with Visual Studio 2012

Looking for a good book about testing with Visual Studio 2012? Microsoft released the free Testing for Continuous Delivery with Visual Studio 2012 e-book . “This book is aimed at test engineers, managers, developers, and folks interested in understanding the changing world of test. Over the last several years, software testing has changed a great deal. In the past, test plans were on paper, filed away and out of sight. Today they are—or can be with Visual Studio—living documents, as manual and automated tests are integrating into the test workflow supported by the test infrastructure. Today you no longer have to set up physical boxes; instead you can set up and automate virtual environments composed of virtual machines to meet your testing environment needs. With Visual Studio and Team Foundation Server, the pain of dealing with a heterogeneous test infrastructure is reduced, the cost and effectiveness of testing a product is improved, and regression testing becom

Windows 8 System Info

I talked about uniquely identifying a Windows 8 device before. Last week I stumbled over this post by Rene Schulte .  In this post he creates the SystemInformation class. This class gathers some useful information about the current system and dumps it in a string: using System; using System.Globalization; using System.IO; using System.Net.NetworkInformation; using System.Runtime.InteropServices.WindowsRuntime; using System.Text; using System.Threading.Tasks; using Windows.ApplicationModel; using Windows.ApplicationModel.Store; using Windows.Devices.Enumeration; using Windows.Devices.Input; using Windows.Graphics.Display; using Windows.Networking.Connectivity; using Windows.Security.ExchangeActiveSyncProvisioning; using Windows.Storage; using Windows.System.Profile; using Windows.System.UserProfile; using Windows.UI.Xaml; namespace Schulte.Xaml.Windows { public class SystemInformation { public static async Task<string> Dump(bool shouldDumpCompleteDeviceInfos = false

ASP.NET Web API REST Guidance

ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework. Josh Reuben did a great job creating a guide of how to leverage Web API to construct a RESTful frontend API. This guide contains the following topics: The Advantages of REST Methodology over SOAP General RESTful API Design Overview ASPNET WebAPI Considerations Overview Design Routing Response Customization Validation Config Documentation generation Plugging into the Message Handler pipeline Exception Handling Cookie Management Internet Media Types, formatters and serialization True oData support Self-hosting Tracing Security A must read for every Web API developer!

New Visual Source Safe Upgrade Tool

Microsoft released a new version of the Visual Source Safe Upgrade tool. The tool provides a Wizard Based UI for upgrading Visual Source Safe repositories to Team Foundation Server 2012, 2010 or Team Foundation Service ( http://tfs.visualstudio.com/ ) It supports upgrading the following components from Visual SourceSafe to Team Foundation Server (TFS) version control: Code projects Files Version history Labels User information Documentation can be found at: http://msdn.microsoft.com/en-us/library/ms253060.aspx Download it from the Visual Studio Gallery: http://visualstudiogallery.msdn.microsoft.com/867f310a-db30-4228-bbad-7b9af0089282

Team Foundation Server 2012 Illustrated Install Guide

Installing Team Foundation Server can be a daunting task. To help you in the process, Benjamin Day created an illustrated guide that walks you through the process of installing Team Foundation Server 2012 (TFS2012), the TFS2012 Build Service, System Center Virtual Machine Manager 2012, and TFS Lab Management. You can download the install guide as a Word document and as a PDF or watch it online .

Need help to remember Visual Studio Shortcut Keys: IntelliCommand

For a developer being productive in it’s development environment is of the uppermost importance. One thing to make you more productive is knowing all(or some) keyboard shortcuts. Before I printed out the Visual Studio keybinding posters , but now I found a better alternative:   IntelliCommand . From the Visual Studio Gallery : “IntelliCommand - an extension for Visual Studio 2010 and 2012 which helps to find the short keys. It shows the help windows with all possible combinations when you press Ctrl or Shift or Alt or their combinations (hold it for about 2 seconds to see this window). Also it shows the list of possible combination when you press first combination of chord shortcut keys, like Ctrl+K, Ctrl+C (this combination comments selected text in editor).” Intelli Command shows all available shortcut keys for combination of Control + Shift after couple seconds: Ctrl+K was pressed. Visual Studio waits for second combination:

Team Foundation Services is released

Last week Microsoft announced the release of Team Foundation Service. The new url for the service is http://tfs.visualstudio.com .  Read more about it on the service web site here: http://tfs.visualstudio.com/en-us/home/news/ . I got a lot of questions about the pricing strategy for this product. Microsoft revealed some information about their pricing strategy but for the complete information about paid plans and services, you’ll have to wait until 2013. At the moment Team Foundation Service includes a free usage plan with a robust set of features that make it quick and easy for individuals and lean teams to get started with this application lifecycle management (ALM) platform. The free plan includes support for up to 5 users, an unlimited number of projects, version control, work item tracking, agile planning tools, feedback management, and build (the last of which is still in preview). In addition, MSDN subscribers at the Visual Studio Test Pro with MSDN, Visual Studio Premium

ASP.NET MVC: The length of the string exceeds the value set on the maxJsonLength property.

Last week one of our users reported a bug that they got an exception back when loading a big set of data. When looking at the exception logs, we saw that the following InvalidOperation exception was thrown: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Some people suggested to set the maxJsonLength property in the web.config to a higher value, but this value is not used by ASP.NET MVC <system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="100000"/> </webServices> </scripting> </system.web.extensions> We solved the issue by creating our own Actionresult inheriting from the existing JsonResult class based on the information in this post : public class LargeJsonResult:JsonResult { const string JsonRequestGetNotAllowed = "This request has been blocked because se

Windows 8 Tiles: The tile template catalog

The Windows 8 ecosystems offers you a broad set of tiles to improve the user experience. I always forget the list of available templates so this one is for me; a link to the tile template catalog so I can never forget the list of available options: http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx . The template catalog lists the tile templates available for use in a tile notification, with pictorial examples of each together with their XML content. Note that when they are displayed on a computer set to a right-to-left (RTL) language, templates are flipped from their left and right descriptions here. In the static or peek templates that display an image collection, the larger square image is not quite square; it is slightly wider than it is tall. If you supply a square image, the image will be scaled for width and slightly cropped on the top and bottom.

Reporting Services error: Maximum request length exceeded

Last week a colleague asked me to have a look at a Reporting Services problem. The reporting server returned the following error message when she tried to upload a report: Error : There was an Exception running the extension specified in the config file –> maximum request length exceeded. The problem started to occur after she added a large image to the report. By doing this the report size became too big and the report server started to complain that we are sending more data than it is configured to accept. Fixing this is similar to every other web application, do this by changing the web.config. This config file can be found on the following path: C:\Program Files\Microsoft SQL Server\MSRS10_50.SQLEXPRESS\Reporting Services\ReportServer Open the config file and find the following line: < httpRuntime executionTimeout = "9000" /> Add a maxRequestLength attribute in there to fix the problem: < httpRuntime executionTimeout = "90

Show deleted items in Visual Studio Team Foundation Source Control

By default when you delete an item from TFS source control, it’s not really deleted. Instead it’s marked as deleted and no longer visible in source control but it’s not deleted from the TFS database. (If you really want to delete something from the database, you can use the TFS Destroy command . But what if you want to “undelete” a deleted item? To allow this, we first have to show those deleted items in Source Control Explorer. Inside Visual Studio, go to “Tools-Options”, select “Source Control-visual Studio Team Foundation Server” and check the “Show deleted items in the Source Control explorer”.

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 problem didn’t occur on all systems. On my system everything still worked

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

Setting up sliding sessions in Windows Identity Foundation(WIF)

By default a WIF security token is only valid for a certain time. However this token does not work with a sliding expiration out-of-the-box. This means that, no matter if the users is actively using the application or not, once the time interval has expired, the token is invalidated and the user has to login again. Although this seems logical from a security standpoint, it’s not very user friendly. Users expect that as long as they are using the application, their authentication session remains valid. So how can we achieve sliding expiration in WIF? Create a new class that inherits from SessionAuthenticationModule : public class SlidingAuthenticationModule : SessionAuthenticationModule { } Register for the SessionSecurityTokenReceived event in the constructor: public SlidingAuthenticationModule { this.SessionSecurityTokenReceived += SessionSecurityTokenReceived; } void SessionSecurityTokenReceived(object sender, SessionSecurityTokenReceivedEventAr