Code from What's New in WPF4 Live Learning
20 Jan 2010 1:16 PM

Thanks to everyone who attended today's What's New in WPF 4 Live Learning event. I hope you liked it. Here is the sample code.

by RobertG | with no comments
Followups from yesterday's Live Learning
29 Oct 2009 10:48 AM

Thanks to everybody (more than 100 of you!) who joined me yesterday for What's New in Visual Studio 2010. I hope you saw a lot of useful and exciting features coming soon to a Visual Studio near you. There were a couple of questions asked that I didn't have the answer for at the time. I sent an email and got the answers, so here they are:

Q: I have VS 2008 Pro. Our IT has TFS server. I just need to link to IT TFS server from my licensed Visual Studio. I noticed I can download Team Explorer from Microsoft’s web site. But do I need to pay a license to get Team Explorer to connect to TFS server?

A: Yes. Visual Studio 2008 users are required to purchase a Client Access License for TFS.

Q: I was wondering if with VS 2010 we would have a problem running our project's Team Builds in Team Server Foundation 2008?  We seemed to encounter this problem when we moved from VS 2005 to VS 2008 but we still kept TFS 2005.

A: The Build definitions changed from TFS 2005 to TFS 2008. You can continue triggering builds from an older version, even with a newer client (i.e. build on check-in), but a newer client cannot edit the builds of an older TFS. This will be true with TFS 2010 as well as TFS 2010 uses Windows Workflow for build automation.

Let me know if you have additional questions.

Robert

by RobertG | with no comments
Visual Studio 2010 Beta 2 and announcements
19 Oct 2009 2:18 PM

MSDN subscribers can now download Visual Studio 2010 Beta 2 (http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx). It will be available for everyone on October 21.

Microsoft also announced the packaging for Visual Studio. Looks like the Standard edition is gone. In addition to the Express versions, there will be Professional, Premium and Ultimate versions. See http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx for details on what is in each version. Some highlights:

  • The SharePoint tools are in Pro.
  • Team Foundation Server is included in Pro. This is the Team Foundation Server Basic Edition I mentioned in my last blog.
  • Pro continues to have unit testing. Premium adds Code Coverage, Test Impact Analysis and Coded UI Test. Ultimate adds Web Performand and Load Testing.
  • The tools in VS Team System  Database Edition (also known as Data Dude) are in Premium.
  • To get the Historical Debugger, you need Ultimate.

Next week I am doing a What's New in VS 2010 Live Learning event. I will use Beta 2, so if you want to see it, come join me Wednesday, Oct 28 at 11 AM CST.

by RobertG | with no comments
Silverlight and Team Foundation Server Basic Edition
14 Oct 2009 11:14 AM

Silverlight

At VSLive Orlando last week I went to a couple of Silverlight sessions and talked with several folks at lunch. The main takeaway I got was that Silverlight is clearly the next big thing. After seeing an Intro to Silverlight session, people were asking "Why would I ever use ASP.NET when I can use Silverlight"? You get most of the richness of a client app (except it runs in a sandbox, so no printing or being able to talk to the file system, maybe in future releases?) and your app runs as a browser plug-in, so deployment is a no-brainer. The XAML in Silverlight is a subset of the XAML in WPF, so if you learn one XAML in one you know it in the other. Once caveat: the Silverlight tooling in VS 2008 is not up to par at the moment. For example, in the current release you can't drag controls from the Toolbox onto the designer. You have to write XAML or drags the controls into your XAML. Hopefully, a newer version of the VS 2008 tools will come out with better designer support. And I am sure that VS 2010 will not have this issue.

Takeaway: The time to jump on the Silverlight train is now. And not just if you are a Web developer.

Team Foundation Server Basic Edition

Matt Carter of Microsoft gave a keynote at VSLive. His focus was Visual Studio 2010. The 3 main themes were Creativity unleashed, Simplicity through integration and Quality code ensured. Lots of vision about how VS 2010 would make it easier to built better applications and raise the chances your projects will be successful. Of course, his demos all showed stuff in Team Suite (or whatever the big version will be called next time). How many of us have Team Suite? I do because I have an MSDN Team Suite subscription. However, when we write courseware, we only include things that are in VS Professional, because we can assume everyone has that.

So how is a developer with Pro supposed to take advantage of the project testing and management tooling in Visual Studio? VS 2008 added unit testing. What's coming in VS 2010 for the masses? Matt answered that by announcing Team Foundation Server Basic Installation. This is for individual developers and small teams. Install and configuration will be fast and easy. And you can install it on client machines. He did not specifically mention packaging or pricing, but I'm guessing widespread and cheap. It would likely ship as part of VS Professional and may be available more widely.

Takeaway: In VS 2008, you have to buy Visual Studio Big Daddy Edition to get anything more than unit testing. In VS 2010, Microsoft wants all VS developers to have more tools to help them write better code. I like that.

by RobertG | with no comments
Filed under:
More "Fun" with Visual Studio 2008 SP1
14 Oct 2009 11:00 AM

Back in July I wrote about how Visual Studio 2008 SP1 wouldn't install because I didn't install C++. Since that time, I repaved that machine and installed Windows 7. I of course installed VS 2008 SP1 the same day I installed VS 2008 and all was well. The SP1 install had been updated since July to not fail just becuase you didn't install C++.

About a week and a half ago, I was working on a project to convert the C# code in Eric Carter's VSTO 2007 book to VB. One of the code listings uses Microsoft.Office.Tools.Excel.Extension and when I typed the dot after Excel, there was no listing for Extension. The book said it was installed in SP1, but I couldn't find it. I Binged it and saw that others had run into the same thing. There was no official explanation, but the advice was basically maybe your SP1 didn't install correctly so reinstall VS 2008. That seemed a bit extreme, especially since I had rebuilt the machine not much more than a month ago. I didn't really feel like spending more time on this, so I punted and moved on in the book.

In the meantime, I decided to install the Silverlight 3 tools on my computer. That install failed too, telling me I needed VS 2008 SP1. It told me I needed a specific version of SP1, yet the About box in Visual Studio listed that version. Once again, I Binged this and found essentially the same advice. Your SP1 isn't installed correctly.

So I downloaded SP1 from MSDN, even though Windows Update said it was installed, and reinstalled it. Bingo. Both issues went away. I now had Microsoft.Office.Tools.Excel.Extension and the Silverlight tools installed just fine. Why did my original install of the updated SP1 not work? Who knows. All I know is a reinstall fixed everything. So you just might want to reinstall it to be sure.

by RobertG | with no comments
Filed under:
Fall Speaking Season is Here
2 Oct 2009 10:53 AM

I'm wearing long sleeves. We turned the heat on. And our TV shows are back on. That can mean only one thing. Fall is here. And with fall comes fall speaking season. I am making three speaking trips this month.

I will be in Orlando for VSLive October 5-7 (aka next week). I am giving three talks:

  • Building SharePoint Workflows with Visual Studio
  • Working with the Office 2007 Open XML File Formats
  • What's New in Visual Studio 2010

I will be in Bellingham, WA on October 14 speaking at the Bellingham .NET user group. The topic is yet to be decided.

I will be in Arnhem, Netherlands for the SDN Conference on October 19-20. I am giving three talks:

  • An Introduction to Windows Communication Foundation
  • WCF and Worklow Foundation: Two Great Technologies That Go Well Together
  • Windows Communication Foundation Security Fundamentals

If you are at any of these events, please come by and say hello. I always enjoy meeting customers.

by RobertG | with no comments
How I got Word, Excel and PowerPoint to start working again
14 Sep 2009 4:55 PM

At VSLive Orlando (Oct 4-7), I am giving a talk on the Office 2007 Open XML File Formats. In the talk, I will have lots of examples of how to use the Open XML SDK to programmatically manipulate Word, Excel and PowerPoint documents from VB/C# code without having to start Word, Excel or PowerPoint. It is a cool topic and a very nice tool to have in your app building arsenal.

Last Friday, I was putting the finishing touches on my demos, when PowerPoint crashed. No worries though. Word, Excel and PowerPoint docs are now stored as XML and when you use the SDK to modify the docs, you are modifying the XML. If you make a mistake in your code, the XML is invalid and the Office app can't read/open the document. So PowerPoint crashed after I opened a presentation I had modified. But then I opened a presentation I had not modified and it crashed. And it crashed when I opened PowerPoint without opening an existing presentation. And to make matters worse, Word and Excel also now stopped working as soon as I started them. Interestingly, Office, Access and OneNote worked fine. Was it a coincidence that the 3 apps that let you manipulate the XML in docs were the ones not working?

I did a repair. Word, Excel and PowerPoint continues to stop working immediately on starting them. I rebooted. Same. I stopped working since it was Friday and said I will fix this Monday. This morning I uninstalled Office and reinstalled. Same problem. I tried starting them in safe mode. Word would start in safe mode, but Excel and PowerPoint would not. I Binged and Googled for solutions. I tried registry modifications (see http://support.microsoft.com/kb/921541), but still had the same results.

Someone suggested I try natively debugging. I downloaded WinDBG and tried that, but I honestly could not figure out what I was looking at. I searched through the event log and saw all the crashes, but couldn't get any insight.

I did more Binging and Googling and saw that someone had an issue where Excel stopped working and explicitly blamed the Office Live Add-in. So I uninstalled the Office Live 1.4 Add-In from my computer and hallelujah!! Word, Excel and PowerPoint all now work. This add-in lets you save Word, Excel and PowerPoint docs to an Office Live Workspace. That explains why only those apps had the problem, not the others.

Why did the Office Live Add-In suddenly cause Word, Excel and PowerPoint to stop working? I don't know and I don't know how to know. All I know is that I spent about many many hours on this and finally am back where I was before all heck broke loose. And that means, I can get on with my normal work, including playing with Visual Studio 2010, which I will blog about soon.

 

by RobertG | with no comments
Filed under:
PKI Security and WCF
5 Aug 2009 12:16 PM

Last week I did a Live Learning event of Hosting and Calling WCF Services (should be posted soon). Towards the end, someone asked a question about implementing PKI security with WCF. I misunderstood the question, so wasn't quite sure what to say. After the session, I realized what was being asked and would like to anser the question here.

PKI is Public Key Infrastructure. This enables you to authenticate users by using certificates. You can specify what credential type you want to use to secure a WCF service. One of the options is Certificate. If you specifiy Credential as the type, then the client passes a certifcate to the service in order to be identified and authenticated.

In the WCF course, I have a chapter on security and there are several examples of using certificates to authenticate users. One of the scenarios in the chapter covers the following situation: Users on the network communicate with the service over TCP. Because they have already logged onto the network, the service can easily authenticate them and know who they are. Users can also access the service over the company wireless network.  But guests can also access the wireless network, so you want a way to control access to the service. So you host the WCF service on the intranet and then use Basic Authentication to authenticate users. To do this, you use a server certificate. The application presents a login screen to the users, who supply their network id and password. The client passes these to the WCF service.

So the answer to the question is that WCF has full support for PKI and using certificates to authenticate clients that call services.

Robert

by RobertG | with no comments
Filed under:
Security Update for VS 2008 SP1 may not install
29 Jul 2009 5:33 PM

Microsoft released several security updates yesterday, including the Security Update for VS 2008 SP1. Today I installed them, but the VS 2008 one didn't install. I tried several times, but each time it still showed up as available in Windows Update.

Turns out that the update won't install if you didn't install C++ when you installed Visual Studio. I don't do C++, so I never install it and take up the disk space. Who knew that would someday prevent a security update from installing?

Hopefully, Microsoft will issue an update to the update in the near future, but in the meantime, there is a workaround. Thanks to Joao Cardoso, a VB MVP, for posting the following step by step on his blog (http://pontonetpt.com/blogs/joaocardoso/archive/2009/07/29/kb971092-visual-studio-2008-service-pack-1-atl-security-update-does-not-install.aspx).

1 - Download VS90SP1-KB971092-x86.exe from here
2 - Start the installation
3 – You will get an error message. Usually: “VC Libraries QFE Patch does not apply, or is blocked by another condition on your system.” 
4 - Don’t close the window, and find the temporary folder that was created in one of your drives. You may need to change your setting to see invisible folders. Usually this resides on the C drive and its a bunch of letters and numbers. Its a folder that has the file VS90SP1-KB971092-x86.msp in it. Copy the entire folder to another location and rename it to your liking.
5 - Finally cancel the installation process 
6 - Navigate to <drive>:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools and find vsvars32.bat.
7 - Change the permissions (on security) on the file to allow everyone to edit it. This may not be required but better safe than sorry, because the patch will edit this file.
8 - Finally start VS90SP1-KB971092-x86.msp from within the saved folder and the process should complete. Go to windows update and check for new updates. The patch should not be offered again.

by RobertG | 1 comment(s)
Filed under:
How do you connect to a remote SQL Server if you have SQL Server 2008 and Windows 7?
17 Jul 2009 10:15 AM

In my previous post, I covered how you configure SQL Server to let you connect to it from a remote computer. I used SQL Server 2005 because that is what I have on my laptop. I have not switched to SQL Server 2008 on that computer because I use it to write courseware and we have been using SQL 2005 in the courseware, primarily because VS 2008 installs SQL 2005.

In this post, I will cover two additional scenarios. You have Windows 7 installed and you are using SQL Server 2008. The basic steps are the same. You still need to configure protocols and ports and configure the firewall. The UI is different thought.

First off, SQL Server 2008 does not include the SQL Server Surface Area Configuration tool. So you will do all the configuring in the SQL Server Configuration Manager. Expand the SQL Server Network Configuration node. Select Protocols for MSSQLSERVER. Right-click on TCP/IP and select Enable. Do the same for Named Pipes if you want to use that.

To configure the port, double-click on TCP/IP. In the TCP/IP Properties dialog box, select the IP Addresses tab. Scroll down to the bottom. By default, SQL Server is configured to listen for clients on dynamic ports. To have it listen on the same port each time, leave the TCP Dynamic Ports property blank and set the TCP Port property to a number. If you do not use dynamic ports, SQL Server will use port 1433 by default for TCP. Click OK to dismiss the TCP/IP Properties dialog box.

Repeat these steps for SQLEXPRESS. Don't use the same port number. I used 1500 on my computer.

To have these changes take affect, you have to restart the SQL Server services. In the Configuration Manager, select SQL Server Services. Right-click on MSSQLSERVER and select Restart. Do the same for SQLEXPRESS.

Finally, you need to configure the Windows Firewall to enable communcation on these ports. In the Control Panel applet, double-click Windows Firewall. Select the Advanced Settings link.

 Either double-click Inbound Rules in the left pane or scroll down in the middle pane and select the Inbound Rules link.

Click New Rule in the Actions pane.

 In the New Inbound Rule Wizard, select Port and click Next.

Select TCP and enter the two ports you configured.

 Click Next twice. I accepted the defaults on each screen. Then provide a name for this rule. Click Finish. Use the same steps to add a rule for UDP and port 1434. 

You can now connect to SQL Server 2008 and SQL Server 2008 Express running on a remote Windows 7 computer.

by RobertG | with no comments
Filed under:
How do you connect to a remote SQL Server?
16 Jul 2009 5:11 PM

Your first thought might be, you gotta write a blog post about this? Isn't it just automatic? No, in fact, it is not. By default, both SQL Server and SQL Server Express disable the ability for clients on other computers to connect to them. To enable enable remote connections, you need to configure protocols and ports and configure the firewall.

First, open the SQL Server Surface Area Configuration tool. Then select the Surface Area Configuration for Services and Connections link. Click Remote Connections in the left page.

 To enable remote connections, select Local and remote connections and then choose either to use TCP only or both TCP and named pipes. Several people have reported that TCP works more reliably.

Do this for both MSSQLSERVER and SQLEXPRESS. You will need to restart both for the changes to take effect. Click OK to close the SQL Server Surface Area Configuration tool.

Now open the SQL Server Configuration Manager. Now expand the SQL Server 2005 Network Configuration node. Select Protocols for MSSQLSERVER. You should see that Named Pipes and TCP are enabled or disabled depending on what option you selected in the Surface Area Configuration tool.

 You now need to configure the port(s) SQL Server will use. Double-click TCP/IP. Select the IP Addresses tab. Scroll down to the bottom. By default, SQL Server is configured to listen for clients on dynamic ports. To have it listen on the same port each time, leave the TCP Dynamic Ports property blank and set the TCP Port property to a number. If you do not use dynamic ports, SQL Server will use port 1433 by default for TCP.

 Click OK to dismiss the TCP/IP Properties dialog box. Configure a port for the other instance of SQL Server but do not use the same port number.

Select SQL Server 2005 Services. Right-click on MSSQLSERVER and select Restart. Do the same for SQLEXPRESS.

Finally, you need to configure the Windows Firewall to enable communcation on these ports. In the Control Panel applet, double-click Windows Firewall. On the Exceptions tab (XP or Vista) click Add port. In the Edit a Port dialog box, add an exception for port 1433 using TCP.

Click OK to close the Edit a Port dialog box. Next, add an exception for port 1434 using the UDP protocol. Then add an exception for port 1500 (or whatever you used) using TCP.

Now, you can connect to either SQL Server or SQL Server Express from another computer.

by RobertG | with no comments
Filed under:
Missing stored procedures in LINQ course chapter 5
7 Jul 2009 12:56 PM

A customer wrote in today with an issue he was having in chapter 5 (More LINQ To SQL) of the LINQ course. The sample application calls two stored procedures (AddOrder and AddOrderDetail) in the Northwind database. These stored procedures are not created when you install Northwind. I wrote them.

Unfortunately, I neglected to include instructions on how to create these and so when you run the Transactions sample in chapter 5, you get an error. I apologize for this. Attached to this post is the code to create these stored procedures. The file also includes code to create four other stored procedures that are used in chapter 4. That chapter includes instructions on how to create them, but they are in the file anyway.

In case you have difficulty downloading the file, here is the code for the AddOrder and AddOrderDetails stored procedures. Again, I apologize for the confusion and my omission.

USE Northwind
GO

CREATE PROCEDURE [dbo].[AddOrder]
(
  @CustomerID nchar(5),
  @EmployeeID int,
  @OrderDate datetime,
  @RequiredDate datetime,
  @ShipVia int,
  @Freight money,
  @ShipName nvarchar(40),
  @ShipAddress nvarchar(60),
  @ShipCity nvarchar(15),
  @ShipRegion nvarchar(15),
  @ShipPostalCode nvarchar(10),
  @ShipCountry nvarchar(15)
)
AS
INSERT INTO [dbo].[Orders] ([CustomerID], [EmployeeID],
  [OrderDate], [RequiredDate], [ShipVia],
  [Freight], [ShipName], [ShipAddress], [ShipCity],
  [ShipRegion], [ShipPostalCode], [ShipCountry])
VALUES (@CustomerID, @EmployeeID, @OrderDate,
  @RequiredDate, @ShipVia, @Freight,
  @ShipName, @ShipAddress, @ShipCity, @ShipRegion,
  @ShipPostalCode, @ShipCountry);
 
RETURN SCOPE_IDENTITY()

GO

CREATE PROCEDURE [dbo].[AddOrderDetail]
(
  @OrderID int,
  @ProductID int,
  @UnitPrice money,
  @Quantity smallint,
  @Discount real
)
AS
 /* SET NOCOUNT ON */
INSERT INTO [dbo].[Order Details] ([OrderID], [ProductID],
  [UnitPrice], [Quantity], [Discount])
VALUES (@OrderID, @ProductID, @UnitPrice, @Quantity, @Discount);

GO

by RobertG | with no comments
Why doesn't Visual Studio release files?
6 Jul 2009 3:53 PM

I have had a long running issue where Visual Studio won't release files and so I can't delete them or move them. 

This happended to me a couple of weeks ago:

1.       I copied a DLL to my computer.

2.       I set a reference to that DLL in a project.

3.       I decided I want a different DLL.

4.       I removed the reference to that DLL from my project.

5.       I tried to delete the DLL from my computer.

What happened? Visual Studio was still using the file, so Windows wouldn’t let me release it. This happened with VS 2008 and Vista. It also happened with VS 2010 and Windows 7.

 

Related to this is renaming a folder. I create a project. I rename it. I decide I want to rename the folder it is in. I close the solution. Windows won’t let me rename the folder. I close Visual Studio. Windows still won’t let me rename the folder. I have to reboot the computer. This has happened numerous times with VS 2008 and Vista. I have not tried it with VS 2010 and Win 7 yet.

I asked a contact on the VB team if this is a known issue and would they fix it. My contact forwarded my mail to someone on the VS Platform team. The response I got was that these types of issues are very hard to nail down. Any component interacting with the DLL could be holding a reference to it. This includes the project system, MSBuild, IntelliSense, the VS designers. He wanted to know if this was happening on a particular project or DLL. Unfortunately, the answer to that is no. I have seen this on numerous projects, more often than not C# rather than VB.

Have you seen this? Have you seen it in specific scenarios? If you have, let me know and I will forward your experinece on to the VS Platform team. The more info we can give them, the more chance we have of them fixing this most annoying behavior.

 

by RobertG | with no comments
Filed under:
Windows 7 General Availability on October 22
3 Jun 2009 2:34 PM

According to The Windows Blog, http://windowsteamblog.com/blogs/windows7/archive/2009/06/02/the-date-for-general-availability-ga-of-windows-7-is.aspx, Windows 7 will be in stores by Oct 22 and RTM in late July.

I am using the Windows 7 Release Candidate on my non-production machine and so far, so good. There is every reason to think that Windows 7 will be dramatically better than Vista, so I am looking forward to late July, and not just because it will finally be sunny for more than 4 or 5 days in a row in Seattle.  

by RobertG | with no comments
Filed under:
Hotfix for Visual Studio 2008 SP1 crashing
3 Jun 2009 1:14 PM

Last night, I spoke at the San Diego .NET Developers Group. I spent some time changing fonts in Visual Studio to make the screen easier to see on the projector. I changed the Environment font and I also docked the properties window side by side with the Solution Explorer rather than below it. The talk went fine but about 2/3 of the way into it VS crashed when I ran one of the demos. It was not a coding error, because the demo works fine and it ran fine the second time I tried it. This morning, I set my fonts back and redocked the Properties window below the Solution Explorer. I started working on a project and VS crashed again.

Vista checked for problems and pointed me to the following KB article: FIX: When you undock some windows or change the window layout in the Visual Studio 2008 Service Pack 1 IDE, the IDE crashes (http://support.microsoft.com/kb/960075). Turns out, there is a known issue in VS 2008 SP1 where if you move your windows around VS crashes. The hotfix supposedly fixes this. Someone commented that selecting Windows|Reset All Windows solved the problem of the crashing without needing the hotfix. Some people who installed the hotfix lose IntelliSense on XAML file, but got it back when they did a repair on VS.

See http://code.msdn.microsoft.com/KB960075 to get the hotfix and read the comments.

by RobertG | with no comments
Filed under:
More Posts Next page »