Scott Hanselman

My Graduation Cake

June 10, '03 Comments [1] Posted in Web Services
Sponsored By

A picture named UPDATED P0006191 (Medium).jpgMy wife used the C# Wallpaper from IrritatedVowel.com on the top of my Graduation cake...the results are pretty snazzy!  Everyone was quite impressed with code on a cake, although lots of not-so-funny-people insisted there were some syntax errors...:)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Schweet: Free .NET Hosting for Developers

June 10, '03 Comments [2] Posted in Web Services | ASP.NET | TechEd | Speaking
Sponsored By

Here's a useful and exciting thing to discover on my return from TechEd:  EasyStreeet is offering Free .NET Hosting for Developers.   It's Six Months Free with the .NET Framework 1.1, with ASP.NET, all the BCL (of course), and support for Web Services.

I've been looking around at inexpensive but powerful ASP.NET Hosting to get some of my other small projects off the ground (in addition to www.diabeticbooks.com and www.pioneercourthousesquare.com among others) and this looks like a deal that's too sweet to pass up...might be a nice way to start testing out some blogging and RSS aggregation thoughts, as well as some No-Touch-Deploy WinForms.

All you have to do is email them to get setup:

To submit your request: email your name, company name, email and phone number to NETPlayground@easystreet.com.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

WSDL Cleanliness is next to Godliness (actually Cleavage is next to Cleanliness and Goggles is next to Godliness...)

June 10, '03 Comments [6] Posted in Web Services | ASP.NET | TechEd | Speaking | XML
Sponsored By

So let me start my own little possee here and cry: Say No to inline schema definitions in WSDL! Import is your friend.... [Commonality]

I'm with Tomas on this one. Schemas should be written as standalone documents and then be imported into the WSDL document. Not only is this easier to manage for the developer writing the schema and WSDL, but it's also easier for those who have to grok the two. Besides, the service you're writing the WSDL for probably isn't the only thing that's going to need access to the types you define in the schemas. [Drew Marsh]

Totally...not only WSDL First! and <xs:import> but (maybe this is obvious) I'm getting in the habit of putting the Domain Object-y definitions that we use elsewhere and the SOAP-y GetDomainObjectResult/Response definitions into separate XSDs.  I preached this at TechEd last week and spoke briefly to Tomas about it although we didn't have enough time to really dig in.

 <wsdl:types>
    <xs:schema>
   <xs:import namespace="
http://banking.corillian.com/Account.xsd" schemaLocation="Account.xsd"/>
   <xs:import namespace="
http://banking.corillian.com/Banking/GetAccounts" schemaLocation="GetAccounts.xsd"/>
  </xs:schema>
 </wsdl:types>

In this small example, the Account.xsd schema contains all sorts of Account-specific definitions that we may pass around internally to our app (on Queues, to functions, as objects, without SOAP) and GetAccounts.xsd contains definitions for GetAccountsResult and GetAccountsResponse and other useful "container" definitions in a separate namespace.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

"Gotchas" around Primary Interop Assemblies and the GAC

June 10, '03 Comments [0] Posted in Web Services | Tools
Sponsored By

A couple of things to be aware about when working with PIAs, particularly when deploying them.  PIAs provide a unique type identity for COM Components.  They provide a single place for your .NET app to interop with existing COM objects.  They get marked with the PrimaryInteropAssembly attribute...if there's any question about an assembly, you can ILDASM it and see the PrimaryInteropAssembly attribute in the Manifest. 

You can create a "vanilla" PIA with TLBIMP.exe like this (note the /primary key):

TlbImp MyCom.tlb /primary /keyfile:MyKey.snk /out:MyPIALib.dll

If you want to create a custom PIA, perhaps to marshal types a specific way you'll apply the attributes from source:

[assembly:Guid("xxxxxxx-xxxx-xxx-xx-xxxx-xxxx"]
[assembly:PrimaryInteropAssembly(3, 1)] //Version 3.1

Of course the COM Object that you're referring to has to be registered, but the PIA has to be as well.  You'll need to call RegASM.exe to create a key in the registry under HKEY_CLASSES_ROOT\TypeLib\{yourclassid}\PrimaryInteropAssemblyName.  The value of this key should be the fully qualified Assembly name like: MYDLL, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.  Some folks call RegASM, others ship a .REG file or create this key during the installation procedure.

To recap:

  • Register COM Object (if not already)
  • Create InteropAssembly with TLBIMP.EXE and /primary (make sure it's strongly named)
  • RegASM the resulting InteropAssembly
  • Put the PIA in the GAC

Note also that when referencing your PIAs in Visual Studio.NET via "Add Reference..." you won't find your PIA in the .NET Tab as some may think.  Just select the original COM TLB/DLL reference from the COM Tab and Visual Studio will silently search for and use the PIA.  You can confirm this by looking at the added reference in the Properties Toolbox and confirming that it's strongly named.

Also check out Sam Gentile's article about Programmating Determining if a PIA in in the GAC and Mattias' page on the Fusion APIs.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Leaning at the Tape...a B.S. in Software Engineering squeezed into 11 short years...

June 6, '03 Comments [7] Posted in Web Services | TechEd | Speaking
Sponsored By

Thanks Tomas, for noticing my MSN Messenger name had been updated to reflect my College Graduation tonight!  I'm getting a B.S. in Software Engineering from OIT and it only took 11 years.  The ceremony is at OIT in Portland on 185th and Walker at 7pm.  I'm one of the students who has been asked to say a few words - which is nice since I've "outlived" four department heads.  Even more exciting is that I've joined the staff as an adjunct to teach C# this fall, one of only two professors without Master's Degrees. 

This has been an amazing week with TechEd, Graduation, and this teaching opportunity all at once.  Thanks to everyone who has supported me this past year.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.