.NET Framework 3.5 Enhancements Training Kit and Getting it working with SQL 2008
Today as a part of my learning resolution I decided to run through the hands on labs for ADO.NET Entity Framework from the .NET Framework 3.5 Enhancements Training Kit. I downloaded and installed it on an old WinXP machine and set to work on the lab.
The lab setup requires you to run a SetupEx.cmd file which among other things builds a VS Project called AliasDatabaseServer. The point of this utility is to create a server alias for the database that you will use in the lab. Unfortunately it failed to build.
Program.cs(23,27): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)
Program.cs(24,27): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)
Program.cs(109,40): error CS0246: The type or namespace name 'ManagedComputer' could not be found (are you missing a using directive or an assembly reference?)
Program.cs(141,40): error CS0246: The type or namespace name 'ManagedComputer' could not be found (are you missing a using directive or an assembly reference?)
Program.cs(189,64): error CS0246: The type or namespace name 'ManagedComputer' could not be found (are you missing a using directive or an assembly reference?)
Program.cs(189,24): error CS0246: The type or namespace name 'ServerAlias' could not be found (are you missing a using directive or an assembly reference?)
Done building project "AliasDatabaseServer.csproj" -- FAILED.
I'm sure this has to do with the move to SQL 2008 I made recently on this machine. When I opened the project in VS I found two references to assemblies that could not be located
- Microsoft.SqlServer.ConnectionInfo
- Microsoft.SqlServer.Smo
To save you some time - here are the steps you need to take to fix this if you have moved to SQL Server 2008.
- Remove the missing assemblies
- Add references to the version "10.0" (SQL 2008) versions of the following assemblies
- Microsoft.SqlServer.ConnectionInfo
- Microsoft.SqlServer.Management.Sdk.Sfc
- Microsoft.SqlServer.Smo
- Microsoft.SqlServer.SqlWmiManagement
There is one other issue I found. If you open the Tools.sln file in VS2008 it will upgrade it to the new solution file format. This is fine but then if you try to run SetupEx.cmd again you will get the following error
.\Util\Tools.sln(2): Solution file error MSB5014: File format version is not recognized. MSBuild can only read solution files between versions 7.0 and 9.0, inclusive.
How strange I thought until I opened SetupEx.cmd and found that it is hard coded to run the .NET 2.0 version of MSBuild which is not compatible with VS2008 solution files.
So I made the following change
Old Line: SET msbuild=%WINDIR%\Microsoft.NET\Framework\v2.0.50727\msbuild.exe
New Line: SET msbuild=msbuild.exe
Since I'm running this command from the VS2008 Command Prompt the path to the tools is already included. Now everything works fine.
Hope that helps you to run through this very valuable content. I may run into some other issues with the labs and I'll let you know if I do.
Ron
Comments
- Anonymous
January 07, 2009
PingBack from http://blog.a-foton.ru/index.php/2009/01/07/net-framework-35-enhancements-training-kit-and-getting-it-working-with-sql-2008/