Skip to main content

Posts

Showing posts with the label VS 2012

NUnit Test Adapter - BadImageFormatException

Yesterday I mentioned that my NUnit tests were not discovered when I set the Build Target to ‘x64’ and that I had to change it to ‘Any CPU’ to be able to run my tests. However this only solved part of my problem as my tests started to fail with the following error message: In theses tests I’m using Noesis.Javascript, a .NET wrapper around Google’s V8 Javascript engine, that allow you to execute scripts directly from .NET code. Noesis.Javascript.dll needs the Microsoft Visual C++ Libraries and to use them, you have to set your Compiler target to a specific platform(x86 or x64). So back to start… After some research, I found a solution: Inside Visual Studio, click on Test –>Test Settings –>Default Processor Architecture This was set to X86. Changing it to X64 solved my problem.

NUnit Test Adapter–No tests found to run

Today I discovered an annoying bug in the NUnit Test Adapter , a Visual Studio extension that integrates NUnit test execution in the IDE. I created some new tests for a specific library, however when I tried to load and run my tests, nothing happened. Inside the output window I noticed the following message: What was causing the issue? When I looked at the Build settings for my test project, I saw that the Compiler platform was set to x64. After changing it to AnyCPU , my tests were discovered…

TypeScript build server error: "tsc.exe" exited with code 1.

After configuring a Continuous Integration build for a TypeScript enabled web application, the build turned red with the following error message: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\TypeScript\Microsoft.TypeScript.targets (118): "tsc.exe" exited with code 1. On the build server I had installed the TypeScript components for Visual Studio 2013 , but for this particular project we were still using Visual Studio 2012. I was able to fix the problem by installing the TypeScript 1.0 Tools for Visual Studio 2012 on the build server.

SpecFlow: Visual Studio does not recognize steps in another assembly

On my current project we are using SpecFlow to create our BDD style tests. I really like the experience so far. One of the things that you have to understand when using SpecFlow is that the end goal is a set of re-usable steps that allow you to specify new scenario’s (and tests) fast. In our case we already have a set of steps that we want to re-use in multiple test projects. Therefore I created a separate assembly where I put some of my shared steps classes.This is a supported scenario inside Specflow, the only thing you need to do is to specify the assembly name inside your app.config: <specFlow>     <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->     <stepAssemblies>       <stepAssembly assembly="Tests.SharedSteps" />     </stepAssemblies>     <unitTestProvid...

Nice Visual Studio Add-in: File nesting

File Nesting is a feature in Visual Studio that was available for a long time. It allows you to put multiple files together under one ‘root’ file. This is a feature you’ve certainly seen in WinForms(designer generated code and codebehind), ASP.NET WebForms(HTML page and codebehind) and so on… Unfortunately to use this feature yourself, you had to start editing the .csproj files yourself. Not the best way to start using a feature! Thanks to Mads Kristensen File Nesting plugin this is no longer necessary and you can easily nest any file under another file in Solution Explorer. What makes it even nicer, is that File Nesting also gives you the option to automatically nest based on file naming rules. You can then apply those rules to any files, folders or entire projects. Install the plugin through the Visual Studio Extensions or download it here: http://visualstudiogallery.msdn.microsoft.com/3ebde8fb-26d8-4374-a0eb-1e4e2665070c . Thanks Mads!

TypeScript error in Visual Studio 2012: microsoft.typescript.default.props not found

On a recent project, some developers are using Visual Studio 2012 and some are using Visual Studio 2013. We had no problems mixing Visual Studio versions until we started using TypeScript. After adding a TypeScript file in Visual Studio 2013, the project starts throwing errors when we open it in Visual Studio 2012: Microsoft.TypeScript.Default.props not found It seems there are backwards compatibility issues when using a TypeScript project. It adds an import, microsoft.typscript.default.props. which doesn't exist in VS 2012. To fix the problem, unload the project and edit the csproj file. Find the line that imports the Microsoft.TypeScript.Default.props and add an extra condition: <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion

An incompatible DacFx version is installed

When trying to connect to a SQL Server Database using Visual Studio 2012, I was welcomed by the following error message: I recently installed the SQL Server Data Tools – BI package which is not the same as the SQL Server Data Tools itself(always fun to use confusing names). This seemed to have messed up my Visual Studio Installation. Luckily you can fix it by installing the latest version of the SQL Server Data Tools – October 2013 Update .

Team Foundation Server: Error when creating a new Team Project

A customer forwarded me the following error message they got when trying to create a new Team Project in TFS 2012: Error TF30169: The New Team Project Wizard was unable to download the process template MSF for Agile Software Development v5.0. Explanation The New Team Project Wizard encountered an unexpected error while attempting to download the process template. The download returned the following error: The process cannot access the file 'C:\Users\username\AppData\Local\Temp\TPW_tmp931A.tmp\Build\Templates\' because it is being used by another process. User Action Contact your Team Foundation Server administrator. I was able to solve it by clearing the Visual Studio Team Explorer cache. Execute the following steps: Close Visual Studio if it’s open Delete the Team Foundation cache on the client (be careful, delete the content of the folder only, not the cache folder itself) C:\Users\<yourusername>\Local Settings\...

Help! The Microsoft BIDS are gone?!

After doing a clean install of my pc I also wanted to install the BIDS(=Business Intelligence Designer Studio) to start some Microsoft Report Services development. But I couldn’t find a version for Visual Studio 2012? So where did it go and how should I develop SSIS, SSRS and SSAS stuff using VS 2012? I discovered that with the 2012 release of SQL Server, the BIDS plugin for Visual Studio was renamed to SSDT, SQL Server Data Tools. SSDT is available for both Visual Studio 2010 and 2012. You no longer need the SQL Server installation media to install it but instead you can just download it from the Microsoft Download Center : You can use this version of the Data Tools to develop applications for both SQL 2008, SQL 2008 R2 and SQL 2012(and of course SQL Azure). After installing it, some new templates are added to your Visual Studio:

ASP.NET MVC 4: Error when using anti-forgery token in combination with claims-based authentication

Enabling Claims Based authentication on your ASP.NET MVC project is easy: Create a new ASP.NET MVC web application Right click on the project and choose the Identity and Access… option(if you don’t see this option, make sure that you have the Identity and Access Tool extension installed) Walk through the configuration wizard and… done! But when I tried to do this on a new project, it failed with the following error: “A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is providing both of these claims on the ClaimsIdentity instances it generates. If the configured claims provider instead uses a different claim type as a unique identifier, it can be configured by s...

Visual Studio: Speed up your build time

One of the options that people overlook in Visual Studio, is the ability to build multiple projects in parallel. This can give you a huge improvement in build time, so it’s certainly a good idea to try to change this number. You can find this option under Tools –> Options –> Projects and Solutions –> Build and Run :

Team Foundation Server: Map different branches to the same folder using the SAK

Last week when giving a Team Foundation Server for Administrators course, I got a great tip from one of the students(thanks Guy!). Let’s first set the scene and explain the situation. For every release they make a new branch is created(and they do a lot of releases). By default every branch is mapped to a different folder so if you don’t clean up your workspace you end up with lots of folders each containing a specific (released) version of the source code. Because they only need one release on disk at a time, they decided to update the workspace mapping to put the active release in a ‘Release’ folder on their local disk. So with every new release, they update the mapping and map a different release to this ‘Release’ folder. Everyone is still with me? Now the problem is that when they try to load the solution in the release folder, Visual Studio gets confused and gives the following message: There appears to be a discrepancy between the solution's source control information ab...

Guidelines for Migrating an Application Built Using WIF 3.5 to WIF 4.5

When going from WIF 3.5 to 4.5 a lot of (breaking) changes were introduced. To help you walk through the migration process, Microsoft created 2 useful articles on MSDN: Guidelines for Migrating an Application Built Using WIF 3.5 to WIF 4.5 Namespace Mapping between WIF 3.5 and WIF 4.5 From the article: Windows Identity Foundation (WIF) was originally released in the .NET 3.5 SP1 timeframe. That version of WIF is referred to as WIF 3.5. It was released as a separate runtime and SDK, which meant that every computer on which a WIF-enabled application ran had to have the WIF runtime installed and developers had to download and install the WIF SDK to get the Visual Studio templates and tooling that enabled development of WIF-enabled applications. Beginning with .NET 4.5, WIF has been fully integrated into the .NET Framework. A separate runtime is no longer needed and the WIF tooling can be installed in Visual Studio 2012 by using the Visual Studio Extensions Manager. This v...

Yelo TV for Windows 8 released

Normally I don’t talk about the exact projects I’m doing for customers. Mostly because the larger part of these applications are build for internal using. But for once I make an exception. Last week Telenet , a Belgian Telecom company, released YeloTV for Windows 8 (announcement in Dutch ). I’m proud to be part of the team that created this application(although I have to admit I only contributed a small Windows Azure component to the application) It’s a good example of how to build a great touch friendly Windows 8 app. Congratulations to the whole team!

Microsoft Code Digger

Microsoft Research released their first extension for Visual Studio 2012: Code Digger . Code Digger analyzes possible execution paths through your .NET code. The result is a table where each row shows a unique behavior of your code. The table helps you understand the behavior of the code, and it may also uncover hidden bugs. Through the new context menu item " Generate Inputs / Outputs Table " in the Visual Studio editor, you can invoke Code Digger to analyze your code. Code Digger computes and displays input-output pairs. Code Digger systematically hunts for bugs, exceptions, and assertion failures. You can also try the functionality online through Pex4Fun . Remark: At the moment Code Digger only works on public .NET code that resides in Portable Class Libraries. This limits its usefulness at the moment.

Get rid of the ‘Missing XML comment for publicly visible type or member’ warning

For a long time, I had the (good?) habit to document all my public API’s. But keeping the documentation up-to-date has always been a long and boring task. After a discussion with my fellow developers, I decided to stop adding documentation. Most developers said they don’t look at the documentation but just read the code or  have a look at my unit tests to understand what’s going on. After removing all the documentation, I’m left with a long list of warnings inside my application complaining about ‘Missing XML comment for publicly visible type or member’ .  How to remove these warnings? There are 2 ways to remove these warnings: Turn off the comment generation: Go to the Project properties(Right click on your project and choose Properties from the context menu) Go to the Build tab Uncheck the XML documentation file checkbox Repeat this for every project in your solution Disable the warning: Go to the Project...

UnitTestIsolationException when using ReSharper

In a previous post I introduced the Microsoft Fakes framework. However when I tried to use this framework inside my tests, they always failed with the following message: Microsoft.QualityTools.Testing.Fakes.UnitTestIsolation.UnitTestIsolationException: UnitTestIsolation instrumentation failed to initialize. Please restart Visual Studio and rerun this test   I discovered that it failed because I was running my tests through the ReSharper test plugin. When I used the Visual Studio Test runner instead, everything worked fine… Anyone who knows how I can get this working using ReSharper?

Visual Studio 2012: Testing the untestable using Microsoft Fakes

Testing the untestable To test your code in isolation, Mocking frameworks like RhinoMocks or Moq are an important tool in your toolbox. By using an isolation(mocking) tool, you can replace an existing object by a ‘fake’ implementation. Unfortunately these tools cannot help you solve everything. If your system is not designed with testing in mind, it can be very hard or even impossible to replace an existing implementation with a mock object. Let’s for example take DateTime.Now .  This is a static property on a static class, how are you going to replace this? Let’s have a look how Microsoft Fakes , the isolation framework that Microsoft introduced in Visual Studio 2012. Microsoft Fakes Microsoft Fakes help you isolate the code you are testing by replacing other parts of the application with stubs or shims. A stub replaces another class with a small substitute that implements the same interface. To use stubs, you have to design your application so that each c...

Team Foundation Server 2012: create a direct link to a work item

Team Foundation Server always allowed you to directly browse to a specific work item by calling a very specific URL. In Team Foundation Server 2012, this URL has changed to http://tfsservername:8080/tfs/web/wi.aspx?pcguid={collectionguid}&id={workitemid} Replace the {workitemid} part by the id of the work item and the {collectionguid} part by the GUID of your TFS collection. How to get this collection GUID? The easiest way to know the collection GUID(without querying the TFS configuration database directly) is to follow the steps below: Open Team Explorer Connect to the TFS collection you want to use Open a work item in this collection(doesn’t matter which one) Right click on the work item and choose Copy Full Path   Paste the path into notepad and you’ll find the correct GUID