Pages

Friday, July 29, 2011

Site Templates and Themes

A nice collection of web site templates and themes:

http://themeforest.net/

CSS, HTML, JavaScript, skins, etc.

Tuesday, July 26, 2011

Visual Studio 2010 loading package errors

After reinstalling Visual Studio 2010, service pack, and what-not, I started getting lots of errors about loading Visual Studio packages like RadLang, VSTS for Database Professionals, and other SQL-related stuff.

For now, running Visual Studio with the following option seems to have fixed the issue:

devenv.exe /resetskippkgs

References:

http://www.devexpress.com/Support/Center/p/Q260011.aspx

http://www.devexpress.com/Support/Center/p/K18144.aspx

Friday, July 22, 2011

Visual Studio Crashes on Open

After installing Internet Explorer my Windows Search stopped working and Visual Studio 2010 started crashing, reporting an exception in .Net 20r3 or something like that. The app would crash after opening a solution, right after the window "configuring solution" would close.

Fortunately, the fix was easy - deleting the .suo files made it go away the first time.

Problem details:

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: devenv.exe
Problem Signature 02: 10.0.40219.1
Problem Signature 03: 4d5f2a73
Problem Signature 04: mscorlib
Problem Signature 05: 4.0.0.0
Problem Signature 06: 4d53693b
Problem Signature 07: 2c26
Problem Signature 08: 45
Problem Signature 09: KUTS43RW3WMPE3EWT1R1Z5M5MTM1NR04
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 3081

Additional information about the problem:
LCID: 1033

However, now I could only open the project/solution but opening a file in the project or trying to recompile would crash the Visual Studio again. Running "devenv.exe /log" creates an xml log file:

%APPDATA%\Roaming\Microsoft\VisualStudio\<version>\ActivityLog.xml.

One of the last entries contained the error message. According to forums, this could be related to Silverlight. So I removed all the installed components related to Silverlight. The problem is that Silverlight 4 Tools cannot be installed after the Visual Studio SP1. So I removed the Service Pack. Uninstallation requires reboot.

After that I installed the Silverlight Tools and reapplied the Visual Studio SP1. Since that bore no results, I reapplied Windows 7 Service Pack 1 and all the software above in various order.

However, it turned out that unplugging the (new) RAM sticks out and plugging them back in again fixed the problem!

Google Chrome Offline Installer

Here is the URL for Google Chrome Dev Channel offline installer. Or try the links on this page.

Since the above links are often not up to date, check the following answer, which contains direct links to particular binary releases. Basically, to download the latest versions manually, the download link pattern is this:
http://cache.pack.google.com/edgedl/chrome/install/835.15/chrome_installer.exe
with the numbers "835.15" needing to be replaced with  the last two segments of the build number from the release notes blog. The actual URL of the latest update version can also be seen using Fiddler and trying out the Google Chrome update through the browser.
The link to Dev channel updates stream is here.

Tuesday, July 19, 2011

External Graphics for Laptops

Since my graphics card in a laptop sucks for 3D gaming, I'm looking for a solution that does not involve getting another PC. I've heard earlier that there are external solutions that plug into one of laptop's express slots and allow "upgrade" of the available graphics capabilities of notebook computers.

While I could not find many around on the net, here is one: ViDock

http://www.villageinstruments.com/tiki-index.php?page=ViDock

Thursday, July 14, 2011

UML with Visual Studio 2010 on Channel 9

There's a video series at Channel 9 on using the new UML features in Visual Studio 2010.

See Designing a project's physical structure (episode 6) - link, or the whole series (link) list.

Wednesday, July 13, 2011

WCF Tracing

To troubleshoot crazy WCF-related errors, a very good option is to trace all the events in the service. While the documentation on MSDN contains useful info, the changes required to actually enable tracing are not all listed there. 

The full settings, that are added to Web.config when enabling tracing through the WCF Configuration Editor, look like this:

 

Web.config
  <system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\Projects\MyProject\App_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
</system.diagnostics>

Languages that compile to JavaScript

Here is the list of languages that compile into JavaScript.

CoffeeScript seems to be getting quite popular lately.

https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS

Setting custom diff/merge tool in TFS/Visual Studio

In order to set Beyond Compare (or other custom tool) as the default tool for diff/merge operation in Team Foundation Server plugin for Visual Studio, do the following:

 

TEAM FOUNDATION SERVER (TFS)

Diff

  1. In Visual Studio Choose Options from the Tools menu.
  2. Expand Source Control in the treeview.
  3. Click Visual Studio Team Foundation Server in the treeview.
  4. Click the Configure User Tools button.
  5. Click the Add button.
  6. Enter ".*" in the Extension edit.
  7. Choose Compare in the Operation combobox.
  8. Enter the path to BComp.exe in the Command edit.
  9. In the Arguments edit, use:
    %1 %2 /title1=%6 /title2=%7

3-way Merge (v3 Pro)

  1. Follow steps 1-6 above.
  2. Choose Merge in the Operation combobox.
  3. Enter the path to BComp.exe in the Command edit.
  4. In the Arguments edit, use:
    %1 %2 %3 %4 /title1=%6 /title2=%7 /title3=%8 /title4=%9

2-way Merge (v3 Std, v2)

Use the same steps as the 3-way merge above, but use the command line:
%1 %2 /savetarget=%4 /title1=%6 /title2=%7

 

Source: Beyond Compare support (link)

Friday, July 01, 2011

Selenium with SpecFlow

In addition to the SpecFlow and Selenium Quick Start, here are a few notes on using Selenium in SpecFlow scenarios and step definitions.

Check the files in the Support directory in SpecFlow Examples code (link). There is scaffolding that is very useful if you are using Selenium to simulate user behavior. The SeleniumSupport is linked to @web tag, which should be used for the tests that use the browser (i.e. user acceptance tests). This means that, when scenarios tagged with @web are run, it will trigger events to start and shut down Selenium, and make it available for custom tests in the meantime.

Inheriting from the SeleniumStepsBase makes implementation very simple:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DoerSite.Tests.Support;
using TechTalk.SpecFlow;
using NUnit.Framework;

namespace DoerSite.Tests.SeleniumTests
{
    [TestFixture]
    public class SeleniumStepsSample : SeleniumStepsBase
    {
        [Test]
        public void test()
        {
            this.selenium.Open("/");

            Assert.IsTrue(selenium.IsTextPresent("Welcome!"));
        }
    }
}

This implementation also depends on a couple of settings in the app.config:

  <appSettings>
    <add key="ReuseWebSession" value="true" />
    <add key="AppUrl" value="http://localhost:51598/"/>
  </appSettings>

 

 

SpecFlow and Selenium - Quick Start

Here are brief steps on how to get started with SpecFlow and Selenium. This scenario assumes an ASP.NET MVC web application as the "code" and NUnit as the "test project".

Web application

  1. Create new MVC web application

Test project

  1. Create a code library project. 
  2. Add reference to NUnit framework.

Selenium

  1. Download Selenium IDE for Firefox. This component is used for generating tests by scripting user behavior.
  2. Download Selenium DotNet package. Add reference to this package into the Test project.
  3. Run Selenium IDE in Firefox and script your test with the web application. 
  4. Export the generated test into a C# file.
  5. Add this file to the Test project.
  6. Download Selenium Server and run with something like

java -jar selenium-server-standalone-2.0rc3.jar

This will start Selenium server on port 4444 by default. You can configure which browser you want the Selenium to start but by default this is Firefox.

SpecFlow

  • Download and install SpecFlow. It will add new Items to the File->New menu in Visual Studio. The most important one is SpecFlow Feature item.
  • If you install SpecFlow NuGet package, it will add the minimum required settings to the app.config in the Test project. Apparently this is not required if the test runner is NUnit. Contents of the app.config look like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>
  <specFlow>
    <!-- For additional details on SpecFlow configuration options see https://github.com/techtalk/SpecFlow/wiki/Configuration -->
    <language feature="en-US" tool="" />

    <unitTestProvider name="NUnit" />

    <generator allowDebugGeneratedFiles="false" />

    <runtime detectAmbiguousMatches="true"
             stopAtFirstError="false"
             missingOrPendingStepsOutcome="Inconclusive" />

    <trace traceSuccessfulSteps="true"
           traceTimings="false"
           minTracedDuration="0:0:0.1"
           listener="TechTalk.SpecFlow.Tracing.DefaultListener,  
                   TechTalk.SpecFlow" />
    
  </specFlow>
</configuration>
  • Add reference to SpecFlow. This will be automatically added if you install NuGet package.
  • Create your first SpecFlow Feature, edit the content to set up your feature and scenario(s).
  • Run the test on the Test project. Copy the code from the error message into a new file in StepDefinitions directory.

That's it!

If you want to run Selenium in SpecFlow scenarios, check SpecFlow Examples on GitHub (link), specifically SeleniumSupport class (link). More on this in the follow-up post Selenium with SpecFlow.

VoIP Client of Choice

Looking for a VoIP client to install on a PC that did not have one, I did a quick lookout at what is out there. I used to use heaps of different clients only to move to the next one when I'd notice that the development has stalled and/or that there are new features offered by other clients. I've used XLite, native providers' applications, and lately Linphone. However, I ran into Blink and it is now my VoIP client of choice.

I will be using softphones a bit more, both on the desktop and on the mobile phone, as I have an Australian number with PennyTel and will use it to still "feel at home" when not in Australia. :)