Wednesday, November 14, 2012

CSSDeck.com

Сегодня со мной поделились ссылкой на интересный сервис, который во многом похож на jsfiddle.net.

Кроме приятного дизайна и социальной составляющей, этот сервис обладает рядом инновационных фич. Одной из них является возможность создавать codecast`ы, которые потом можно проигрывать и шарить. При этом сохраняется возможность взаимодействовать с исходным кодом при проигрывании codecast'a

А еще там можно работать совместно над одним проектом в режиме реального времени.

Вот некоторые примеры codecast'ов (для начала проигрывания нужно нажать Play):
Codecast: Transforming New Microsoft Logo Into Windows 8 Logo
Lets Make a Bouncing Ball in HTML5 Canvas
CSS3 Stackoverflow Logo

Friday, November 25, 2011

MSBuild error related to missing Tracker.exe, AL.exe, LC.exe and so on

Today I got some frustrating error, when I've been setting up a new project on TeamCity and tried to run it:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1835, 9): error MSB3454: Tracker.exe is required to correctly incrementally generate resources in some circumstances, such as when building on a 64-bit OS using 32-bit MSBuild. This build requires Tracker.exe, but it could not be found. The task is looking for Tracker.exe beneath the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. To solve the problem, either: 1) Install the Microsoft Windows SDK v7.0A or later. 2) Install Microsoft Visual Studio 2010. 3) Manually set the above registry key to the correct location. Alternatively, you can turn off incremental resource generation by setting the "TrackFileAccess" property to "false".

It was a bit strange to see a reference to the Windows SDK v7.0A, because I was pretty sure that there is just v7.1 installed. Thanks to the stackoverwflow for the solution that I found very quickly. The first (and the only in my case) thing you need to do is to tell MSBuild to use the latest version of the Windows SDK installed:
  1. Go to "Microsoft Windows SDK v7.1" from the Start menu
  2. Select "Windows SDK 7.1 Command Prompt" and enter
  3. > cd Setup
  4. > WindowsSdkVer -version:v7.1
After this I was able to build project on the server without any problems.

Tuesday, August 16, 2011

How to register COM-class within the application manifest file

You don't always need to register referenced COM-classes in the windows registry. Sometimes it's much more simple and reliable to use application manifest for referencing COM-classes. This feature is called Registration-free COM and well described in this article.
In few words, you can add application manifest file to you .NET application project (Add New Item -> Application Manifest File). Then you can reference COM this way:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <file name="MyPrivateCOM.dll">
    <comClass clsid="{AC78B8E2-6C4D-11d1-ADE2-0000F8754B99}" threadingModel="Apartment" />
 </file>
</asmv1:assembly>


* This source code was highlighted with Source Code Highlighter.
I provided a simplified version of the manifest file with a COM-reference only. Though, it's correct and working sample. Of course, application manifests allows to do much more than just referencing COM-classes, but it's an another big and interesting topic.

Saturday, March 5, 2011

How to install SQL Server Management Studio Express 2008

In the SQL Server 2005 installing of SSMSE (SQL Server Management Studio Express) was very easy, just all about launching the installation file. In the SQL Server 2008 process of installing SSMSE is a bit different, since installation is represented as a part of the SQL Server Installation Center Utility.
In order to install SSMSE 2008 you need to perform the following steps:
  1. Download the installation package and launch it.
  2. Click "New SQL Server stand-alone installation or add features to an existing installation".
  3. Wait untill installation setup support files and configuration checks, then click OK and Install.
  4. Click "Perform a new installation of SQL Server 2008", but not "Add features to an existing instance of SQL Server 2008" (!!!).
  5. Click Next in the Product Key dialog even if all the options are disabled.
  6. In the feature selection dialog enable Management Tools feature and click Next.
  7. Wait untill installation performs an additionnal configuration checks. Then click Install. Note: You might receive a configuration error, if you have SQL Server 2005 Express tools already installed on the machine. In my case I removed SQL Server 2005 Express tools. But it was not enough. I also used solution provided here (removing registry key). It was helpfull.
  8. Wait untill installation completed. Enjoy!

Thursday, December 16, 2010

Using RouteValueDictionary to test anonymous objects in C#

For example, you have the following anonymous type declaration & instantiation:
var someObject = new {someProperty= "someValue"};
How to inspect value of the id property? You need a wrapper, that is able to index anonymous objects. For example, RouteValueDictionary.

Here is code:
var wrapper = new RouteValueDictionary(someObject);
Assert.AreEqual("someValue", wrapper["someProperty"]);

If your ASP.NET MVC controller returns JsonResult, you can use this approcah to test contents of the Data property, which usually references to some anonymous object.

Thursday, September 9, 2010

Beyond Multiple Choice: Lab Exam Demonstration for Developers

Microsoft demonstrates a proof of concept for a lab that tests your hands-on development skills in the Visual Studio environment.









Link: http://j.mp/cGIn69.

You can leave your feedback by completing the survey at http://j.mp/beRxTG.

Friday, August 20, 2010

Great ASP.NET MVC 2 (+ EF 4.0) sample

Recently I``ve found a great sample project on the codeplex that shows how to build web applications with ASP.NET MVC 2. I speak about MVC Music Store.



First of all, this project was interesting for me because it demonstrates how to organize data access via Entity Framework 4. There are also a lot of nice stuff in this project, including:

  • Templating, Data Annotations, Validation;
  • View models;
  • Client-side validation, jQuery and AJAX helper methods;

Project includes 80-page PDF walktrough tutorial that describes in details how to create sample application starting from clicking File -> New Project.

You need Visual Studio 2010 and ASP.NET 4.0 to run samples.

ASP.NET MVC 2 is the latest official release at the current moment (ASP.NET MVC 3 is still under development). So, this tutorial is very actual now. I recommend it to everyone who are not familiar with ASP.NET MVC technology. Moreover, this tutorial might be useful if you would like to understand how to use Entity Framework 4 within your ASP.NET MVC website.