Azure Development Virtual Machines


So I tried the new virtual machines on Azure for Visual Studio.  I’ve always dreamed of using a vm to do my development on, but never really trusted it because Visual Studio (VS) is such a performance hog.  Well, here are my results.  I downloaded “ImageResizer” from Codeplex, a popular C# program, and then built it on my local machine and the Visual Studio VM.  My local machine runs 64-bit Win 8.1 Pro with a Intel i5 4670K CPU @ 3.4 GHz and 8 GB of RAM.  It is also on VS Ultimate 2012.  The Azure VM has a AMD Opteron Processor 4171 HE at 2.10 GHz and 3.5 GB of RAM on 64-bit Windows Server 2012 R2 Datacenter.  It is running VS Pro 14 CTP (the latest and greatest).

Now, the results.

My local machine built it in ~1.1 seconds.  

The VM built it in ~3.1 seconds.

A factor of 3.  Not great, but not that bad either.  I could see myself doing it, maybe….  lots of advantages (clean machine, always running the latest and greatest, etc.).  But it still feels like it’s on the cusp of prime time.

About these ads

A Review of TeamSpec – a TFS plug-in for MS Word


Two years ago I did an evaluation of TeamSpec and pointed out some areas of improvement. I’m very happy to report that the company took these to heart and updated their product to address these. Here is my updated review based on TeamSpec v.4.2.1.

TeamSpec is a 3rd-party add-in for MS Word that connects it to Team Foundation Server.  It works with the newest version of TFS 2012 and Office (2013).  It is the only commercial add-in for Word currently on the TFS platform. There are other companies that have add-in’s as part of their overall suite or solution, but TeamSpec is the only product to concentrate on just Word and it does it quite well.

How It Works

Work item attributes are linked to sentences or words in your Word Document.  This is a bi-directional sync between TFS and Word.  For example, say you have  a requirement work item with the ID of 3 and the title is “Login to system”.  You could create a line in Word with the tool like so:

REQ ID 3 – Login to System, State: Proposed

When you changed the state of the requirement work item from “Proposed” to “Active” in TFS, the line would change in Word to:

REQ ID 3 – Login to System, State: Active

This could also be done the other way by changing the state in Word and publishing the change to TFS.

Additionally, you can create “Skins” which are basically pre-defined layouts for work items. You could say that you want the state of work items to always be in bold and italicized in a skin for example.

Added Functionality

The new functionality that I really like and makes it a valuable product is the ability to use work item queries from TFS with Word. Writing custom reports in Reporting Services for Word is not easy, especially since the HTML fields are not stored in the TFS Data Warehouse. This product makes it a cinch! No more writing a huge SRS! Just generate it! :)

Linked worked items are supported in queries and test cases are supported as well!!! So you can do your testing documents here as well.

The documentation has improved tremendously, but a few more “behind-the-scenes” articles in the documentation would be nice. I also hold some small reservations about the long term stability of the company as it appears to be small, so be sure to ask for the source code when you buy the product. But to be fair, they have been in business since 2005.

Conclusion

I highly recommend you look at this product if you are using TFS as your ALM platform. Microsoft majorly overlooked Word integration in TFS (although they got Excel and Project), but alas, this is where partners like TeamSolutions step in! Thank you TeamSolutions for stepping in so well!

Installing Microsoft Test Professional and all its updates (KB’s, QFE’s, Service Packs, Feature Packs, etc.)


Microsoft Visual Studio Test Professional is a new SKU in Visual Studio 2010.  The tool Microsoft Test Manager (MTM) within it is a great start but notoriously buggy as it is a first release.  So when you install Test Professional you will want to make sure you get ALL the updates and service packs to eliminate a lot of the bugs.  These steps are based on this post from Microsoft.

Soooo, here’s the order you should do things:

  1. Install the Release to Manufacturing (RTM) version of Visual Studio Test Professional 2010 that was released on 4/12/2010.  You can get this at msdn.com through your MSDN subscription.
  2. Install KB2387011
  3. Restart your computer
  4. Install Visual Studio Service Pack 1
  5. Restart your computer (what else did you think? :) )
  6. Install KB2581206
  7. Restart your computer (again for the 100 millionth time!!!)
  8. Optionally install KB2608743 if you’re concerned about your TFS database becoming too big with test results and that ruining your GUI experience in MTM.

You’re done!!! Hallejuah!  Now go home :)  Wait a minute!!! Did I see you sneaking out the door!  You have more installing to do!!  Come back over here you!

  1. Install Feature Pack 2.  You can find it on MSDN.
  2. If you want to use the Firefox feature of playing back automated tests, download Firefox 3.6 here.
  3. Then configure it using these instructions.

Now, I’ll think about letting you go home…..

Introduction to Visual Studio Database Management


Types of Projects

There are basically two types of projects available to you in Visual Studio 2010 (VS): Database and Server projects. You will see these options when you go to create a new project in VS.

image

Figure 1: Visual Studio Create Project Dialog Box

SQL Server 2005 projects are circled and separated from SQL Server 2008 projects. The “Wizard” project just gives you a step-by-step wizard to follow at the setup of a project; but is still either a server or database project. The difference between the two types of projects is the type of database objects they are intended to hold. Server projects hold logins, linked servers, asymmetric keys, and other objects that are configured at the SQL Server instance level. As you might guess, the database project holds objects that are defined at the database level such as tables, indexes, stored procedures, etc. Going forward I will mostly refer to database projects and almost everything that goes for them also goes for server projects.

Build and Deploy

One of the most important things to understand initially is how a database project is built and deployed. These are two separate processes and we will treat them as such.

Building a database project

When you build a database project a .dbschema file is produced. This file is an xml representation of every object in that database project. Here is a sample of what a table would look like:

<Element Type="ISql100Table" Name="[dbo].[CustomerCustomerDemo]">
  <Property Name="IsAnsiNullsOn" Value="True" />
  <Relationship Name="Columns">
    <Entry>
      <Element Type="ISql100SimpleColumn" Name="[dbo].[CustomerCustomerDemo].[CustomerID]">
        <Property Name="IsNullable" Value="False" />
        <Relationship Name="TypeSpecifier">
          <Entry>
            <Element Type="ISql90TypeSpecifier">
              <Property Name="Length" Value="5" />
              <Relationship Name="Type">
                <Entry>
                  <References ExternalSource="BuiltIns" Name="[nchar]" />
                </Entry>
              </Relationship>
            </Element>
          </Entry>
        </Relationship>
      </Element>
    </Entry>
    <Entry>
      <Element Type="ISql100SimpleColumn" Name="[dbo].[CustomerCustomerDemo].[CustomerTypeID]">
        <Property Name="IsNullable" Value="False" />
        <Relationship Name="TypeSpecifier">
          <Entry>
            <Element Type="ISql90TypeSpecifier">
              <Property Name="Length" Value="10" />
              <Relationship Name="Type">
                <Entry>
                  <References ExternalSource="BuiltIns" Name="[nchar]" />
                </Entry>
              </Relationship>
            </Element>
          </Entry>
        </Relationship>
      </Element>
    </Entry>
  </Relationship>
  <Relationship Name="Owner">
    <Entry>
      <References ExternalSource="BuiltIns" Name="[dbo]" />
    </Entry>
  </Relationship>
</Element>

From a visual perspective, this is what happens when building a database project:

Figure2

Figure 2: Database Project Build

This is just an introduction and more detailed reference can be found on MSDN.

Deploying a Database Project

Deploying a database project is essentially taking the model of the database given by the .dbschema file from the build and comparing it with a target database. From that comparison, a T-SQL script will be generated that will alter the target database to be in synch with the database represented by the database project. A command line tool called VSDBCMD.exe is used to do the deployment. A reference for it can be found here (http://msdn.microsoft.com/en-us/library/dd193283.aspx).

Here again is a visual diagram of what happens during deployment.

Figure3

Figure 3: Database Project Deployment Process

Parts of Database Project

A database project is laid out the following way by Visual Studio.

image

Figure 4: VS Layout of Database Projects

Basically, there are project property files, references, data generation plans, schema comparisons, database objects (divided by schema), and manual scripts.

Database Object Files

Database Object files are all the .sql files that create and maintain tables, stored procedures, indexes, etc. Below is a look on how they are organized by Visual Studio. I have not expanded every folder, but you should get a general sense of how .sql files are organized from this screenshot of solution explorer.

image

Figure 5: Visual Studio Database Object Files

Most .sql files use the “CREATE” T-SQL keyword. For example, here is the script for a stored procedure:

image

Figure 6: .sql file in Visual Studio

Here is the script for an index:

CREATE NONCLUSTERED INDEX [CategoriesProducts]
    ON [dbo].[Products]([CategoryID] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0)
    ON [PRIMARY];

.dbproj File

This file defines the database project and instructs MSBUILD on how exactly to compile the database project. This is analogous to the .csproj file for a C# project. You also have the usual two configurations of builds out of box: debug and release. A sample of the file is given below:

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <OutputPath>.\sql\debug\</OutputPath>
    <BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
    <TargetConnectionString>
    </TargetConnectionString>
    <TargetDatabase>
    </TargetDatabase>
    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
    <SuppressWarnings>
    </SuppressWarnings>
    <DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
    <SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>
    <DeployToDatabase>False</DeployToDatabase>
  </PropertyGroup>

Database Property Files

These files set different properties in the database project, except for the .sqlpermissions file. This file is the place where database permissions are set rather than using a .sql script. You can multiple versions of these files to setup different scenarios for both build and deploy. Each file is xml, but is given a nice GUI by Visual Studio.

.sqlsettings File

This file contains database specific configuration settings, such as a backup policy and collation. All build configurations use the same .sqlsettings file and it is set in the following window.

image

Figure 7: VS GUI for choosing which .sqlsettings file to use

You can get to this window by right-clicking on the project and clicking “Properties”.

Server projects do not have a .sqlsettings file.

http://msdn.microsoft.com/en-us/library/dd193289.aspx

http://msdn.microsoft.com/en-us/library/bb386162.aspx

For a complete listing of these options and their descriptions, go to http://msdn.microsoft.com/en-us/library/ms190249(SQL.90).aspx. Here is a subset of them below:

Option Description Default value
ANSI_NULLS When ON is specified, all comparisons to a null value evaluate to UNKNOWN.When OFF is specified, comparisons of non-UNICODE values to a null value evaluate to TRUE if both values are NULL. OFF
ANSI_WARNINGS When ON is specified, errors or warnings are issued when conditions such as divide-by-zero occur or null values appear in aggregate functions.When OFF is specified, no warnings are raised and null values are returned when conditions such as divide-by-zero occur. OFF
ARITHABORT When ON is specified, a query is ended when an overflow or divide-by-zero error occurs during query execution.When OFF is specified, a warning message is displayed when one of these errors occurs, but the query, batch, or transaction continues to process as if no error occurred. OFF
QUOTED_IDENTIFIER When ON is specified, double quotation marks can be used to enclose delimited identifiers.When OFF is specified, identifiers cannot be in quotation marks and must follow all Transact-SQL rules for identifiers. OFF
NUMERIC_ROUNDABORT When ON is specified, an error is generated when loss of precision occurs in an expression.When OFF is specified, losses of precision do not generate error messages and the result is rounded to the precision of the column or variable storing the result. OFF
RECURSIVE_TRIGGERS When ON is specified, recursive firing of AFTER triggers is allowed.When OFF is specified, only direct recursive firing of AFTER triggers is not allowed. OFF

The .sqlsettings file looks like this when opened in Visual Studio:

image

Figure 8: VS GUI for .sqlsettings file

It is of course an xml file. Here is an abbreviated sample:

<?xml version="1.0" encoding="utf-8"?>
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties">
  <Version>1.0</Version>
  <Properties>
    <AllowSnapshotIsolation>False</AllowSnapshotIsolation>
    <AnsiNullDefault>True</AnsiNullDefault>
    <AnsiNulls>True</AnsiNulls>
    <AnsiPadding>True</AnsiPadding>
    <AnsiWarnings>True</AnsiWarnings>
    <ArithAbort>True</ArithAbort>
    <AutoClose>False</AutoClose>
    <AutoCreateStatistics>True</AutoCreateStatistics>
    <AutoShrink>False</AutoShrink>
    <AutoUpdateStatistics>True</AutoUpdateStatistics>
    <AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
  </Properties>
</CatalogProperties>

.sqldeployment File

This file contains deployment specific settings such as database name and target connection string. You can have one of these for each build configuration. This is what it looks like in Visual Studio:

image

Figure 9: VS GUI for .sqldeployment file

Here is an example of the actual xml behind the VS GUI:

<?xml version="1.0" encoding="utf-8"?>
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Version>1.0</Version>
  <Properties>
    <AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
    <BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
    <DeployDatabaseProperties>True</DeployDatabaseProperties>
    <DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
    <DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
    <GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
    <PerformDatabaseBackup>False</PerformDatabaseBackup>
    <SingleUserMode>False</SingleUserMode>
  </Properties>
</DeploymentConfigurationSettings>

.sqlcmdvars File

This file contains names and values for SQLCMD variables, which are used when you deploy a project. You may associate a different one with each build configuration. Initially the .sqlcmdvars file has three variables that aren’t set until deployment. The first variable is $(DatabaseName), and it contains the name of the target database to which you are deploying. The second variable is $(DefaultDataPath), and it contains the path in which the files for the database are stored on the target server. The third variable is $(DefaultLogPath), and it contains the path in which the log file for the database is stored on the target server.  The main use for this file currently is to replace the name of linked servers at deployment time.

.PreDeployment.sql and .PostDeployment.sql Files

These files are self-explanatory in that they are run before and after deployment. You can have only one of each of these files in a database project. If you would like to use more, you will need to use the :r option that is part of SQLCMD. More information can be found here:

http://msdn.microsoft.com/en-us/library/aa833281(VS.80).aspx

Hope you liked this intro and good luck!

New User Voice Site for TFS and Visual Studio!!!!


Microsoft just created a new site for suggesting new features for TFS and Visual Studio at:

http://visualstudio.uservoice.com/forums/121579-visual-studio

This is great and seems to be much better than the Connect site.  I’ve already voted for upgrading the usability in Microsoft Test Manager, centralizing permissioning, and so much more!!!!

http://visualstudio.uservoice.com/users/21614007-woody

Lovin’ it.

.Net 1.1, Visual Studio 2003, and TFS 2010


So, you have some old .Net 1.1 apps that you don’t want to upgrade, BUT you want to use TFS 2010 for your source control.  Well you are in for a treat! (kidding)

First, you’re condemned to using VS 2003, because VS 2005, 2008, and 2010 only deal with .Net 2.0 and higher.

Second, because of this, you’re condemned to using the TFS 2010 MSSCCI provider; which is a not very well documented, unsupported by MS free tool. :) (Have fun)

This guy has a great post with screenshots to lead you through the gauntlet!

Third, heaven help you if you’re migrating your source from another source control provider like SourceSafe or PVCS.  You’ll need to unbind the code from the old source ccontrol provider and then re-bind it to TFS 2010.  A treachous course that shouldn’t be taken lightly.

But otherwise, have fun!

Color Printing Extension Now Available for Visual Studio 2010


Color Printing Extension Now Available! – The Visual Studio Blog – Site Home – MSDN Blogs.

IIS Web Deploy References


  • TechNet
  • MSDN
  • Visual Studio “One-Click Publish”
  • Web Deploy IIS.Net web site
  • Why you should use Web Application Projects and not Web Site Projects in Visual Studio 2010.
  • Important Update for TFS 2010


    It appears, according to this blog post, that the Update just released for Lab Management has many other updates in it around all functions of TFS. One of my clients was experiencing unexpected behavior during merges that this will hopefully address.  I would apply it asap.

    http://support.microsoft.com/kb/983578/en-us

    Updated MSDN Article on TFS Architecture


    Brian Harry just posted on his blog the June updates to MSDN for TFS ALM.
    This is the most important update in my opinion:
    Team Foundation Server Architecture

    It gives a great view of the logical architecture of TFS and its different components. It will especially help when installing TFS 2010 in distributed environments.

    Follow

    Get every new post delivered to your Inbox.