Skip to main content

Posts

Showing posts with the label VS 11

Using async in .NET 4.0

The new async and await keyword in C# 5  is just syntactic sugar. Behind the scenes the code got rewritten to a state machine implementation. As both of .NET 4.0 and .NET 4.5 are using the same CLR, it should be possible to use the async functionality in .NET 4.0 too. AsyncBridge The first thing you could try is AsyncBridge. It's a NuGet package that lets you use the real VS 11 C#5 compiler to write code that uses the async and await keywords, but to target .NET 4.0.  . You just add it to your project, and the compiler will pick it up and use it to implement async/await. The only requirement is that you also have Visual Studio 11 installed on your machine. The code is available here: https://github.com/OmerMor/AsyncBridge . It follows the same idea as LINQBridge , which let you use C# 3 LINQ, but only require .NET 2.0. Async Targeting Pack for Visual Studio 11 Another option you have (and an official one) is the Async Targeting Pack for Visual Studio 11 . (As the...

VSColorOutput

A colleague sent me the link to the following useful Visual Studio plugin: VSColorOutput . “VSColorOutput is a Visual Studio 2010/2011 extension that   can change the color of a line emitted to the output window based on specified rules. The rules consist of regular expressions. Rules map to classifications which in turn map to colors .” More information: http://blueonionsoftware.com/vscoloroutput.aspx Download: http://visualstudiogallery.msdn.microsoft.com/f4d9c2b5-d6d7-4543-a7a5-2d7ebabc2496

Goodbye Visual Studio macro’s, we will miss you…or not

For the people who have missed the news: In the next version of Visual Studio(Visual Studio 11) the macros automation feature is taken out. This includes macro record/replay, macro projects and the Macros IDE. Based on some usage data that showed that less than 1% of Visual Studio developers use this feature, they decided to not invest in this feature anymore and focus on other improvements instead. So starting from VS 11, if you want to automate some behavior in Visual Studio, you’ll have to create a Visual Studio extension. You have the following extension options at your disposal: Visual Studio Package: This is used for the older VSPackage style pugin-ins. Editor Classifier: Used for creating your own syntax highlighting Editor Margin: Used to adorn the margins in an editor window Editor Text Adornment: Used to adorn text within an editor window Editor Viewport Adornment: Used to place editor visuals relative to the editor’s visual surface [VB/C#] Item...

Windows 8 Metro: A better Grid application template

Brent Schooley prepared a Visual Studio template for Grid Applications that improves on the user and developer experience that Microsoft delivered in their Grid application template. Lets compare the out-of-the-box Visual Studio templates for Metro style apps: and the Better Grid Application template: To install the template, put the BetterGridApplication.zip file in Libraries\Visual Studio 11\Templates\ProjectTemplates\CSharp\Windows Metro style\1033\ and then restart Visual Studio. The template should now show up in the Visual C#\Windows Metro style category in the New Project window. Download the Better Grid Application template (.zip file, 81 KB)

Using oData feeds in Windows 8

The oData integration in Windows 8 Metro-Style applications is not yet at the level of other kind of applications. But to get you going Microsoft released a preview version of the client libraries for Windows 8 Metro-Style. How to use this version? As the “Add Service Reference” feature for oData in Visual Studio 2012 is not available yet, you’ll have to generate the client types manually. Open a command prompt as administrator and navigate to %windir%\Microsoft.NET\Framework\v4.0.30128 Run the following command : DataSvcutil.exe /uri: http://www.nerddinner.com/Services/OData.svc/ /DataServiceCollection /Version:2.0 /out:nerdDinnerClient.cs Afterwards you can create a Metro Style application and import the generated file. More information here: http://blogs.msdn.com/b/phaniraj/archive/2012/04/26/developing-windows-8-metro-style-applications-that-consume-odata.aspx

Unit testing Async code

.NET 4.5 introduces the async and await keywords allowing you to write asynchronous code in a synchronous matter. But how do I test this asynchronous code? Do I have to add Thread.Sleep() and other kind of erroneous structures everywhere to be able to validate this code? Visual Studio 11 makes this easy by supporting async testing out-of-the-box.  You can now include “async” keyword part of the test method, and the “await” keyword within the test method body. A sample:  [TestMethod] public async Task TestAsyncFunctionality() { var result= await GoOutAndCallMySlowWebservice(); Assert.IsNotNull(result); } That’s it!

Running your build server on Azure(continued)

I talked about running your build server on Azure before. Although this solution worked, it was a cumbersome and time consuming process. You had to install, manage, patch, etc the build machines yourself. Last week at VS Live, Brian Harry announced and demonstrated a better solution: a new cloud based build service for Team Foundation Service on Azure . With this new service, you can just use a pool of build machines that are manage in the cloud (though you can still install and manage build machines if you like). And, of course, you can do more than just build – like with on-premises TFS, you can run a default workflow that includes, compilation, testing, etc or you can create a custom workflow that does whatever you like. The new build service works by maintaining a pool of Azure VM roles that can expand and shrink as needed. When you start a build, a VM is allocated from the pool to run your build. Your build is run, the build output is copied off the build machine then the VM...

Updated DemoMates for Visual Studio 11 ALM Demos

Brian Keller announced the availability of updated DemoMates for the Visual Studio 11 Beta. A DemoMate is a Silverlight-based rendering of a software demo which can be used to easily learn a demo or show it to an audience (albeit in a strict, linear format). You can run these DemoMates online, or if you plan on using these in an environment where you might not always have Internet access then I suggest installing the offline version. Online: Agile Project Management in Team Foundation Server 11 Building the Right Software - Generating Storyboards and Collecting Stakeholder Feedback with Visual Studio 11 Diagnosing Issues in Production with IntelliTrace and Visual Studio 11 Exploratory Testing and Other Enhancements in Microsoft Test Manager 11 Making Developers More Productive with Team Foundation Server 11 Unit Testing with Visual Studio 11 - MSTest, NUnit, xUnit.net, and Code Clone Offline: (gets installed locally on your computer) Agile Pr...

Microsoft adds Mocking/Isolation support to Visual Studio 11

A lot has changed on the testing front inside Visual Studio 11.(If you want to know a good overview of all the changes: http://www.peterprovost.org/blog/post/Whats-New-in-Visual-Studio-11-Beta-Unit-Testing.aspx ). One interesting feature I noticed in this long list of changes is the introduction of their own isolation framework: The Visual Studio Fakes Framework “Microsoft Fakes is an isolation framework for creating delegate-based test stubs and shims in .NET Framework applications. The Fakes framework can be used to shim any .NET method, including non-virtual and static methods in sealed types.” Wow! As it also will support to fake both non-virtual and static methods, I can finally isolate some of the harder to (unit)test parts of the .NET ecosystem. The Fakes framework helps developers create, maintain, and inject dummy implementations in their unit tests. It provides two ways to do this: Stub types Stub types make it easy to test code that consumes interfaces or ...

Visual Studio 11(beta) ALM Virtual Machine and Hands-on-Labs/Demo Scripts

My shortest post ever . With the beta release of Visual Studio 11, the Visual Studio 11 ALM Virtual Machine has also been updated, along with all of the hands-on-labs and demo scripts. Get the updated VM here !

Just announced: TFS Express

Just before the availability of  VS/TFS 11 Beta, Microsoft introduces a new download of TFS, called Team Foundation Server Express , that includes core developer features: Source Code Control Work Item Tracking Build Automation Agile Taskboard and more… It’s a FREE version of TFS for individuals and teams of up to 5 users. The Express edition is essentially the same TFS as you get when you install the TFS Basic wizard except that the install is trimmed down and streamlined to make it incredibly fast and easy. In addition to the normal TFS Basic install limitations (no Sharepoint integration, no reporting), TFS Express: Is limited to no more than 5 named users. Only supports SQL Server Express Edition Can only be installed on a single server (no multi-server configurations) Includes the Agile Taskboard but not sprint/backlog planning or feedback management. Excludes the TFS Proxy and the new Preemptive analytics add-on. More users c...