Skip to main content

Posts

Showing posts from February, 2013

Web Deploy Improvements in ASP.NET and Web Tools 2012.2 Update

Last week Scott Guthrie announced the release of the ASP.NET and Web Tools 2012.2 Update. This release not only offers some really nice new features for ASP.NET WebForms, ASP.NET MVC, ASP.NET Web API, SignalR and the web tooling in Visual Studio, but also adds some nice improvements to Web Deploy . (For the full list of new features, have a look at the release notes ).  What’s new? First of all, Web site projects now have the same publishing experience as Web Application projects including publishing to Windows Azure Web Sites.  Selective publish – for one or more files you can perform the following actions (after publishing to a Web Deploy endpoint): Publish selected files. See the difference between a local file and a remote file. (this even works for images!) Update the local file with the remote file or update the remote file with the local file. Apply config transformations on the publish profile next to the build profile.

SQL Server 2012 Data Quality Services

One of the hardest parts of a DBA’s job, is keeping the data quality of the databases good over time. You would expect that only correct data is entered into the system, but we are all humans, so mistakes happen… A powerful tool that  can help your DBA’s detect and prevent data quality issues is Microsoft SQL Server 2012 Data Quality Services (DQS). DQS is a knowledge-driven solution that provides both computer-assisted and interactive ways to manage the integrity and quality of your data sources. DQS enables you to discover, build, and manage knowledge about your data. You can then use that knowledge to perform data cleansing, matching, and profiling. You can also leverage the cloud-based services of reference data providers in a DQS data-quality project. From MSDN : DQS provides the following features to resolve data quality issues. Data Cleansing: the modification, removal, or enrichment of data that is incorrect or incomplete, using both computer-assisted

Apply an XSL transformation and show the result in a web control

For an application we build for a customer, a new feature had to be added. The application calls a 3th party web service and logs all XML messages for auditing purposes. Now the users were asking for an easy way to see these XML messages in a more readable format, preferably nicely integrated into the application. This is a perfect fit for XSL transformations, so we decided to integrate a WebBrowser control into our application and load the XMLs after applying the XSL transformation.

TFS Administrators Toolkit

Last week, when listening to DotNetRocks , I heard about the TFS Administrators Toolkit . TFS Administrators Toolkit for VS2012 TFS Administrators toolkit is a set of tools primarily focused on easing the burdon of tfs admins Features and benefits Subscriptions List and filter existing subscriptions - server wide, Unsubscribe existing subscriptions. Find In Files Search for text or regexp in files (and all file versions) in source control. For more info please refer to http://mskold.blogspot.se/2012/09/find-in-files-new-feature-of-tfs.html Test Attachment Sizes List test attachment size per team project, what kind and extensions, Clean projects directly from the UI by calling Test Attachment Cleaner. For more info please refer to http://mskold.blogspot.se/2012/05/test-attachments-sizes-new-feature-of.html Update reports Push new reports from a template to selected team project. Update Work Item

Team Foundation Server 2012: The team project does not support Microsoft Feedback Client.

One of the new features in Team Foundation Server 2012, is the Microsoft Feedback Client ; an easy way to allow your users to give feedback on specific functionality of your applications. This all works fine when you created a new project in TFS 2012, but what if you want to use this feature on an existing project? I f you try to open the Feedback Client for an existing project, it will fail with a similar error message: The team project ProjectName does not support Microsoft Feedback Client. The team project configuration does not contain valid entry for 'Microsoft.FeedbackRequestCategory'. Contact your Team Foundation Server administrator. For more information, see http://go.microsoft.com/fwlink/?LinkId=223624 . How can we fix this? Open a command prompt Browse to the following location: C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE. Export the categories.xml file: witadmin exportc ategories /collection:" collection ur

Coming soon(hopefully): TfPlugable, a solution to dynamically deploy plug-ins for TFS

Team Foundation Server always offered a rich extensibility model. It is very easy to create your extensions. The only problem was how to get these extensions to your users. But this can change… Martin Hinshelwood started the idea to simplify this process(think ‘NuGet for Team Foundation Server Extensions’). These are the key integration points he wants to cover: TF Job – These jobs can be schedules or one off and run within the context of the TFS Server Itself. They are a compiled DLL that has to be deployed to a particular folder on the TF Server in order to be loaded and registered with TFS. TF Event Sink – Events are fired on the TF Server as a result of Work Item, Build, Source Code changes and implement the ISubscriber interface. Again they need to have the containing DLL dropped into the correct folder on the TF Server. Custom Controls – Sometimes you want to extend the UI of work items capability to display data and this requires both server side and client

Exclude a property from serialization

Last week I had to serialize a class. The important thing was that I wanted to serialize all values except one. Most of the time I use the following construct: The [NonSerialized] attribute is only supported on field types, so I had to find another solution. As I was serializing to XML, I decided to use [XMLIgnore] as an alternative:

Team Foundation Server Update 1: Viewing the Kanban board

With the release of Update 1 for Team Foundation Server 2012 , Microsoft added a Kanban board to the list of available features. But where can I find this feature? If I click on View board in the ACTIVITIES list on the team home page, I end up at the original task board. Same thing if I click on the board menu option that appears on the Product Backlog page. So how can I open the Kanban board? On your team's home page, choose View backlog to navigate to the product backlog page. Highlight Product Backlog in the explorer pane and choose the board tab. The Kanban board opens.The Kanban board automatically displays the top-ranked items in backlog priority order. Column titles will vary based on your process template. What’s nice is that you can limit the WIP(Work-in-Progress) per column. More information at: http://msdn.microsoft.com/en-us/library/vstudio/jj838789.aspx#ViewKanban

NHibernate: change command timeout

Every query you execute in NHibernate has a default timeout value. This timeout is set on every IDbCommands generated by NHibernate. Most of the time the default value is just fine, but sometimes you have this annoying query that just takes a little bit too much time. You have multiple options to change the timeout value. Global change If you want to change it for all queries in your application, you can configure the following value in your NHibernate configuration: command_timeout: Specify the default timeout of IDbCommands generated by NHibernate. Local change If you only want to change this for a specific query, you can set it using the SetTimeout method on ICriteria: or on QueryOver:

ASP.NET Web API HTTP Message Lifecycle Poster

Interested in ASP.NET Web API, but you have a hard time figuring out all the different components. This poster can help you understand what’s going on(maybe a good interview question ).  

Error when executing Unit Tests for Windows Store apps

When creating  unit tests for a Windows Store app,  the test runner always failed with the following error message: ------ Run test started ------ Creating a new clean layout... Copying files: Total 4 mb to layout... Registering the application to run from layout... Deployment complete. Full package name: "2c5c99b8-8b5d-4ed3-8e1e-f638b2312c72_1.0.0.0_neutral__0c27qnas074n4" Exception has been thrown by the target of an invocation. ========== Run test finished: 0 run (0:00:04,6740956) ========== If we try to attach the debugger to see where it goes wrong, it also fails:   We tried some things but nothing helped. In the end we found the solution on Stackoverflow . It seems that this can be caused if you start changing some stuff(yes some stuff, no exact indication what can cause it and what not) in the App.xaml file. In the StackOverflow answer they mention for example the following situations: Application tag in app.xaml setting any properties (lik

NUnit: Invalid signature for SetUp or TearDown method: SetUp

As Microsoft finally added out-of-the-box support for other Testing Frameworks to Visual Studio, I found it was time to move away from MSTest. I spend some time looking at xUnit but in the end I decided to go for NUnit . To convert all my tests I started with a  simple find and replaces to switch things like [TestMethod] to [Test] and [ClassInitializer] to [TestFixtureSetUp]. After everything was converted and compiling nicely I ran into a problem when executing the tests. Any test that used [TestFixtureSetUp] or [TestFixtureTearDown] were just being skipped by the test runner with the error: “Invalid signature for SetUp or TearDown method: SetUp” In the NUnit documentation I found the reason, MS Test uses static methods for its class initializer whereas NUnit requires instance methods. So I had to change: [TestFixtureSetUp] public static void SetUp() {...} to: [TestFixtureSetUp] public void SetUp() {...}

Portable Class Library Compliance Analyzer

I’m working on a cross platform application. To re-use most of the code we are refactoring the existing components to use the Portal Libraries . The Portable Class Library project in Visual Studio 2012 supports the cross-platform development of .NET Framework apps. Use this project to write and build portable assemblies that work without modification on multiple platforms, such as Windows 7, Windows 8, Silverlight, Windows Phone, and Xbox 360. For example, you can create classes that contain shared business logic for desktop apps, Windows Store apps, and mobile apps, and you can then reference those classes from your apps. The Portable Class Library project supports a subset of assemblies from the .NET Framework, Silverlight, .NET for Windows Store apps, Windows Phone, and Xbox 360, and provides a Visual Studio template that you can use to build assemblies that run without modification on these platforms. If you don't use a Portable Class Library project, you must targ

SQL Server Reporting Services: The feature: "Scale-out deployment" is not supported in this edition of Reporting Services.

When restoring a SQL Server Reporting Services database to a new server, the service didn’t want to start. Instead I got the following error message: “The feature: "Scale-out deployment" is not supported in this edition of Reporting Services.” When I was checking the report server configuration manager, I found out that in the Scale Out SSRS deployment both the new server and old server were listed. To clean up the scale out deployment configuration and remove the old server I had to do the following: Open a command prompt. Browse to the following path C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\ List the report servers found in the database type using the following command: RSKeyMgmt –l A list of servers with their GUID is shown. Note the GUID of the server that you want to remove. Remove the instance by using the following command: RSKeyMgmt -r GUIDoftheSSRSserverTobeRemoved Say yes if you are asked for

Hosting your own NuGet feeds

There are multiple ways to host your own NuGet feeds: Using a fileshare Using MyGet Using the NuGet server package Using the NuGet Gallery  code Hosting your NuGet feeds using a fileshare This is probably the easiest solution. Just create fileshare on a server somewhere and put all your packages on this share. This approach has one big disadvantage, it becomes rather slow when the number of packages grows. Hosting your NuGet feeds on MyGet MyGet , also known as ‘NuGet as a Service’ allows you to create and host your own NuGet feed. It allows you to include packages from the official NuGet feed or upload your own NuGet packages. It offers lots of nice features and best of all if you don’t need private feeds, it’s free! Hosting your NuGet feeds using the NuGet server package This option needs a little bit more work. Create an empty ASP.NET MVC(or WebForms) project. Download the NuGet.Server package from the official NuGet feed. This will crea

Copy VHD’s between Windows Azure Accounts

A colleague asked me how to copy aVirtual Hard Drive (VHD) from one Windows Azure subscription to another. Doing this is simple using the Windows Azure Powershell cmdlets. First follow the instructions on http://msdn.microsoft.com/en-us/library/windowsazure/jj554332.aspx to download and install the Windows Azure Powershell plugin. Once the installation has completed, you can execute this one line of code from the Windows Azure command-line: azure vm disk upload < source -path> <target-blob-url> <target-storage-account-key> Some information about the arguments: <source-path>: The url of the VHD or blob that you want to copy. <target-blob-url>: The url of the Windows Azure Storage container in the destination Azure subscription. <target-storage-account-key>: The storage account key for the Windows Azure Storage container.

Both Visual Studio and Team Foundation Server get GIT support

Last week at the ALM Summit Brian Harry did some exciting announcements: . Team Foundation Server will host Git repositories – and more concretely, Team Foundation Service has support for hosting Git repositories starting today. Visual Studio will have Git support – and concretely, Microsoft released a CTP of a VSIX plugin for the Visual Studio 2012 Update 2 CTP today. Resources You can get a good overview of how to get started (including all the download links) by reading this tutorial . Watch this video for a 10 minute walk-through. Also you can read the news and the Learn content on the Team Foundation Service welcome portal. And don’t forget to have a look at Scott Hanselman’s opinion about it. I think this is really great news, Microsoft not only decides to support Distributed Version Control Systems(DVCS) but also  choose to integrate with the most popular DVCS Git(and all available services built on top of it). Most important question of

Team Foundation Server 2012: Request feedback remains disabled

For a customer we are experimenting with the Microsoft Feedback Client . “Microsoft Feedback Client for TFS can help your development team gather both solicited and unsolicited feedback about your software projects from your customers and stakeholders.It allows you to launch an application, capture your interaction with it as video and capture your verbal or type-written comments as well. Your feedback is stored in Visual Studio Team Foundation Server 2012 to support traceability.” The easiest way to get started is to open the Web Access for a TFS project. On the Home page click on Request feedback under Activities : The Request Feedback form is loaded. Here you can specify the people you want to contact for feedback, some instructions to load the application and some details about the kind of feedback you’re expecting.  After clicking on the Send button, an email is send to the selected people who can download the Feedback client and start using your application. The

Shrink log files in SQL Server 2008 (or later)

Some years ago, I blogged about the BACKUP LOG WITH TRUNCATE_ONLY command .  However when I tried to use the same technique a few weeks ago, it no longer worked. When I executed the following statement BACKUP LOG Northwind WITH TRUNCATE_ONLY I got the following error message back. ?Msg 155, Level 15, State 1, Line 1 'TRUNCATE_ONLY' is not a recognized BACKUP option. After some research on the Internet I discovered that ‘BACKUP LOG WITH TRUNCATE_ONLY’ is a dangerous command: it empties out the contents of your SQL Server’s transaction log without really backing it up. When you use it, you lose the ability to recover to a specific point in time.Therefore Microsoft decided to remove this capability from SQL Server 2008. The only workaround in SQL Server 2008 is to switch the database’s recovery model to simple as shown in Books Online . Afterwards you can call the following command to shrink the logs: DBCC SHRINKFILE(<TransactionLogName>, 1) Afterwards you c

Stand-alone installer for TFS object model

Team Foundation Server always had a rich extensibility story. By using the Team Foundation Server object model you could change or extend almost every part to your needs. The only disadvantage of the TFS object model is that the only way to install it was to install VS or Team Explorer, both of which included a VS shell, Office extensions and a bunch of stuff that you really didn’t need to do basic programmability against a TFS server. Good news! Last week Brian Harry announced that they released a stand-alone installer(as part of VS Update 1) that would just install the programmability components – making for a faster, smaller and less impactful install. You can download the installer here: http://visualstudiogallery.msdn.microsoft.com/f30e5cc7-036e-449c-a541-d522299445aa