# Sunday, August 29, 2004

Reflector, what an awesome tool!

I just have to do a little spontanuous gushing on Reflector due to how extremely useful it is for me while working on my book (Building Windows Forms Data Applications with .NET 2.0). I've been chugging along, and it is going very well. However, I would be lost or taking significantly longer to get things figured out if it were not for Reflector.

I've been using Reflector off an on for a while now, but only recently started using it to figure out the Whidbey bits. It runs just fine against the .NET 2.0 bits, it just takes adding a config file to set the runtime to the .NET 2.0 Beta runtime so that it is happy. Basically, you just need the following in a Reflector.exe.config file in the app directory:

<configuration>

<startup>

<requiredRuntime version="v2.0.40607" />

</startup>

</configuration>

Every time I come across one of those gaping holes in the Beta docs that they just haven't gotten to yet, it just requires firing up Reflector to dive into the implementation code to see exactly what a certain parameter means and how the method is going to use it.

Lutz Roeder: they should have a special community title for people like you who create tools of this caliber and usefulness, and then put them out there for free. Perhaps Microsoft Community Demi-God would be sufficient, perhaps not.

The fact that the tool is very polished and functional beyond just decompiling the IL is just very rich gravy on the steak. I especially love being able to get the Callee graph on something to see where a particular property is used or a method called from.

Thank you, Thank you, Thank you, Thank you.



.NET | Community | Languages and Tools

Sunday, August 29, 2004 5:05:05 AM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Sunday, August 15, 2004

Clearing up the lingo: Whitehorse, Burton, Visual Studio Team System

A lot of people are throwing around the terms “Whitehorse”, “Burton”, “Visual Studio Team System”, “Class Designer” and others and incorrectly mixing and matching the combinations. Here is some information to help make things clear to those who might be a little confused by code-name mumbo jumbo.

Visual Studio Team System (Code-named Burton) is the family of products that will include new software development lifecycle management and design tools. There will be several product offerings in the family, targeting developers, testers, architects, and managers. Each of those will contain a different grouping of lifecycle tools, focused on their individual role in the lifecycle.

Visual Studio Team Architect (Code-named Whitehorse) is one of those products targeted at the Architect role, and contains the Service Oriented Architecture designers for modeling services and infrastructure. These tools are what are really referred to as “Whitehorse”. When you hear or say Whitehorse, you should be thinking SOA tools.

The Visual Studio Class Designer is a modeling tool that will be part of Visual Studio Standard and Professional versions, and all versions of Visual Studio Team System. The Class Designer is not part of Whitehorse. It is a feature of Visual Studio.

So just to put it in a few concise terms programmers should understand:

VSTS != Whitehorse

Class Designer != Whitehorse

VSTS == Burton

Now that we've cleared that up, I can get back to coding. Get it right, people!!!! :)



.NET | Community | Languages and Tools

Sunday, August 15, 2004 1:07:53 AM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Saturday, August 14, 2004

Data Binding Scenarios??

I'm looking for suggestions for some tough data binding scenarios you have or would like to tackle in an application to use as sample cases for my book on WinForms data binding in .NET 2.0. If you have any nasty little scenarios that are not too contrived, let me know and maybe I can solve them and use them in my book.

Thanks!



.NET | Community | Languages and Tools

Saturday, August 14, 2004 7:04:08 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Friday, August 13, 2004

Using Web Services as Data Sources in the Data Sources Window in Visual Studio 2005

The Data Sources Window in Visual Studio 2005 allows you to drag and drop data sources onto a form to generate all of the controls and components needed to use that data source for databinding. The Data Sources Window support binding to databases, Web Services, and custom objects.

The Web Services piece is still a little quirky in Beta 1 because they wisely chose to only let you bind to public properties on an object definition, not public fields. This will hopefully discourage the definition of public fields to expose data from a class, which is a bad idea all around. However, the current client proxy code that gets generated for a Web Service when you create a Web Reference just exposes public fields on the classes generated for objects returned from a Web Service. Thus the Data Sources Window in Beta 1 won't let you see any of the members on the object types returned from the Web Service.

The good news is that the wsdl.exe tool that ships with the .NET 2.0 SDK does in fact create public properties to wrap the members on the objects returned by a web service. So there is a fairly straightforward workaround to get Web Services working with the Data Sources window in Beta 1, detailed below.

1. Go through the Add Data Source wizard, select Web Reference as the type of Data Source, and point it at the WSDL URL for the data source. For example, you would point it at the Amazon Web Service at:

http://soap.amazon.com/schemas3/AmazonWebServices.wsdl

2. After completing the wizard, go check what the namespace is for the generated web procy file. To do this, you need to select Show All Files in Solution Explorer, and drill down to the Reference.cs file that was created under the Web References node for the Web Service. For the example above, that would be <YourApplicationNamespace>.com.amazon.soap.

3. Fire up a Visual Studio 2005 command prompt window, and run wsdl.exe with the wsdl url, an out param to generate the Reference.cs file, and the namespace param to set the namespace from step 2. Example:

wsdl.exe http://soap.amazon.com/schemas3/AmazonWebServices.wsdl /out:Reference.cs /n:MyApp.com.amazon.soap

4. Copy the generated Reference.cs file (or vb if that is your flavor) into the WebServices subfolder created under your project where the existing Reference.cs created by the Add Web Reference process lives, overwriting the existing file. You should see that the file sizes are about double. That is because the wsdl.exe has property wrappers for all the fields that the Add Web Reference one just exposed publicly.

5. Close the Data Sources window. Then close Visual Studio. Then reopen your project in Visual Studio 2005 and reopen the Data Sources window.

you should now be able to drill down into the properties of the data source objects returned from the web methods of the web service, and if you drag them onto a form, proper UI will be generated.



.NET | Community | Languages and Tools

Friday, August 13, 2004 11:21:51 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

Demos from today's Windows Forms Data Binding with Data Sources in Visual Studio 2005 MSDN Webcast

Here are the demos from today's MSDN Webcast on using the Data Sources Window in Visual Studio 2005 to generate data bound UI in Windows Forms applications.

One caveat - I accidentally lied about the little demo I showed at the end that was getting album covers from the Amazon Web Service. While it is an interesting little demo, I was mixing it up with the greater project I created it for as far as the involvement of the Data Sources window. This app is actually just a simple Web Service client that takes the values returned through a data set and dynamically generates PictureBox controls to present them. The DataSources window actually has no play in this one. I included the code anyway, if you want to run it, you will have to go get a developer ID for the Amazon Web Service at http://www.amazon.com/gp/aws/landing.html. You will need to plug this in to the agent source file where it says to plug in your id here.

 



.NET | Languages and Tools

Friday, August 13, 2004 10:53:41 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

Demos from today's Extend ASP.NET MSDN Webcast

You can download the demos here.



.NET | Languages and Tools

Friday, August 13, 2004 8:40:42 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Thursday, August 12, 2004

UIP MSDN Webcast demos

Look here

Thanks!



.NET | Architecture | Languages and Tools

Thursday, August 12, 2004 10:46:16 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

Passing Arguments when starting a task in UIP

Version 2 of the UIP application block came out back in April, and included a lot of new functionality. Unfortunately, they also broke one important capability in moving from v1 to v2: the ability to pass in an set of initialization arguments to get a task initialized.

In V1, there was an overload of the UIPManager.StartTask method that allowed you to pass in an instance of a TaskArgumentsHolder object, which itself has a placeholder TaskArguments object reference where you could stuff anything you needed to pass downstream to the task that is being launched, such as user login info, command line or querystring params, etc.

This disappeared in V2 with the move to multiple navigation models. However, the fix is pretty straightforward to get that capability back - it just involves making a minor tweak to the UIP library source code, which is not a problem since you get full source code with the block.

Basically, what you need to do is go into the Navigators folder within the UIP project, and for each navigator type you want to support arguments on, you need to change the visibility of the StartTask method that takes a TaskArgumentsHolder parameter from private to either internal or public:

public void StartTask(TaskArgumentsHolder holder) { ... }

Then go into the UIPManager class, and add an overload for each of the StartXXTask methods that takes a nav graph name and a TaskArgumentsHolder, and have it call the appropriate StartTask on the appropriate navigator:

public static void StartNavigationTask(string navGraph, TaskArgumentsHolder holder)

{

GraphNavigator navigator = new GraphNavigator(navGraph);

navigator.StartTask(holder);

}

As soon as you do that, you are back in business. You can start a task and pass in arguments with something like this:

TaskArgumentsHolder holder = new TaskArgumentsHolder(Guid.Empty,null,"startupargs");
UIPManager.StartNavigationTask("StartupParams",holder);

That's all there is to it.



.NET | Architecture | Languages and Tools

Thursday, August 12, 2004 6:54:14 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

Troubleshoot ClickOnce Deployment problems

A tool that many people are not aware of is MaGe - the Manifest Generator tool (mage.exe). It resides under your root Visual Studio 2005 directory SDK folder in the bin subfolder along with the rest of the .NET SDK tools.

ClickOnce deployment (.application) and application (.exe.manifest) manifest files are just XML files with a particular schema that are digitally signed with either a strong name key file (.snk by convention) or a publlisher certificate. That signing process ensures the identity of the publisher as well as making sure that the manifests are not tampered with (say to add a malicious file as part of the application download) after being published.

MaGe allows you to open, edit, and save both types of manifest files. When you save the file, it prompts you for a key file or certificate to re-sign the manifest. The tool is intended for large organizations where the deployment servers will likely be managed by IT folks that are not the developers and not running VS2005, so that they can make updates to the deployed applications and the information that goes into the manifest.

However, MaGe can also be a big help in troubleshooting and understanding your ClickOnce deployments in the development environment, especially while we are still in Beta and sometimes problems occur. One of my collegues was having a problem where he could not launch any of his ClickOnce applications after publishing. We are still trying to track down root cause, but simply opening the manifests in Mage and resaving them fixed the problem.

You saw in a previous post how you can also use MaGe to handle resigning the deployment manifest after making a manual addition to support command line arguments.

Just another good trick to have in your toolbox if you are working with ClickOnce. Hopefully this will really just be a handy tool for admins once we get to release, but for now it is pretty important for devs as well.



.NET | Languages and Tools

Thursday, August 12, 2004 11:31:37 AM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Tuesday, August 10, 2004

Harvesting ClickOnce Command Line Arguments

Thanks to Jamie Cool, Microsoft PM for ClickOnce, for providing the answer on a question I am often asked in talking about ClickOnce:

Question: How can I use command line parameters with a ClickOnce deployed application?

To answer that, you need several pieces of information:

1) How do you pass command line arguments to a ClickOnce application?

ClickOnce applications are launched using a URL to the deployment manifest (.application) file. So you use web querystring parameter syntax:

http://mydeploymentserver/MyApplicationFolder/MyApplication.application?param1=foo&param2=bar

2) How do you tell ClickOnce and .NET Security to allow you to use the command line parameters?

Under the covers, you need to add a trustURLParameters=“true“ attribute to the deployment element in the .application (deployment) manifest file. In Beta 2, or at least by release, this should just be a checkbox in the poject properties Publish section. You can do this by dragging the .application file into Notepad.

You then need to open the manifest with the mage.exe tool (located in the <vstudio 8>\SDK\bin folder), and save it again, specifying a key file to re-sign the manifest. If you try to launch the app without doing this, the runtime won't do it on the client machine because it sees that the manifest has been tampered with since it was published.

Make sure to check the .application file again after signing to see if your trustURLParameters attribute is still there. If you screwed up the (case sensitive) name (as I did the first couple times), the Beta 1 mage tool will throw away any attributes it doesn't recognize when you save to re-sign the manifest.

3) How do you harvest the values passed via querystring assuming you have done 1 & 2?

string cmdLine = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0];

This will give you back the entire command line (URL with parameters), so you just need to parse that string for the ? separator between the path and the params, and then parse the remainder for the & and = separators.

Piece of cake!

 

 



.NET | Community | Languages and Tools

Tuesday, August 10, 2004 10:58:37 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

ClickOnce demos from today's MSDN webcast

Download them here.

Enjoy!



.NET | Community | Languages and Tools

Tuesday, August 10, 2004 10:51:10 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


 # Monday, August 9, 2004

Digging out...

I'm not exactly what anyone would consider a frequent blogger, but it is my intent to share a few technical thoughts through this blog from time to time.

I have been dark on any real content lately other than links to demos and such because I said “Yes” about 10 times to many and have been totally buried with 8 webcasts, 4 conference talks, 4 user group talks, 6 book chapters, two product reviews, and a book technical review, all on top of full time consulting load, all in the span of July - September. So as you can guess, all that content creation and work doesn't leave a whole lot of leisure time for things like blogging. Heck, I have even stopped reading most of the blogs that I like because I flat out couldn't afford the time. Basically, my head has been about to explode for a while now, with me constantly asking myself: “why did you sign up for all this crap??“

Well, I am past most of it, at least the content creation parts of it, and plan to start blogging more to share some of the stuff I have been working on. I am spending a lot of time with the new WinForms features since that is what my book is about (due out with the release of .NET 2.0 next year), and am really digging the experience. The WinForms team has really done an awesome job with all the new stuff for building smart/rich client apps.

I've got 4 more webcasts this week that you may want to tune into if you have time:

Tuesday 10 Aug: Deploy Smart Client Applications with ClickOnce (1 PM PST)

Thursday 12 Aug: User Interface Process Application Block (1PM PST)

Friday 13 Aug: Extending ASP.NET (11 AM PST)

Friday 13 Aug: Bind Data Sources to WinForms Controls in Visual Studio 2005 (1 PM PST)

Then I am speaking at the Northampton MA .NET Architects group on 16 Aug (ASP.NET 1.1 Databinding), the NYC.NET group on 19 August (ClickOnce), and giving 4 talks at TechEd Malaysia in Kuala Lumpur 12-18 September. Then Extending ASP.NET for the DelMarva .NET Users Group in October, same for Little Rock Users group in November, and 3 talks at Visual Studio Connections in November in Las Vegas.

I love doing this stuff and teaching people how to use .NET. Too bad most of that doesn't directly earn me a cent... :)



.NET | Blogging | Community

Monday, August 9, 2004 9:02:56 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 

DataGridView demos from MSDN Webcast today

Here are some simple demos I presented today in my webcast on the DataGridView control in .NET 2.0. Lots of cool new features for WinForms developers.

Kiss that obnoxious DataGrid goodbye!! There's a new grid in town, yaheer? (Yes it is still fully supported for backward compatibility!)



.NET | Community | Languages and Tools

Monday, August 9, 2004 8:48:33 PM (GMT Daylight Time, UTC+01:00)
Comments [0]  | 


















May, 2013 (1)
April, 2013 (2)
March, 2013 (2)
February, 2013 (2)
January, 2013 (2)
December, 2012 (3)
November, 2012 (1)
October, 2012 (1)
August, 2012 (2)
June, 2012 (2)
May, 2012 (3)
April, 2012 (1)
March, 2012 (2)
February, 2012 (2)
January, 2012 (1)
November, 2011 (4)
October, 2011 (1)
September, 2011 (2)
August, 2011 (1)
July, 2011 (1)
May, 2011 (5)
March, 2011 (4)
February, 2011 (2)
January, 2011 (3)
November, 2010 (4)
October, 2010 (1)
September, 2010 (5)
August, 2010 (5)
July, 2010 (6)
June, 2010 (8)
May, 2010 (2)
April, 2010 (2)
January, 2010 (1)
December, 2009 (3)
November, 2009 (2)
October, 2009 (3)
September, 2009 (3)
August, 2009 (2)
July, 2009 (3)
May, 2009 (3)
April, 2009 (2)
March, 2009 (1)
February, 2009 (2)
January, 2009 (2)
December, 2008 (1)
November, 2008 (2)
October, 2008 (5)
September, 2008 (4)
August, 2008 (2)
July, 2008 (1)
June, 2008 (2)
May, 2008 (2)
April, 2008 (3)
February, 2008 (6)
January, 2008 (3)
December, 2007 (1)
November, 2007 (1)
October, 2007 (5)
September, 2007 (1)
July, 2007 (3)
June, 2007 (8)
April, 2007 (2)
March, 2007 (4)
February, 2007 (1)
December, 2006 (2)
November, 2006 (9)
October, 2006 (5)
September, 2006 (3)
August, 2006 (2)
July, 2006 (4)
June, 2006 (5)
May, 2006 (10)
April, 2006 (4)
March, 2006 (2)
February, 2006 (12)
January, 2006 (7)
December, 2005 (2)
November, 2005 (15)
October, 2005 (6)
September, 2005 (7)
August, 2005 (3)
July, 2005 (10)
June, 2005 (11)
May, 2005 (7)
April, 2005 (8)
March, 2005 (6)
February, 2005 (2)
January, 2005 (6)
December, 2004 (3)
November, 2004 (5)
October, 2004 (2)
September, 2004 (5)
August, 2004 (13)
July, 2004 (6)
June, 2004 (14)
May, 2004 (17)
April, 2004 (12)
March, 2004 (8)
February, 2004 (10)
January, 2004 (14)
December, 2003 (9)
November, 2003 (13)
October, 2003 (3)

Sign In
Copyright © 2006-2012 Brian Noyes. All rights reserved.

designed by NUKEATION STUDIOS