<2017 March>
SunMonTueWedThuFriSat
2627281234
567891011
12131415161718
19202122232425
2627282930311
2345678

On this page...

PDC2008 - PDC #7 For Me
Why No String.Contains(string, StringComparison)?
Yet Another Microsoft Application Not Supporting x64
Error: Unrecognized option 'async' specified
Mid-2008 and x64 is Still a Dead End
nGallery TNG Update
Xlinq Guestbook for VS 2008 RTM
CCCP 3 Beta 1 (VSTS 2008 RTM Compatible)
The Week in Review - TechEd Developers 2007 Sessions
XSS Detect Beta Code Analysis Tool
How ASP.NET began in Java
SharpDevelop Supports IronPython
CruiseControl.NET 1.3.0.2918 & MSBuild Output
MS Sample for Starting Elevated Processes (UAC)
Microsoft Code Name "Acropolis" Community Technology Preview 1
What's New in IIS7 Beta 3?
FOSDEM Video Recordings
Microsoft Synchronization Services for ADO.NET CTP
UAC Elevation in Managed Code: A .NET COM Component Elevated
UAC Elevation in Managed Code: "Talking" to an Elevated Process via WCF
UAC Elevation in Managed Code: Starting Elevated COM Components
A reference to ... could not be added
Crashing Vista With WPF Applications
Creating a WiX-Based Installer with SharpDevelop
CCNetConfig - A GUI for Editing CruiseControl.NET Configuration
Passing the News: Online Security Sessions from TechEd IT Forum Available
Security Brief: Why won't my simple WCF service start when I run it as a non-administrator?
MSDN Nuggets
Open Source (.NET) News
Another Beta of SharpDevelop 2.1 Has Arrived
The Yearly MSDN Magazine Security Issue Has Landed
Advanced Code Access Security
What does the /debug+ switch really do?
SharpDevelop2 2.1 Beta 1
SharpDevelop2 2.0 Final Hits the (Virtual) Streets
Microsoft Threat Analysis & Modeling v2.0 RC2
Assorted .NET Framework 3.0 Downloads
ADO.NET vNext: The Entity Framework, LINQ and more
Talk Resources: WF & ASP.NET
ASP.NET & Windows Workflow Foundation vNext
Microsoft .NET Framework 3.0 Community (NetFx3)
Configuration-Based Dependencies
SharpDevelop2 Release Candidate 2 Available
Enterprise Library 2.0 Hands On Labs
The Developer Highway Code
THE Authoritative Article on NGen
Professional ASP.NET 2.0 Security, Membership, and Role Management
Ready to Rock the Launch
ImageCache, Take One
Windows Workflow Foundation Beta 1.2
Windows "Monad" Shell Beta 3 for .NET Framework 2.0
Do Me a Favor - Use FxCop
Article: Building Applications with the SharpDevelop Core
Google PageRank as a .NET Assembly
Next Week: ADC 2005 - Advanced Developers Conference
My in C#
Convert C# 2.0 Code to VB.NET 8.0
Crashing Visual Studio 2005 for fun
Microsoft CLR Overview
Warning: Low-Flying Golf Balls
PDC05: Last Men Standing
PDC05: Day Two, Wednesday
PDC05: Day One in Review
PDC05: Attack and Defense: The Art of Secure Coding
Slides, Demos, Links for Yesterday's UG Talk
TechTalk "Repeat" @ .NET UG Styria
German MSDN Developer Center - Security Revamped
Community-driven Security Conference in Vienna, Austria
#d^3 coming to a close
Process Explorer and .NET Applications
GAT - Guidance Automation Toolkit
mono::live
VSTO 2005 is Cool
Software Development Kit for Windows Mobile 5.0
Go-Live License
Visual Studio 2005 Team Foundation Server Beta 2 Installation Guide
Subversion Post Commit Hook v1.3
Update for the Post Commit Hook
Post Commit Hook for Subversion, the .NET way
Community Day: Indigo
Rico Mariani's Articles and Recommendations
Training CD: Microsoft ASP.NET Using Visual C# .NET
Developing Applications in Visual C# .NET
.NET DA: Securing Service Oriented Architecture (SOA) with Microsoft's WSE 2.0
CLR Exception Handling And Memory Management Presentation
February CTP now available
.Net Compact Framework Memory & GC Articles
Customizing the Microsoft® .NET Framework Common Language Runtime
Web Services Enhancements (WSE) 2.0 SP3
The AutoCompleteType Property
ASP.NET 2.0 Training
When not to use RegEx to match strings
CodeHTMLer
.NET for Managers
Enterprise Library and PatternShare.org
Webcast now downloadable
Microsoft .NET Framework SDK Setup 1.1 Installation Failure
The old tools are still the best
Next Monday: MSDN Webcast by His Chrisness
Browsing sf.net's software map
Team Foundation Installation Guide for December CTP
Registry Editor for SmartPhone - v0.8.2 comes with Search!
WeRock247.NET & Football247.NET Training DVDs
Registry Editor for SmartPhone - An Update (v0.8.1)
Generics – Misconceptions Abound
#usblib - a library for low-level USB access in .NET
HOL: WSE 2.0 Security
Registry Editor for SmartPhone - Take a First Look!
Pluralsight Tools
CodeDOM Fun
Development Process Best Practice Train the Trainer Event
Samoa Project
Paint.NET 1.1 released
OWASP .NET Projects
Things to check out: MbUnit
#develop team blog
Is Windows Forms Dead?
Free eBook: Getting Started with Smartphone Development
#develop 1.0 released
Microsoft .NET Framework 1.1 Service Pack 1
C5 - A library of generic collections
"The .NET Developer's Guide to Windows Security" available online
Search

Links

Member of...


ASP Insiders

MVP Visual Developer ASP/ASP.NET

Enter CodeZone

Blog Categories

Microsoft

Blogroll

Deutsche Resourcen

Management

Sign In
 

#  Friday, 24 October 2008

During PDC05 I put up a post PDC's I have attended so far. Next week, I am going to add another one to the list - PDC2008 is my seventh Professional Developers Conference. Kind of makes me look old ;-)

 

Categories: .NET | this | Training and Conferences
Friday, 24 October 2008 08:09:45 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 08 October 2008

IndexOf has overloads that take StringComparison which allows me to specify how the comparison is done: culture (in)sensitive, case (in) sensitive, et cetera. Why is it that Contains doesn't sport such an overload? IndexOf makes a LINQ query look so much more ugly than Contains...

Categories: .NET | C#
Wednesday, 08 October 2008 14:37:23 (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]

 



#  Tuesday, 07 October 2008

This time it is the Visual Studio 2008 extensions for Windows Sharepoint Services 3.0:

Given all my past run-ins with developing on x64, how is anyone supposed get any development work done on a x64 box?

Categories: .NET | x64
Tuesday, 07 October 2008 18:36:13 (W. Europe Daylight Time, UTC+02:00)  #    Comments [2]

 



#  Tuesday, 05 August 2008

The MSDN article Synchronous and Asynchronous Operations explains what options are available to you when using WCF. It even tells me that svcutil.exe has an /async switch. Great!

Now, back to my current home turf, Compact Framework. There is netCFsvcutil.exe, that comes with the Compact Framework Power Toys 3.5. Guess what? That option isn't available in this scaled down rendition of svcutil.

Once again Compact Framework makes it so much harder to work productively, and here's why:

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

Quote: Asynchronous delegates, specifically the BeginInvoke and EndInvoke methods, are not supported in the .NET Compact Framework.

Back to the drawing board and the thread pool (most likely).

Categories: .NET | 3.5 | Smartphone and PocketPC
Tuesday, 05 August 2008 18:43:23 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 30 July 2008

I am currently working on a Compact Framework project, and started development on a different machine - where I successfully used the Cellular Emulator of the Windows Mobile SDK. Today, on the other machine (the laptop), it didn't start but present me with the following error message:

After some searching (on the G-word search engine), I came across this post:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3538593&SiteID=1

Sure enough I am using Vista x64, heck, we are living in 2008 with multicore CPUs and 4GB+ of RAM!

And here is the Catch 22: when moving development to a Virtual PC image, you don't get USB ports which you need for connecting to a real device...

Categories: .NET | Smartphone and PocketPC | Vista | x64
Wednesday, 30 July 2008 16:55:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]

 



#  Thursday, 13 December 2007

This is a bugfix release for the previously posted port of nGallery to ASP.NET 3.5. The following changes are incorporated:

  • Bugfix: slideshow had "photos/" hardcoded in nGalleryLib (for navigation buttons)
  • Bugfix: Event log exceptions, please see Get GoogleBot to crash your .NET 2.0 site (plus ASP.NET 2 + url rewriting considered harmful in some cases). Nicolas Sorel was nice enough to provide me with his .browser definition files.
  • Bugfix: default_highlight_image.jpg no longer resided in /photos and therefore caused an exception for galleries that had no highlighted image; moved it back to \photos
  • Change: AlbumHandler no longer implements IHttpHandler
  • Change: AssemblyInfo.cs changed version to 2.0 to differentiate from original 1.6.1

That's all the changes that happened, here are the source and deployment files:

nGalleryTNG2_ProjectFiles.zip (2.95 MB)
nGalleryTNG2_WebFiles.zip (1.03 MB)

Categories: .NET | ASP.NET | Use the source Luke
Thursday, 13 December 2007 11:42:52 (W. Europe Standard Time, UTC+01:00)  #    Comments [4]

 



#  Friday, 30 November 2007

I posted a version of the Really Simple Guestbook - With XLinq for Orcas Beta 2 earlier on this blog. Today, I updated this small application for VS2008 RTM. The following changes are incorporated:

  • It is now a Web project, no longer file system based
  • It includes AIP for form spam protection (aka captcha)

I decided to not include the Microsoft Anti-Cross Site Scripting Library V1.5, that is up to the reader if additional security is required (note: you'd have to add this to AddEntry.aspx's logic of inserting new guestbook entries).

Download: XlinqGuestbook.zip (165.53 KB), License: BSD

Categories: .NET | 3.5 | ASP.NET
Friday, 30 November 2007 09:55:46 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 29 November 2007

I updated the TFS Code Comment Checking Policy so that it works with VSTS 20008 RTM. The downloaded labeled as Beta 1 comes with the well-known setup, the changes to the August test version are only minimal: the parser has been updated (to better support C# 3.0), and all projects now target .NET Framework 3.5.

Please use the discussions to report any issues you find.

Categories: .NET | 3.5 | Team System | Visual Studio
Thursday, 29 November 2007 11:44:23 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Friday, 09 November 2007

TechEd Developers 2007 is over, and before moving on (and flying back to snow in Austria), here is the list of sessions I attended this year:

  • TLA201 - A Tour of Visual Studio 2008 and the .NET Framework 3.5
  • OFF401 - .NET Developers Advanced Introduction to SharePoint 2007
  • TLA324 - What's New in Team System for Software Testers
  • SEC301 - CLR Security in .NET Framework 3.5
  • DAT201 - Entity Framework Introduction
  • WEB401 - Building Highly Scalable ASP.NET Web Sites by Exploiting Async Programming Models
  • TLA304 - Building Services with the Service Factory: Modeling Edition
  • DAT303 - Entity Framework: Application Patterns
  • TLA305 - Continuous Integration With and Without Team System
  • TLA307 - Improving Code Performance with VSTS 2008 Team Edition for Software Developers
  • DAT304 - Managing Unstructured Data in SQL Server 2008: Introducing the FileStream Datatype
  • TLA403 - Loose Coupling in Practice: CAB in the Real World
  • ARC401 - Designing High Performance, Persistent Domain Models
  • TLA407 - Dealing with Concurrency and Multi-Core CPUs with Today's Development Technologies
  • SBP307 - Modeling and Composition of Applications
  • TLA319 - The Joins Concurrency Library
  • TLA405 - Parallel and Async Functional Programming on .NET with F#
  • WEB403 - Securing your High-Risk ASP.NET Web Applications - A Case Study

Compared to last year, I managed to attend more sessions, however, there were also more duds. The last session (WEB403) turned out to be the one that earned the raspberry this year (a close runner-up: TLA403). Coming out on top I decided to nominate three: OFF401, TLA307 and DAT303.

Categories: .NET | this | Training and Conferences
Friday, 09 November 2007 19:15:43 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Friday, 02 November 2007

XSSDetect is a static code analysis tool that helps identify Cross-Site Scripting security flaws found within Web applications. It is able to scan compiled managed assemblies (C#, Visual Basic .NET, J#) and analyze dataflow paths from sources of user-controlled input to vulnerable outputs. It also detects whether proper encoding or filtering has been applied to the data and will ignore such "sanitized" paths. Download

Categories: .NET | ASP.NET | Security | Visual Studio
Friday, 02 November 2007 12:51:21 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Tuesday, 30 October 2007

Article at The Register: How ASP.NET began in Java. Reminds me of the "C# is COOL" t-shirt I have...

Categories: .NET | ASP.NET
Tuesday, 30 October 2007 17:12:41 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Sunday, 21 October 2007

If you are interested in IronPython, you should check out Matt's latest SharpDevelop addin: IronPython Integration In SharpDevelop 2.2. His blog post details the status of code completion, Windows Forms designer support, plus: converting code from C# or VB.NET to IronPython.

Please note that this is a work in progress, and that the official release of this addin will be for SharpDevelop 3 and IronPython 2.0.

Categories: .NET | Use the source Luke
Sunday, 21 October 2007 19:36:15 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Sunday, 24 June 2007

The recently released version of CruiseControl.NET has a small issue with MSBuild Output in the Web dashboard: Unable to load transform: c:\ccnet\webdashboard\xsl\msbuild.xsl. A fix can be found in this thread in the fourth post. The reason to upgrade to 1.3? CC.NET now runs on .NET 2.0 (it has been ported), and it has a feature I want to try: integration queues.

Categories: .NET | Use the source Luke
Sunday, 24 June 2007 20:32:38 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 04 June 2007

Microsoft released a UAC demo. It is just basic process elevation (read: save the time by not downloading it), which I described in more detail (with more reuseability) in UAC Elevation in Managed Code: Starting Elevated Processes.

Categories: .NET | Vista | UAC
Monday, 04 June 2007 10:34:52 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 

I have been patiently waiting for this one, quote from the download page: “Acropolis” builds on the rich capabilities of Microsoft Windows and the .NET Framework, including Windows Presentation Foundation (WPF), by providing tools and pre-built components that help developers quickly assemble applications from loosely-coupled parts and services.

Download

Monday, 04 June 2007 08:26:40 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 26 April 2007

Bill Staples put together a post on what's new in IIS7 Beta 3. He also talks about the all-new IIS7 FTP server (which I knew about for a long time - I had hoped Beta 3 would be available for my MSDN Briefing in Vienna last month, but no such luck). Also, he mentions the GoLive! license for IIS7.

Categories: .NET | ASP.NET | IIS | Longhorn
Thursday, 26 April 2007 12:20:02 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 28 February 2007

The video recordings for the main tracks of FOSDEM 2007 are online now. Of interest for .NET developers might be Miguel's session on "Turbocharging Linux with Mono".

Categories: .NET | Community
Wednesday, 28 February 2007 09:20:15 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 15 February 2007

At long last at least a CTP is available. Definitely worthwhile to check out.

Categories: .NET | SQL Server
Thursday, 15 February 2007 10:46:14 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 05 February 2007

I admit it: UAC Elevation in Managed Code: "Talking" to an Elevated Process via WCF is a kludge. The reason why I dabbled with this approach at all is that I failed to implement COM elevation with managed code (not elevating a COM component, but the COM component itself). However, at long last, I succeeded in that respect too: I now present you the all-managed code solution to UAC elevation!

Once again I built myself a small demo frontend application:

As you can guess, the first button does plain vanilla COM InterOp without any UAC elevation. Thus its code is rather simple:

private void simpleCallButton_Click(object sender, EventArgs e)
{
  Type t = Type.GetTypeFromCLSID(new Guid("71E050A7-AF7F-42dd-BE00-BF955DDD13D4"));
  object o = Activator.CreateInstance(t);
  t.InvokeMember("SayHello", BindingFlags.InvokeMethod, null, o, null);
}

Why this reflection magic? Well, the COM component I am calling here is implemented in .NET - and both VS as well as tlbimp balk at reimporting the exported type library.

The COM component in question has been regasm'ed & gacutil'ed (ManagedElevator project in the download). Although the name implies that I am after elevation, it is pretty much a standard COM component written using C#:

public class TheGuids
{
  public const string IHelloWorld = "B8CD5C09-9ACD-49b0-BF6F-C7B0F29795F9";
  public const string ClassToElevate = "71E050A7-AF7F-42dd-BE00-BF955DDD13D4";
  public const string AppId = "75AB90B0-8B9C-45c9-AC55-C53A9D718E1A";
}

[Guid(TheGuids.IHelloWorld)]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IHelloWorld
{
  [ComVisible(true)]
  void SayHello();
}

[Guid(TheGuids.ClassToElevate)]
[ClassInterface(ClassInterfaceType.None)]
public class ClassToElevate : IHelloWorld
{
 public ClassToElevate()
 {
 }

 [ComVisible(true)]
 public void SayHello()
 {
  MessageBox.Show("Hello World");
 }
}

So how do you go from "standard" "plain-vanilla" COM component to COM elevation? The part that stumped me for so long was the ClassInterface attribute - if you forget this guy, you'll end up with an InvalidCastException thrown by UACManager.LaunchElevatedCOMObject.

But that's not quite all to get up and running with COM elevation: in addition, you need to modify the default registration for this component - specifically, you need to configure the DllSurrogate. This is where the AppId GUID comes into play: it isn't used in code (kept there for documentation purposes only), but in registryadditions.reg. It binds the various registry keys. And speaking of this .reg file, please take note of the LocalizedString value: it contains the text for the UAC prompt (also check out UACPrompts.rc, resource.h, compilerc.bat as well as the properties of the ManagedElevator project where the compiled .res file is referenced).

Note Before importing the .reg file into the registry make sure to fix the file path contained in LocalizedString! And if you create your own elevated COM component DO NOT reuse any of my three GUIDs - use guidgen.exe to create your personal ones.

From there, UAC elevation is smooth sailing. The Reflection version of COM elevation looks very similar to non-elevated calls:

private void managedElevation_Click(object sender, EventArgs e)
{
  // CLSID
  Guid classId = new Guid("71E050A7-AF7F-42dd-BE00-BF955DDD13D4");

  // Interface ID
  Guid interfaceId = new Guid("B8CD5C09-9ACD-49b0-BF6F-C7B0F29795F9");

  object o = UACManager.LaunchElevatedCOMObject(classId, interfaceId);

  Type t = o.GetType();
  t.InvokeMember("SayHello", BindingFlags.InvokeMethod, null, o, null);

  Marshal.ReleaseComObject(o);
}

Of course this is not really a good solution (late binding). So instead I manually imported the IHelloWorld interface:

[
ComImport(),
Guid("B8CD5C09-9ACD-49b0-BF6F-C7B0F29795F9"),
InterfaceType(ComInterfaceType.InterfaceIsDual)
]
  interface IHelloWorld
  {
   [
   MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime),
   PreserveSig
   ]
    void SayHello();
  }

Which makes calls into the elevated COM object much easier and cleaner:

private void managedElevationInterface_Click(object sender, EventArgs e)
{
  Guid classId = new Guid("71E050A7-AF7F-42dd-BE00-BF955DDD13D4");
  Guid interfaceId = new Guid("B8CD5C09-9ACD-49b0-BF6F-C7B0F29795F9");

  object o = UACManager.LaunchElevatedCOMObject(classId, interfaceId);

  IHelloWorld ihw = (IHelloWorld)o;
  ihw.SayHello();

  Marshal.ReleaseComObject(o);
}

So why should you use the COM elevation solution instead of starting the process? Well, there are a couple of reasons:

  • You can package more than one component into a DLL and still have custom UAC prompts thanks to LocalizedString
  • Your users don't get "an unidentified program..." warnings. Thank you COM registration
  • If you ever need to talk more extensively with the elevated process then this approach can be adapted more easily

The source code

ConsumeMyElevatedCOM.zip (97.56 KB)

You will find a file aptly named notes.txt in the ManagedElevator project that describes all the necessary steps to get up and running.

I hope you find this sample useful and not have to spend as much time as I did. Cheers!

Categories: .NET | Security | UAC | Vista
Monday, 05 February 2007 22:41:46 (W. Europe Standard Time, UTC+01:00)  #    Comments [7]

 



#  Sunday, 04 February 2007

In the blog post UAC Elevation in Managed Code: Starting Elevated Processes I talked about how to start an elevated process. However, just starting a process might not cut the mustard, for example if you need to hand over data to the elevated process. You could achieve this by passing, let's say, some data as command line arguments to ProcessInfo before starting the elevated process. But that seriously limits communication.

So how can you perform communication with an elevated process? My first idea was to use .NET Remoting. Once I thought through the multi-instance scenario, I quickly realized that this meant the server had to be running in the non-elevated application, because only it could properly choose a port. And because I am not a fan of Remoting anyways, I decided to give WCF (Windows Communication Foundation, a pillar of .NET 3.0) a try.

It looked like smooth sailing at first, but then I realized that with WCF too I needed to implement the service inside the non-elevated application. This time, however, the reason was "How do I know when the elevated application has initialized before I can actually start communicating with it?". Back to the drawing board.

The final solution now looks like this: the non-elevated application starts a service. The operations contract specifies a callback, which, once the elevated application has signalled its readiness, can be used by the non-elevated application to "talk" with the elevated application. I didn't intend to go duplex, but hey, if there's no other way I am willing to take plunge. Speaking of tricks of the trade: I am using imperative binding to a named pipe. Reason? Well, WS bindings won't work (see here and here), and the TCP channel would pop up a firewall warning. That's why.

Let's look at the applications - first the non-elevated one:

This time I forfeited eye candy (the shield button). Same (missing eye candy) goes for the elevated application as it is a console application only:

Solution-wise, this simple two-application scenario is split into four projects:

So where do we start? With the easy part inside ElevationContract:

[ServiceContract(Namespace = "http://Christoph.Wille.Samples",
CallbackContract = typeof(IElevatedProcess))]
public interface IWaitForElevatedProcess
{
  [OperationContract(IsOneWay = false)]
  void ElevatedProcessStarted();
}

[ServiceContract(Namespace = "http://Christoph.Wille.Samples")]
public interface IElevatedProcess
{
  [OperationContract(IsOneWay = false)]
  void SayHello(string message);
}

The interface IWaitForElevatedProcess is implemented in StandardUserApp. It is the service endpoint that is initialized before the elevated process is started - and once the elevated application is up and running, it calls into ElevatedProcessStarted. And we are in business for using the IElevatedProcess callback that is implemented in the ElevatedProcess console application.

So how is the service endpoint intialized - let's take a look inside:

private const string theProcess = @"..\..\..\ElevatedProcess\bin\Debug\ElevatedProcess.exe";

private void tryitButton_Click(object sender, EventArgs e)
{
  string channelIdentifier = MiscHelpers.CreateRandomString(64);
  MyUACServiceHost.StartService(channelIdentifier);

  // starting it modal doesn't work (obviously - unless we have more threads, of course)
  ElevatedProcess.Start(theProcess, channelIdentifier);
}

Interesting tidbit #1 is CreateRandomString: it creates a random string to use for the address. Why? Well, if multiple instances of our application are running and trying to elevate a process, we are in trouble. Which brings me to StartService:

internal static void StartService(string pipeEndPoint)
{
  NetNamedPipeBinding binding = new NetNamedPipeBinding();
  binding.Name = "uacbinding";
  binding.Security.Mode = NetNamedPipeSecurityMode.Transport;

  Uri baseAddress = new Uri("net.pipe://localhost/uac/" + pipeEndPoint);

  myServiceHost = new ServiceHost(typeof(SampleService), baseAddress);
  myServiceHost.AddServiceEndpoint(typeof(IWaitForElevatedProcess), binding, baseAddress);
  myServiceHost.Open();
}

As I said before, I am doing it imperatively (no configuration in app.config necessary). That's all there is to getting the service up and running.

Now let's switch to the console application's Main method:

static void Main(string[] args)
{
  if (args.Length != 1)
  {
    Console.WriteLine("One argument expected - the channel identifier");
    return;
  }

  NetNamedPipeBinding binding = new NetNamedPipeBinding();
  binding.Name = "uacbinding";
  binding.Security.Mode = NetNamedPipeSecurityMode.Transport;

  String url = "net.pipe://localhost/uac/" + args[0];
  EndpointAddress address = new EndpointAddress(url);

  WaitForElevatedProcess client = new WaitForElevatedProcess(
      new InstanceContext(new SampleCallback()),
      binding,
      address);

  client.ElevatedProcessStarted();

  Console.WriteLine("The elevated process is now ready");
  Console.ReadLine();

  client.Close();
}

Similar to normal client WCF code, however, with the duplex twist hidden inside WaitForElevatedProcess:

public class WaitForElevatedProcess : DuplexClientBase<IWaitForElevatedProcess>, IWaitForElevatedProcess
{
  public WaitForElevatedProcess(System.ServiceModel.InstanceContext callbackInstance,
 
    System.ServiceModel.Channels.Binding binding,
    System.ServiceModel.EndpointAddress remoteAddress)
       : base(callbackInstance, binding, remoteAddress)
  {
  }

  public void ElevatedProcessStarted()
  {
    base.Channel.ElevatedProcessStarted();
  }
}

Once the channel is connected, this elevated process calls back into the service piece which lives in the non-elevated application, namely SampleService:

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant,
      InstanceContextMode = InstanceContextMode.PerSession)]
public class SampleService : IWaitForElevatedProcess
{
  public void ElevatedProcessStarted()
  {
    OperationContext.Current.GetCallbackChannel<IElevatedProcess>().SayHello("Chris");
  }
}

This method is the workhorse where I can talk to the elevated process - if only my callback interface had more as well as more serious methods ;-)

Speaking of talking, I owe you the code for the callee in the console application:

[CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
public class SampleCallback : IElevatedProcess
{
  public void SayHello(string message)
  {
    Console.WriteLine("Hello world " + message);
  }
}

That's it - to recap: first, we initialize the WCF service. Then elevate a process. This process, once initialized, calls into our service and leaves a callback. And then we are in business talking to the elevated process (setting data, being notified when the elevated application quits and why, ...).

Sample warnings before you download: MyUACServiceHost definitely should be instance instead of static. And, more restricting - starting the elevated process modal won't allow communication unless you start the service on a separate thread. For simplicity reasons I didn't do this for the POC.

ElevateProcessTalkWCF.zip (27 KB)

Before concluding I wanted to add a few words: my ideal implementation for UAC would be COM elevation. That way, one can put more than one component into a single DLL, and still get a meaningful UAC prompt thanks to the LocalizedString registry key - which is per component, and not per executable (which is the case for this solution if you add multiple actions). If you need differing prompts for each administrative action, there is only one course of action you can take with processes: create multiple executables. Not very pretty, but I failed with writing an elevatable (not a word, I am sure) managed (C#) COM component.

Categories: .NET | 3.0 | Security | UAC | Vista | WCF
Sunday, 04 February 2007 22:23:45 (W. Europe Standard Time, UTC+01:00)  #    Comments [3]

 



#  Tuesday, 30 January 2007

The previous installment UAC Elevation in Managed Code: Starting Elevated Processes dealt with starting executables with the "real" administrative token. In this blog post, we deal with starting a COM component with elevated privileges. For in-depth background information, please consult Kenny Kerr's absolutely excellent post on Windows Vista for Developers – Part 4 – User Account Control.

To start with, we need a COM component. Instead of writing an ATL C++ COM component from scratch, I took the MyElevateCom sample from CoCreateInstanceAsAdmin or CreateElevatedComObject sample from the Vista Compatibility Team Blog. Note that for building it, check out my post Visual Studio on Vista: Not so Fast!

Assuming that you built and successfully registered the COM component (it is built to the instuctions from Kenny's post), you can go about and write the managed caller. First, we need a reference to the component:

Then comes the tricky part - actually instantiating the COM component. When you take a look at the C++ example, you see that quite some "moniker magic" is involved that cannot be replicated by simply newing up the component. So how to mimic this behavior in managed code? The Microsoft® Windows® Software Development Kit for Windows Vista™ and .NET Framework 3.0 Runtime Components comes to the rescue: inside, you find C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\CrossTechnologySamples.zip, which contains the VistaBridge sample.

From that, I took the VistaBridgeLibary, and modified the static UACManager.LaunchElevatedCOMObject method a bit:

[return: MarshalAs(UnmanagedType.Interface)]
public static object LaunchElevatedCOMObject(Guid Clsid, Guid InterfaceID)
{
  string CLSID = Clsid.ToString("B");
  string monikerName = "Elevation:Administrator!new:" + CLSID;

  NativeMethods.BIND_OPTS3 bo = new NativeMethods.BIND_OPTS3();
  bo.cbStruct = (uint)Marshal.SizeOf(bo);
  bo.hwnd = IntPtr.Zero;
  bo.dwClassContext = (int)NativeMethods.CLSCTX.CLSCTX_LOCAL_SERVER;

  object retVal = UnsafeNativeMethods.CoGetObject(monikerName, ref bo, InterfaceID);

  return (retVal);
}

Modifications: the method is now public instead of internal, and CLSCTX changed to local server (otherwise it wouldn't work).

Next, we need a UI:

This button is the CommandLinkWinForms control from VistaBridgeLibary, with the ShieldIcon property set to true.

Let's hook up the event code:

private void tryItButton_Click(object sender, EventArgs e)
{
 Guid IID_ITheElevated =
  new Guid(0x5EFC3EFB, 0xC7D3, 0x4D00, 0xB7, 0x2E, 0x2F, 0x86, 0x4A, 0x1E, 0xAD, 0x06);

 Guid CLSID_TheElevated =
  new Guid(0x253E7696, 0xA524, 0x4E49, 0x9E, 0x50, 0xBF, 0xCC, 0x29, 0x91, 0x31, 0x23);

 object o = UACManager.LaunchElevatedCOMObject(CLSID_TheElevated, IID_ITheElevated);

 ITheElevated iface = (ITheElevated)o;

 // Call the method on the interface just like in the C++ example
 iface.ShowMe();

 // Release the object
 Marshal.ReleaseComObject(o);
}

The interface ID as well as class ID guids come directly from the C++ project (it is always a good idea to "speak" more than one language), but you could obtain those from the type library or registry as well if you don't have the source code of the component handy.

Object creation is handled via LaunchElevatedCOMObject, and the resultant object is cast to the interface from the imported type library. Noteable (and important) is the last line: because the object wasn't created by the runtime, we have to take care of its destruction (the created interface doesn't have a Release() method, so we use Marshal.ReleaseComObject).

That's it - your managed code is now instantiating an elevated COM object that has full reign over the system.

ElevateCOMComponentSample.zip (117.07 KB)

Categories: .NET | Security | UAC | Use the source Luke | Vista
Tuesday, 30 January 2007 10:14:50 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

I would agree that this is indeed a sensible error message when I were about to add a COM reference to an inproc (DLL) server. However, this is an out of process server, an EXE. This guy (callee) does load in a separate process space from the caller, with a separate instance of the .NET runtime. Someone care to enlighten me why this restriction is in place?

By the way, tlbimp behaves the same way (just to make sure...):

TlbImp : error TI0000 : System.Runtime.InteropServices.COMException - Type library 'OutOfProcServer' was exported from a CLR assembly and cannot be re-imported as a CLR assembly.

Categories: .NET | Visual Studio
Tuesday, 30 January 2007 09:45:30 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 29 January 2007

From the "What could possibly go wrong?" department: starting a WPF application (verified offenders are MsbuildG and VistaBridge from the Windows Vista SDK) crashes Vista. Or the graphics driver to be more precise. The result is nonetheless a perfectly reproducible BSOD on my IBM X31 laptop. The funny part? This ATI Mobility driver (6.14.10.6546) came from the Windows Vista Update Service and is MS HW Compat signed!

Categories: .NET | Tri 0 | Vista
Monday, 29 January 2007 10:20:11 (W. Europe Standard Time, UTC+01:00)  #    Comments [2]

 



#  Tuesday, 09 January 2007

Matt followed through with his promise (see CCCP 1.2 Available With Setup) to write a tutorial on how to create a WiX-based installer with SharpDevelop: Creating an Installer with SharpDevelop

Tuesday, 09 January 2007 08:16:16 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Friday, 22 December 2006

Today I got around to trying CCNetConfig, which provides a UI for editing CruiseControl.NET's ccnet.config file. Thanks to the SharpDevelop project, I have a rather good test case with a couple of continuous integration plus nightly builds:

Our ccnet.config file is maintained by using Notepad (yes, you read that right). As such, I added a few <!-- --> comments here and there, mostly for pointing me to documentation, blog articles or just disabling a feature temporarily. Therefore, you can already guess my biggest gripe: on saving the file, it is auto-reformatted and all my comments are gone.

Other than that, it is a really good way of editing ccnet.config especially because all properties are easy to edit and you are presented the documentation automatically, no more searching around for tag / attribute help on the Web.  Overall: very useful if you don't spend all day being release manager.

Friday, 22 December 2006 18:00:24 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

Michael Howard has all the links in this blog entry Online Security Sessions from TechEd IT Forum Available. Topics include: malware cleaning, UAC internals, social engineering, Vista kernel changes, Vista firewall and IPSec enhancements. Which reminds me that the post-conference DVDs should tip up in my mailbox rsn.

Categories: .NET | Security | Training and Conferences | Vista
Friday, 22 December 2006 16:46:01 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Sunday, 12 November 2006

This Q&A item is part of the current MSDN magazine's Security Brief's column by Keith Brown. I am pretty sure that this problem will rear its head sooner or later on every developers machine, that's why I am 'pinning' the link in my blog for my own reference too.

Categories: .NET | IIS | Security | 3.0 | WCF
Sunday, 12 November 2006 16:41:26 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 08 November 2006

From the nuggets page: Don't have the time to read a 10-page how-to article or watch a full length webcast? Try an MSDN Nugget, a webcast that takes you step-by-step to discovering new functionality or exploring a hot developer topic, all in 10-15 minutes. If you haven't seen this yet, check it out!

Categories: .NET | ASP.NET | BCL | Training and Conferences
Wednesday, 08 November 2006 15:04:26 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Friday, 03 November 2006

Read the post from Miguel Microsoft and Novell Collaborate. Good news for Mono, OpenOffice and Samba.

Categories: .NET | Newsbites | Use the source Luke
Friday, 03 November 2006 10:56:43 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 02 November 2006

Today, we shipped Beta 2 of SharpDevelop 2.1 (release information). Usually, we only ship two betas (followed by release candidates), but last weekend we decided to add a third one to this release cycle - to build a rock-solid foundation for the releases coming after version 2.1.

Speaking of last weekend: three of us met for the annual #develop developer days (#d^3 2006, a four day event) - way short of the original invitation list. But this turned out to be an advantage for discussing architecture and componentization. A lot of improvements already made it into Beta 2, a few more are yet to come in Beta 3.

Part of this effort was the creation of a presentation on SharpDevelop, which includes an area of interest to all .NET developers out there: a list of our components that can be reused outside the context of SharpDevelop plus the documentation and samples for those components. Remember: SharpDevelop is LGPL, so feel free to use our components!

In addition to this "general" slide deck, Daniel (SharpDevelop technical lead) also created a "Level 600" introduction to NRefactory, which can be found here. Definitely interesting for those of you that want to use code completion in our text editor control.

Finally, SharpReport now is a project in its own respect. The reason(s)? Well, SharpDevelop and SharpReport are developed on different schedules, so now we are customers of each other and no longer intertwined. Cool stuff coming on this front: export to various formats, allowing you to use SharpReport - yes - for generating reports in ASP.NET sites!

Categories: .NET | Cool Download | this | Use the source Luke
Thursday, 02 November 2006 17:15:38 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 01 November 2006

The November 2006 issue has lots of good security articles, which are available online too. Check out Security Habits, Threat Modeling (STRIDE approach), Extending SDL or SQL Security to name a few.

Categories: .NET | Security | SQL Server
Wednesday, 01 November 2006 13:56:55 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 30 October 2006

Last Tuesday, I held the talk "Advanced Code Access Security" at UG Styria in Graz. This talk was originally part of the MSDN Security Briefings held in Austria earlier this year, for which MS Austria had asked MVPs to help create and deliver security content. Advanced CAS seemed an interesting enough developer topic to re-run at user groups, and Mario (the author of this session) has allowed me to publish the slide deck and demos for the general public.

AdvancedCodeAccessSecurity.pdf (4542 KB)

AdvancedCAS.zip (599.6 KB)

Please note that I have published only demos four (setting CAS via setup) and six (using CAS in addin application) - those are the "completed" versions of the demos.

Categories: .NET | 2 Ohhhh | Community | Cool Download | Security | this
Monday, 30 October 2006 09:10:54 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 10 October 2006

Today, I was asked whether there was a "real" difference between debug and release builds of a C# project - other than the PDB files. I didn't know for sure, so I set out on a search for more information, which turned up the blog entry debug vs. release in C#. The interesting part is the first comment by Josh Williams: "...the /debug[+|-] switch controls JIT optimizations <snip />. Disabling JIT optimizations is very useful for debugging purposes but will very much affect the runtime perf of an app as much of the optmization of your code is done by the JIT, not CSC..."

Now that definitely turns shipping a debug build to customers into a non-starter.

Categories: .NET | C#
Tuesday, 10 October 2006 20:28:09 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 19 September 2006

Beta 1 of SharpDevelop2 2.1 is available for download. While I was putting together the annoucement for v2.1 yesterday, I realized that for a point release, we really managed to put in a lot of new cool features:

A couple of WOW features (for me, at least): Not only can you compile an application for different versions of .NET, you also get version-specific code completion support. Another cool one is that you can host SharpDevelop in your application, providing your application a "macro editor" (on steroids I might add) with full .NET support. And to pick a third, code analysis rounds out our professional offering in addition to code coverage as well as unit testing.

Two features did not make it for the Beta 1 announcement as they don't yet cover all the scenarios we are hoping for: integrated Subversion support (yeah!) and targetting the Compact Framework for Windows CE devices. Those slipped silently into this release.

As you can see, SharpDevelop is ever growing and the developers working on it can be rightly proud of their achievements!

Finally, a kind of "call to action": let us know what you think! Not only in our forums, but also in your blogs, communities, et cetera. We need your feedback regarding feature set, stability, and much more.

Categories: .NET | 2 Ohhhh | C# | Cool Download | Subversion | this | Use the source Luke
Tuesday, 19 September 2006 12:10:55 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 17 July 2006

Disclaimer: I am the PM for the #develop project.

After almost two years in development, the #develop team has shipped version 2.0 of its open source integrated development environment (IDE) SharpDevelop2. The new version supports the .sln / .*proj project file formats of Visual Studio 2005, therefore you can open and edit existing projects inside SharpDevelop2. The team however does not view SharpDevelop2 as a competitor for the Express line of products (comparison) from Microsoft, but it aims at software developers that need best of breed tools for their software development process - like unit testing, code coverage, documentation generation and more. In the same vein, version 2.1 will complement those existing features with integrated source code control, code analysis tools as well component testing.

SharpDevelop2 is especially well-suited for developers that chose the Boo language, because SharpDevelop2 offers first-class support for code completion as well as the Windows Forms designer. Aside from this unique selling point there a couple of smaller but nonetheless productivity-enhancing features in version 2.0: code conversion (eg VB.NET to C#, but see for yourself), support for Mono, documentation preview, RegEx compilation und quite a few more.

A lot of the features are owed to the ease of integration and extensibility provided by the addin system found in SharpDevelop2. This addin system can be used by developers in their own application - this being the reason for the rather unconventional license choice for SharpDevelop2: LGPL instead of GPL, which is much more common for development tools such as #develop. Re-use by third parties has been the driving factor to change the license.

Thanks to all the contributors that made SharpDevelop2 a reality, especially the technical lead on the 2.x effort, Daniel Grunwald.

Categories: .NET | 2 Ohhhh | Cool Download | Newsbites | this | Use the source Luke
Monday, 17 July 2006 15:07:33 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 29 June 2006
Categories: .NET | Project Management | Security
Thursday, 29 June 2006 07:47:25 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 26 June 2006


#  Tuesday, 20 June 2006

The blog post ADO.NET vNext: The Entity Framework, LINQ and more on the Data Access Blog has links to all relevant articles on the next version of ADO.NET and the Entity Data Model (EDM). Make sure to read at least the vision document.

Categories: .NET
Tuesday, 20 June 2006 14:06:47 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 19 June 2006

Half an hour ago, I completed my talk "Windows Workflow Foundation & ASP.NET 2.0". As promised, here is the list of links to sites / documents that I used to prepare this talk & accompanying samples.

Also, see my last post on ASP.NET PageFlow CTP. This was the last part on "future technologies".

Update A foto from my talk on Monday (debugging a workflow in ASP.NET):

Monday, 19 June 2006 11:39:07 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]

 



#  Tuesday, 13 June 2006

Yesterday night, I watched a WebCast from TechEd Boston - "An Overview of ASP.NET and Windows Workflow Foundation". What this innocuous title hid was the fact that Kashif Alam (PM in the Developer Division) was presenting vNext features for ASP.NET workflow integration: Page flow (PageFlow) as well as UI flow (UIFlow), plus the accompanying extensibility model.

What do those two separate approaches provide? Well, you get MVC (model-view-controller) support for same-page (UIFlow) as well as cross-page (PageFlow) scenarios. Pretty neat was the included "Choosing the right solution" slide to get an idea what's in store:

Task <asp:wizard...> PageFlow UIFlow
Single page x x
Multiple pages x
State when close browser x x
Integrate with Enterprise WF x x
Client support x x
Built-in navigation UI x
Extensibility to other controllers x x

As developers, we will get our hands on this later this year in the form of the "ASP.NET PageFlow CTP" (at least that's the current name), and it will be deployed with Orcas.

Categories: .NET | ASP.NET | Tri 0 | Workflow Foundation
Tuesday, 13 June 2006 08:28:38 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 

NetFx3 is the new community site that focuses on the four .Net Framework 3.0 technologies Windows Communication Foundation, Windows Presentation Foundation, Windows Workflow Foundation and Windows CardSpace.

Categories: .NET | Tri 0
Tuesday, 13 June 2006 00:03:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 09 June 2006

When working with a team, it is always a good idea to have dependencies in a separate folder so everyone can reference them using relative paths:

References from this dependencies folder then look as follows in the MyWinApp.csproj file:

  <ItemGroup>
    <Reference Include="Boo.Lang, Version=1.0.0.0, ...">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dependencies\\Boo.Lang.dll</HintPath>
    </Reference>
...
    <Reference Include="System" />
...
    <Reference Include="System.Xml" />
  </ItemGroup>

So every team member that checks out the project will be able to work in their workspace, as well as the build server will have all the proper references. Great.

But what about the following scenario: depending on Release or Debug, you need different references - how can you solve this problem? The first step is to go and create a directory for each configuration below the Dependencies folder:

Next, copy the assemblies to the respective directories. Plus, you have to modify the .csproj file and add $(Configuration) to the external reference's hint path:

  <ItemGroup>
    <Reference Include="Boo.Lang, Version=1.0.0.0, ...">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Dependencies\$(Configuration)\\Boo.Lang.dll</HintPath>
    </Reference>

That's it - even Visual Studio will honor this change and still provide you with IntelliSense.

Before closing, I want to mention a new tool - even though it doesn't (yet) support editing the hint path, you should check out Attrice's Microsoft Build Sidekick. It allows you to graphically edit .*proj files:

Categories: .NET | Cool Download | Visual Studio
Friday, 09 June 2006 08:07:18 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 05 June 2006

Disclaimer: I am the Senior Project Wrangler for #develop. Therefore I am biased as well as knowledgeable.

Today, we shipped RC2 of SharpDevelop2. For those of you who haven't heard of it before, it is an Integrated Development Environment (IDE) for .NET. I will get to the features in just a second. First, I want to thank all developers that spent time on making v2 a reality. Daniel, the lead developer on v2, actually implemented a nice little tool for showing the project statistics, you can read more and download the utility in his blog Analyzing the code in SharpDevelop. Wow, we started quite a long ago on this baby.

I promised to get back to the feature set. Let's tackle it with more than a grain of blog posts and feature videos:

Supported Programming Languages

My definition of support is as follows: full code completion (aka IntelliSense) and a working Windows forms designer. Therefore, three languages qualify: C#, VB.NET and Boo. Aside from those fully supported languages, you get syntax highlighting for many more.

Speaking of syntax highlighting and code completion: both features are supported for XML files. You can check it out in the xml editing experience feature video (yes, this is available since v1.1!) You get this for MSBuild files too!

Features You Would Expect

Let's start with the integrated debugger. This has been our achilles heel since the very beginning, as implementing a debugger isn't exactly a piece of cake. However, thanks to David, v2 sports a debugger and you can watch a demo.

Let's continue with a simple list: Search & Replace, code folding, code templates (just try Ctrl+J in the editor), a toolbox and more.

Cool Features

Ahhh. At last. Let's see what we got:

  • Unit testing (since 1.1, NUnit-based)
  • Code Coverage (2.0, based on NCover - read more in Matt's blog post)
  • Documentation generation (since 1.1, based on NDoc)
  • Quick XML Doc (since 1.1, just try Ctrl+Q to get a preview of the HTML help that will be generated for your XML comments)
  • Auto code generation (since 1.1, just try Alt+Ins)
  • Code converter - convert your projects from C# to VB.NET and vice versa (since 1.1). New in 2.0: three way with Boo.
  • Reports. Yes, SharpDevelop ships with a free-to-use report engine, #report. It was added late in 1.x, now improved for 2.0. Watch the demo
  • Support for multiple frameworks - although 2.0 is the default, SharpDevelop can target 1.1 as well as Mono. Even Gtk# is supported.
  • Ctrl+Mousewheel zooming. You will like it. I do.

What's Not There

We ain't a big software company, so we have to tackle features in order. Therefore, you won't find ASP.NET support in SharpDevelop, as well as others: CF support (planned for 2.1), version control (planned for 2.1), ClickOnce (planned for 2.1)...

Even if you don't plan on using SharpDevelop for your daily work, give it a try and let us know what you like and what not on our forums. You might even learn about a cool new feature like Component Inspector that is coming with 2.1, code-named Serralongue. And we'd be more than happy to welcome additional developers, testers, writers and translators.

Categories: .NET | Cool Download | this | Use the source Luke
Monday, 05 June 2006 23:29:57 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 04 May 2006

Six labs, both available in C# and VB.NET. Download (nuff said)

Categories: .NET | 2 Ohhhh | Cool Download
Thursday, 04 May 2006 10:20:36 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 02 May 2006

Found this on Alex' blog (he posted it in German last week): Microsoft UK has released a document (PDF) titled "The Developer Highway Code" (The drive for safer coding), which covers the following topics:

  • Integrating Security into the Lifecycle
  • Security Objectives
  • Web Application Security Design Guidelines 
  • Threat Modelling
  • Security Architecture and Design
  • Security Code Review
  • Security Deployment Review

The document covers v1 and v2 of the .NET Framework, and it does contain useful checklists. Be sure to grab it!

Categories: .NET | Security
Tuesday, 02 May 2006 15:17:31 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 13 April 2006

If you ever consider using NGen with your .NET applications, then you simply MUST read the article The Performance Benefits of NGen in the current issue of MSDN Magazine. It can't get any more authoritative than that (the author Surupa Biswas works on the runtime's back-end compiler and focuses primarily on pre-compilation technologies).

Categories: .NET | 2 Ohhhh
Thursday, 13 April 2006 16:17:29 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Sunday, 19 February 2006

On my flight to Seattle today (or yesterday, depending on the time zone) I started to read Professional ASP.NET 2.0 Security, Membership, and Role Management by Stefan Schackow. The book definitely is a must-have for every ASP.NET developer, even if you decide to read one chapter only: A Matter of Trust (#3). This one will save you loads of time when you have to deploy an application into non-full trust environments. However, the other chapters are worthwhile too, like #2 which details exactly which identity is used when by what part of the engine. Bottomline: highly recommended reading.

Categories: .NET | 2 Ohhhh | ASP.NET | Books | Security
Sunday, 19 February 2006 09:21:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 06 February 2006

Will be there Wednesday & Thursday as ATE (Ask the Experts), so drop by in the experts zone and say hello!

Monday, 06 February 2006 14:56:39 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 18 January 2006

Yesterday, I picked up on an old code piece of mine - sending images to the client via an HttpHandler. Why in the world would you implement that with a handler when there is http.sys kernel mode caching? Well, I had a few unique constraints:

  • the images had to live outside the Web root and any of its vroots
  • the image names had to be concealed because the naming would give away information, and renaming the images prior to publishing on the Web was out of the question

Now, a common approach to sending images from a certain directory (leaving requirement #2 by the wayside for the moment) would be this:

image.aspx?image=iamthebest.jpg

So what is wrong with this approach? First and foremost using an ASP.NET page. The page lifecycle is a drain on performance and throughput, because you simply don't need it. That sorts out why I chose to go with an HTTP handler.

Secondly, somebody could DOS your server. You heard me right. For the background, check the article Trap Alert: Files that aren't. A .NET version (managed C++) of this checker can be found in this download (the article Dateityp-Ermittlung in Managed C++ is only available in German).

How do you get around this issue? Well, how about reading the directory up front, and instead of having the filename in the URL, send the hash! When the image is requested, take the hash and look up the corresponding file, presto. In addition you get one security feature for free: no directory traversals can be hidden in your code.

When I uncovered the code yesterday, I decided to rewrite it for more general use. So what do you get?

  • The ImageCacheControls project: it contains the ImageCache class, which does most of the heavy lifting. In addition, you get an ImageCacheControl server control, as well as the implementation of the HTTP handler. (Don't forget to check out the Readme.txt for the latest on feature set and known issues)
  • The Web project: a rather simple Web site with demo files in it. The file I want to direct your attention to is Image.ashx. This is the one file - aside from the control project binaries - that needs to be copied to your projects to get started with ImageCache. Note that I made it easy to work with C# (default) or VB.NET.

Usage of ImageCache is demonstrated in default.aspx.cs plus the source code of default.aspx (design time of the control does not work, known issue).

The code behind looks like this (CreateMapping loads the directory contents, initializes the hash to file name map, stores it into the cache):

using ChrisOnNET.ImageCache;

public partial class _Default : System.Web.UI.Page
{
   protected void Page_Load(object sender, EventArgs e)
   {
      // normally, this would be done in global.asax
      ImageCache.CreateMapping("demo", Server.MapPath("~/TestImages/"));

      // the DIY approach to rendering the image tag
      string testHash = ImageCache.GetHashForFile("026.jpg", "demo");
      Response.Write("<image src=\"Image.ashx?bucket=" +
         "demo" +
         "&image=" +
         Server.UrlEncode(testHash) +
         "\" />");

      // the elegant approach to rendering the image tag
      Response.Write("<image src=\"" + ImageCache.GenerateUrl("036.jpg", "demo") +
      "\" />");

      // see HTML source for server control approach (Design time not working, known issue)
   }
}

Rendering Image tags in Page_Load isn't nice, but after all it is only intended to show the functionality. Most likely you are going to use the declarative ImageCacheControl anyways:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="ImageCacheControls" Namespace="ChrisOnNET.ImageCache" TagPrefix="cc1" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <br />Using the ImageCacheControl:&nbsp;
        <cc1:ImageCacheControl ID="ImageCacheControl1"
            Bucket="demo"
            FileName="026.jpg"
            runat="server" />
    </div>
    </form>
</body>
</html>

That's basically it. Let me know what you think.

ImageCacheTakeOne.zip (59.55 KB)

Categories: .NET | 2 Ohhhh | ASP.NET | Use the source Luke
Wednesday, 18 January 2006 11:21:05 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Saturday, 14 January 2006

New runtime components are available which are compatible with the release versions of .NET Framework 2.0, Visual Studio 2005, as well as Office "12" Beta 1 (which I don't have anyways).

Categories: .NET | 2 Ohhhh | Cool Download | Visual Studio
Saturday, 14 January 2006 10:31:23 (W. Europe Standard Time, UTC+01:00)  #    Comments [3]

 



#  Wednesday, 11 January 2006

Downloads are available for x86, x64, as well as the documentation.

Categories: .NET | Administration | Cool Download
Wednesday, 11 January 2006 11:10:24 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 10 January 2006

You have heard that many times before - use FxCop! This time you hear a wailing sound from the x64 world, me who is griping about assemblies that ain't cross platform as they should be (like you are using ints instead of IntPtrs for doing PInvoke...). Please, please check your assemblies with FxCop, even if you use only those rules:

Thank you so much for considering!

Categories: .NET | x64
Tuesday, 10 January 2006 19:02:13 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 04 January 2006

Daniel published the first article in a series about using the SharpDevelop core to build your applications. Those of you tracking the progress of SharpDevelop through the years might be wondering "Aren't there restrictions because SharpDevelop is released under the GPL?" Well, version 1.x is GPL-licensed. But for version 2.0, we changed the license to LGPL. Thus, you can use all of the SharpDevelop2 assemblies in your applications regardless of license.

Aside from the articles, there are videos showing how to write addins for SharpDevelop2. This will get you started with plugging in functionality with SharpDevelop2 via addins (again, your choice of license now!). Be sure to always get the latest bits either via our source control server, or if you prefer from our build server.

Please note that SharpDevelop2 requires .NET Framework 2.0, and, the usual disclaimer, that it is a work in progress. This, however, does not apply to the core - it has been in development for four years+, and as such is very stable and proven. After all, it is the basis for a 300 kLOC C# application!

Categories: .NET | C# | this | Use the source Luke
Wednesday, 04 January 2006 11:41:41 (W. Europe Standard Time, UTC+01:00)  #    Comments [2]

 



#  Monday, 05 December 2005

Today, a member of our German .NET community asked if it is possible to programmatically query the Google page rank. He had seen it done in PHP (here on the Google Community site), but didn't have time / PHP skills to translate it. All I found on a rather shallow search was PullRank, which I'd describe as non-fit for server use.

So I decided to set out to convert the PHP sample. Being PHP-challenged myself, I decided to give the PHP to ASP.NET Migration Assistant a shot. Whoha! That converted code is the most convoluted contraption to be called code I have seen - ever. I tried to get it to run, but failed because the conversion left me with some loose ends.

Instead of giving in, I contacted Christian Wenz to lend me a hand because he has some PHP experience. He thankfully hosted an "annotated" version of the PHP script so I could look at the output of various stages to test my solution with known-good values. That was most helpful.

Instead of doing a Web site demo application with everything intertwined, I split up the project into two - GPRDotNet being a DLL assembly project you can reference in any type of .NET application (Windows Forms, Web Forms, you name it), as well as a simple Web frontend to demo the usage: DemoSite.

Querying the page rank is really simple - the following snippet is the code from the "Check PageRank" button event handler:

protected void doCheckPageRank_Click(object sender, EventArgs e)
{
  GooglePageRank pr = new GooglePageRank();

  string url = webSiteUrl.Text;

  try
  {
    string rank = pr.GetRank(url);
    thePageRank.Text = rank;
  }
  catch (Exception ex)
  {
    // this is rather chatty (telling the end user everything *IS* a bad idea)
    thePageRank.Text = "Requesting the page rank failed. Reason: " + ex.ToString();
  }
}

I want to emphasize that the code for the GooglePageRank class is a rather quick & dirty port of the PHP code and that it does not contain the necessary error handling you would expect for a server-side library. After all, it is just a proof of concept for our community.

Finally, here is the source code: PageRank.zip (26.89 KB)

If you find errors, please leave a blog comment so others know about improvements. Thanks!

Categories: .NET | 2 Ohhhh | ASP.NET | C# | Community | this | Use the source Luke
Monday, 05 December 2005 19:03:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Sunday, 27 November 2005

Next week, I will be in Rosenheim, Germany for the ADC 2005. I'll be teaching the Visual Studio 2005 Team System Hands-on workshop (Tuesday as well as Friday), plus doing two talks during the main conference: IIS 7 and ASP.NET 2.0 Health Monitoring. See you there!

Sunday, 27 November 2005 23:01:00 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 16 November 2005

Lunch breaks always tend to end up being cut short by stupid ideas, today by my insistence to use My (from Visual Basic) in C#. To get up to speed on My, I suggest looking at Development with My in the MSDN library. The class diagram graphic will come in handy later on.

Step 1 is to reference the Microsoft.VisualBasic.dll assembly:

Next, we need a couple of includes:

using Microsoft.VisualBasic.ApplicationServices;
using Microsoft.VisualBasic.CompilerServices;
using Microsoft.VisualBasic.Devices;
using Microsoft.VisualBasic.FileIO;
using Microsoft.VisualBasic.Logging;

Why those and not Microsoft.VisualBasic.MyServices? Well, My is just an amalgamation of various classes that live in those namespaces: Computer, Audio, ... All the stuff you saw in the class diagram in the article Development with My.

Basically, you now have the functionality provided by My, but not as nicely grouped with a My object as in Visual Basic. To achieve this, have a look at the article C# My Services by Gildeoni Santos, it sports a download for wrapping My. As the code (at the time of this writing) is based on Beta 1 bits, you will have to put in the correct namespace references and pull the My prefix on all class names.

Categories: .NET | C#
Wednesday, 16 November 2005 13:10:40 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 10 November 2005

I just finished a Web-based C# to VB.NET converter for .NET 2.0. It took me about half an hour and 20 lines of code. How come? Well, Daniel (#develop 2.0 PM) did a video on NRefactory, which is at the heart of #develop's parsing infrastructure. I took some of his demo code plus some of #develop's internal code converter, and put it into a ASP.NET 2.0 page. Presto, that easy if you can stand on the shoulders of giants.

Oh, and I actually put it online, here is the link: C# to VB.NET converter (you can find the source code for a simpler VB.NET implementation of the converter here).

Categories: .NET | 2 Ohhhh | ASP.NET | C#
Thursday, 10 November 2005 20:22:24 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 08 November 2005

Now, I did not set out to crash it intentionally, but at least it is fully reproducible. What did I do? Well, I wanted to build a site based on the code I wrote in the blog entry Writing a Subversion-backed VirtualPathProvider for ASP.NET 2.0. So I created a new directory for the site, and simply put the code from the download into a subdirectory (which already exists in the zip file):

Of course I went ahead and opened MyNewWebSite in Visual Studio 2005:

Nothing unexpected so far, I can expand all directories just fine in Solution Explorer:

However, as soon as I hover over SubversionVirtualPathProvider.cs, Solution Explorer goes grey. Totally grey. As in no icons, no tree, no nothing. So I File / Exit Visual Studio 2005 (saying No to saving the solution), and kabooom, here is my friend the error reporting tool:

Oh, and btw, an empty App_Code directory won't do the trick.

Categories: .NET | 2 Ohhhh | ASP.NET | Visual Studio
Tuesday, 08 November 2005 16:23:13 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Friday, 14 October 2005

This whitepaper introduces the guiding principles and thoughts behind the .NET Framework, the core features of the Common Language Runtime and its supporting Framework Base Class Libraries and how it is evolving in the next major version.

Categories: .NET
Friday, 14 October 2005 08:22:18 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Sunday, 02 October 2005

The MVP Summit 2005 is over, and with the exception of Transportationgate, it was a great event - even though I had attended PDC05, and worked with Whidbey for years now. I don't primarily come for the news, but talking to other MVPs as well as product group members.

On the community side of things, Alex and I put the finishing touches on the localization feature of CodeFairway.NET, which now includes the ability to play a tournament in a specific timezone.

You don't know what CodeFairway.NET means? Let me introduce .NET Golf to you:

Now, that is intentionally a graphic, to show that sites made by programmers for programmers need not be ugly but can be quite appealing. Here goes the text for easier reading:

"What is .NET Golf?" How did the union of a programming technology and a lawn sport come about? Well, the idea is simple and fascinating: in 'classical golf' the winner is the player using the least number of strokes to hole out. We transferred this concept to programming: whoever needs the fewest number of characters to solve a given programming problem wins the tournament. Speed and elegance of the solution are not criteria.

Each tournament extends over a given time span, after the end of the tournament we hold 'post mortems', i.e. the participants explain their solutions (so that there may be a great wailing and gnashing of teeth behooving the creative abuse of the technology).

.NET Golf is the successor of ASP Golf which was quite popular among German language developers for a long time (the actual ancestor of code golf is Perl Golf). As many golfers switched over to .NET, we decided to migrate this waste of time ^H^H^H^H^H^H^H^H^H^H^H^H^Hmost excellent use of technology to .NET so that the envelope of programming could continually be pushed further.

Sounds interesting, doesn't it? That's what we thought and that's why we ran a tournament at the MVP summit (all English, you can browse it to learn more) to introduce other MVPs to .NET Golf - and whet their appetite to be the host for .NET Golf in their community. If you didn't get a chance to talk to me at the summit, here's what we (German community members, so that there are no misunderstandings) offer: we host the site for you on CodeFairway.NET, and we provide you with the automated test system we have created so that there is little to no overhead for you. Your job: translate the site into your community's native language, and come up with challenges (we can help get you started). My MSN account to get in touch with me: christoph dot wille at alphasierrapapa dot com (also my email alias if you prefer emailing me upfront).

Funny enough at the MVP summit, for the very first time in history of our tournaments, the VB.NET golfers won the tournament hands down. That might have changed if only Karsten and the others would have paid more attention to the sessions ;-)

The leaderboard for the first three looked like this (and yes, the Show link does show the source of the submission - check it out):


It took them quite a while to get on the green, but as with every other tournament I heard something like this: "I only wanted to play till 11:30PM, but at 1:30AM I finally coaxed me to go to bed". Addictive. Even for a simple challenge such as the one played at the MVP Summit:

How can you tell whether three lines of a given length make up a triangle? Some cases are obivious - equilateral triangles, isosceles triangles and triangles governed by the Pythagorean theorem. General triangles are a different matter though. You are now challenged to decide whether a given set of three integers represents the sides of a triangle and indicate this by passing back true, otherwise passing back false to the test application. Please note that "flat" triangles (triangles which have the shorter sides add up to the length of the longer side) do not count as triangles.

The class name for this challenge is Tee, the method name Off. The values for the three sides are passed as a string (never empty, always three values contained) to the Off method, the values are separated by a single space (eg "300 400 5000" which obviously is not a triangle). The values are non-negative integers.

So if you are interested in being the host for your community, get in touch with me. .NET Golf is very popular: currently, Microsoft Austria is using our German codefairway to play a MSDN Connection tournament. Mario just announced it (English).

Categories: .NET | Community | this
Sunday, 02 October 2005 16:21:26 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 16 September 2005

The conference is over, and my brain is full - full of (semi)stupid ideas what I'd like to try with all those new technologies I saw this week. Task #1 for next week is to set up a VPC with Whidbey Beta 2, because I no longer have such an image, but need it for LINQ, Atlas et al. So plenty of good reasons to go back in time.

What did I see today? The obligatory session list:

  • Using the .NET Language Integrated Query Framework with Relational Data
  • Using the .NET Language Integrated Query Framework with XML Data
  • Tips & Tricks: Developing and Testing with Virtual PC
  • Windows Presentation Foundation ("Avalon"): Going Under the Hood to Understand the Architecture

The day started with Luca Bolognese's talk on DLINQ (Luca was PM on ObjectSpaces, so it is your guess...). His samples contained a few "references" to James Gosling, and it was a fun session to start with on the last day (whoever came up with deadlock victim had some humor too) Luca weighed in on the top three questions on DLINQ:

  1. Do you support stored procedures?
  2. Do you support database xyz?
  3. How's your performance?

For #1, this is an unqualified yes. For #2, a provider needs to be written. And last but not least: at runtime, you only incur conversion to SQL, and the generation of objects. So no significant hit should be expected.

Categories: .NET | this | Training and Conferences
Friday, 16 September 2005 23:56:23 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 15 September 2005

Today's first keynote speaker was Eric Rudder. He unveiled the Expression Suite, which contains Acrylic, Quartz and Sparkle. For the latter, go to Channel 9 and watch this video. Also, the Windows Workflow Foundation saw the light of day during the keynote, as well as (last but not least) VSTA (Visual Studio Tools for Applications). You can learn more about VSTA in this blog post.

Eric was followed by Steven Sinofsky, who focused on Office 12. He demoed SharePoint, InfoPath, the new Access and more. I have to say again what I said previously - this is the first time I'm interested in an Office beta program. Good news is that all PDC attendees are signed up, steak knives being strictly optional <g /> (and even more limited than that phone fiasco from day one, 'nough said).

Now, without further ado(.net), the sessions I attended today:

  • Windows Vista: User Account Protection—Securing Your Application with Least Privilege Administration
  • The .NET Language Integrated Query Framework: An Overview
  • C#: Future Directions in Language Innovation
  • ASP.NET: Future Directions for Developing Rich Web Applications with Atlas (Part 1) 

Anders Hejlsberg did the LINQ (Language Integrated Query Framework) and C# 3.0 sessions. Highly impressive stuff, and I am looking forward to the DLinq session to learn more about the relational access model. I do like to know what is going on behind the scenes, various OR mappers made me wary. In closing: at least now I know why ObjectSpaces made a rapid disappearance...

Categories: .NET | C# | this | Training and Conferences
Thursday, 15 September 2005 03:43:18 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 13 September 2005

The PDC today officially kicked off with a keynote by Bill Gates. To me, the more interesting parts came later in Jim Allchins keynote: Atlas, Windows Communication Foundation, Windows Presentation Foundation as well as C# 3.0 & LINQ. However, Office 12 does look very promising too. Can't wait to get my hands on that beta (never expected to say that about Office, ever).

In the afternoon, I attended the following breakouts:

  • Behind the Scenes of Visual Studio 2005 Team Foundation Server
  • Windows Server “Longhorn”: What's New for Developers
  • Windows Presentation Foundation ("Avalon"): A Lap around the Windows Presentation Foundation

Looking forward to tomorrow, because Windows Workflow Foundation will be revealed at the keynote (aka general session).

 

Categories: .NET | 2 Ohhhh | ASP.NET | C# | Team System | this | Training and Conferences | Visual Studio
Tuesday, 13 September 2005 04:33:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 

Today was preconference day at the PDC. I opted for Keith Brown's talk Attack and Defense: The Art of Secure Coding. Of course it contained a couple of well-known "friends" such as SQL Injection, but there were other interesting tidbits that made it worthwhile.

Speaking of which, including (four) product demos was a good idea, here is the list of products in order of presentation:

Definitely worth checking out, might save a headache or two when using those tools.

Keith also briefly discussed SDL (Security Development Lifecycle) vs Security Engineering Guidelines. You could also cast that as ideal world (ie lots of cash for security available) vs real world. Therefore: go for patterns & practices stuff to make your projects secure.

Categories: .NET | Security | this | Training and Conferences
Tuesday, 13 September 2005 03:20:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 09 September 2005

Although the files for this TechTalk repeat are identical to the TechTalk downloads, I noticed that the download location has been moved. For your convenience, here are the direct download links to the three respective files:

Friday, 09 September 2005 07:42:23 (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]

 



#  Thursday, 25 August 2005

Hot off the press: on 8th of September, I will be doing a rerun of my TechTalk Tools zu erfolgreichen Softwareentwicklung mit .NET (~ Tools for successful software projects in .NET) in Graz at the monthly .NET User Group Styria meeting (sign up here). So if you didn't have a chance to attend my TechTalk in Germany, this is your ticket in Austria.

Categories: .NET | this | Training and Conferences
Thursday, 25 August 2005 15:20:27 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 18 August 2005

This is not just a plain announcement of the revamped German MSDN Developer Center - Sicherheit, it also contains some back patting for myself, so be warned.

My part in this relaunch was to go over "Basiswissen: Know How für Einsteiger" (~ Security [1..4]01) and pull together useful content in the security area applicable to developers. The result? A mix of books (some of the very best information still is only available in dead tree rendition), online articles and more. Everything is nicely presented in a box in the middle of the page:

Grundlagen (Foundation), .NET Framework Sicherheit (.NET Fx Security), Web Services (I proposed "Web Services & Distributed Technologies"), ASP.NET and Kryptographie (cryptography, my pet peeve) are the sections that I contributed. Judging from a brief perusal, it seems that mostly only my content is in there. So Michael and Uwe will accept my apologies for me claiming those to be "my" sections.

Categories: .NET | Newsbites | Security | this
Thursday, 18 August 2005 13:16:04 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 02 August 2005

On 12th of August, the Austrian .NET community is hosting a one-day conference on security, targeted at developers (no surprise here). The topics for NCC 2005 A include:

  • Threat Modeling
  • What's new in .NET 2.0 Security
  • What's new in SQL Server 2005 Security
  • What's new in Windows Vista Security

Quite a nice line-up I'd say. This event is supported by Microsoft Austria, so attending this event is free, except for your time, but I am sure security does warrant a day of your time! Sign up here

Tuesday, 02 August 2005 15:27:45 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Sunday, 31 July 2005

I spent this weekend in Bad Ischl together with other members of the #develop open source project. This was the first get-together under the "#develop developer days" umbrella, and most of the core team was able to attend the two-and-a-half day event.

Our focus was to talk about #develop 2.0 "Corsavy", feature-set wise as well as hashing out architectural issues not addressed yet. Aside from that, coding was the #1 priority: to tackle a couple of outstanding issues, such as Forms Designer or Refactoring support. Spending time in one room makes communication so much easier when you have to solve tricky issues that span multiple modules in our infrastructure. It definitely paid off to spend this weekend together.

Categories: .NET | 2 Ohhhh | this | Use the source Luke
Sunday, 31 July 2005 16:45:03 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 11 July 2005

Process Explorer is a really nifty tool, that comes in very handy when you want to take a deep dive into what's running on your machine, and what might be happening behind the scenes:

When you double-click on a .NET application, you get a tab dedicated to AppDomain and performance counter information:

Nice for a quick look around to see what that application is doing.

Categories: .NET | Cool Download
Monday, 11 July 2005 15:50:36 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 04 July 2005
During the TechEd preconference session "Architecture Boot Camp for Building Connected Systems" by Beat Schwegler and Arvindra Sehmi, Beat demonstrated GAT. Although it still has some very rough edges, it also looks very promising.
Categories: .NET | Visual Studio
Monday, 04 July 2005 16:50:17 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 01 June 2005

After quite some struggle, I got the mono::live CD to boot & actually work in Virtual PC. The first step to sucess is to create a new VPC image, and capture the ISO of mono::live for startup of your VPC image:

This thing will now ask you a couple of questions, such as country, keyboard layout, and screen resolution you would like to use:

Now for the stumbling block - mono::live (or Ubuntu, the underlying distribution, to be more precise) detects the graphics card emulated by VPC, however, uses the 24BPP mode with the VPC-emulated card only supporting 16BPP. Looks weird at first and had me stumped too. But I got help on GotMono.com (actual post, interesting snippet provided here for reference):

As far as I am aware, the easiest way to handle this is to just allow the machine to boot up all the way, and then when you can see the fuzzy background image (i.e., the stretched Mono logo) so that it looks like booting is complete, hit CTRL+ALT+F3 to bring up a command prompt.
 
Then type (or rather, cut and paste), this command, all on one line:
 
Code:
sudo sed 's/DefaultDepth\t24/DefaultDepth\t16/g' /etc/X11/xorg.conf > /tmp/xorg.conf && sudo cp /tmp/xorg.conf /etc/X11/xorg.conf && sudo killall Xorg

to restart the X server at a color depth Virtual PC can handle.

Because pasting didn't work the way I wanted it to, I ended up typing this stuff using US keyboard settings on a German keyboard (don't ask). Anyways: this did the trick! Now I can start exploring mono::live without having to reboot my machine.

Wednesday, 01 June 2005 19:24:11 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]

 



#  Saturday, 28 May 2005

This Thursday afternoon I attended the rerun of the VSTO session (Microsoft Visual Studio Tools for Microsoft Office System - quite a mouthfull, I'll stick with VSTO) in the Smart Client track (my main track was VSTE - Visual Studio Team Edition). Wow! The 2003 version didn't impress me at all when I saw it back then. But 2005 really rocks. Catherine Heller (Technical Evangelist) did a nice demo in Excel. The way the document is design- and programmable, access to the action pane and rolling your own smart tags is almost too easy. Forget about VBA, serious Office development is now on the horizon.

VSTO 2005 Blog

VSTO 2005 Beta Page

What's New in Visual Studio 2005 Tools for Office

Saturday, 28 May 2005 21:09:07 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 11 May 2005
Separate downloads for SmartPhone and PocketPC. For all of us that "managed to avoid all the screaming announcements" of Windows Mobile 5.0.
Categories: .NET | Smartphone and PocketPC
Wednesday, 11 May 2005 08:33:42 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 18 April 2005

http://lab.msdn.microsoft.com/vs2005/golive/license/default.aspx

If you want to deploy applications on Beta 2 for live internal usage or by third parties, you need to accept the Go-Live license.

Categories: .NET | 2 Ohhhh
Monday, 18 April 2005 13:57:18 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 

As everyone is blogging about the obvious, I will stick to the more interesting bits (in my opinion, of course). For example, the updated Visual Studio 2005 Team Foundation Server Installation Guide.

Categories: .NET | 2 Ohhhh | Team System | Visual Studio
Monday, 18 April 2005 08:51:47 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 11 April 2005

The post commit hook for Subversion now has reached a stage where I consider it feature complete. Newly added for this release:

  • log4net for logging important information (ie exceptions) necessary for debugging a hook that is supposed to run automatically. Note that it uses v1.2.9 of log4net, which is a Beta release. The log file name is post-commit.log (you can change this in post-commit.exe.config)
  • Nicely formatted commit mail. The change log line items are parsed, the A, U & D information is used to build Added, Modified & Deleted sections in the message.

Here is an example of the message format (from the #develop commit mailing list):

Author: mattward
Date: 2005-04-10 20:06:25 +0200 (So, 10 Apr 2005)
New Revision: 1840
Log Message:
Added basic .manifest schema.  Schema annotation displayed alongside
auto-completion list. Mixed namespaces and simple content types
now supported.  Added attribute value auto-completion.

Added:
trunk/SharpDevelop/data/schemas/manifest.xsd
....
trunk/SharpDevelop/src/AddIns/.../SimpleContentWithAttributeTestFixture.cs
Modified:
trunk/SharpDevelop/data/resources/StringResources.dk.resources
...
trunk/SharpDevelopResources/LanguageResources/LocalizeDb.mdb
Deleted:
trunk/SharpDevelop/src/AddIns/.../ActiveElementPathTestFixture.cs

 -- SvnPostCommitHook 1.2.0.50410 --

Installation Take all three files from \Hook and place them in your repository's hooks directory. Open post-commit.exe.config and modify the entries in the appSettings section to match your installation and needs.

Test it Run post-commit.exe once interactively from the command line to see if your installation is ok. Potential errors are only logged to post-commit.log, not to the Console. So be sure to check it!

Finally, the download:

SvnPostCommitHook1.3.0.50411.zip (105.82 KB)
Categories: .NET | Subversion | Use the source Luke
Monday, 11 April 2005 12:06:49 (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]

 



#  Sunday, 10 April 2005

I updated the post commit hook application, however, installation advice from the original blog entry Post Commit Hook for Subversion, the .NET way still applies. What's new? The revision info is parsed and more nicely presented in the commit mail message. Because of info parsing, one call to svnlook could be saved.

SvnPostCommitHook1.1.0.50410.zip (14.08 KB)

Categories: .NET | Subversion | Use the source Luke
Sunday, 10 April 2005 11:13:31 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Saturday, 09 April 2005

In the entry Subversion on Windows as a Service, plus Commit Hook and Backup Script I showed a batch file for hooking into the post commit event of a repository. This batch file annoyed me from the very beginning. During the Indigo Community Day on Thursday in Munich I decided that it was about time to get rid of it, and after yesterday's party, I thought it might be a nice pinky exercise to do the basic port to C# today.

And yes, it is very basic at the moment. All you need to do is take post-commit.exe and post-commit.exe.config from the \SvnPostCommitHook\Hook directory in the downloadable zip file and drop those two into the hooks directory of your repository. The .config file is your ticket to customization:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <appSettings>
  <add key="SvnLookPath" value="C:\Program Files\Subversion\bin\svnlook" />
  <add key="MailTo" value="commitlist@yourdomain.com" />
  <add key="MailFrom" value="commithook@yourdomain.com" />
  <add key="MailSubject" value="Your project name rev {0}, {1}" />
  <add key="MailServer" value="localhost" />
 </appSettings>
</configuration>

Just as the batch file, post-commit.exe's task is to read the change log and commit message, and post it to a mailing list that distributes the information to the project stakeholders. Therefore, you need to configure the four Mail* settings to match your configuration and preferences. The SvnLookPath needs to point to your Subversion installation, however, most installations should be fine with this default.

How can you test the operation of post-commit.exe? This is the syntax:

post-commit <repository> <revision>

For example:

post-commit e:\subversion\fidalgo 1830

In the current version, testing is highly recommended as no logging or exception handling is implemented.

SvnPostCommitHook1.0.0.50409.zip (12.07 KB)

The source code is BSD-licensed. Future plans are to fully parse the svnlook output, as well as add a logging infrastructure to easily find configuration problems during normal operations of your Subversion server.

Saturday, 09 April 2005 19:34:45 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 10 March 2005
I just registered for the Community Day: Indigo in Munich (7th of April). Talks will be held by Christian Weyer and Darius Parys. It is free, so sign up.
Categories: .NET | Community
Thursday, 10 March 2005 02:37:56 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 09 March 2005
A new Channel 9 wiki has popped up - about performance tips for managed code and related CLR "stuff". A really usefull collection of articles, videos et al - check it out!
Categories: .NET | BCL | C#
Wednesday, 09 March 2005 17:03:33 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

This is a course for Visual Studio .NET 2003. Download
Categories: .NET | ASP.NET | Cool Download
Wednesday, 09 March 2005 02:49:35 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Tuesday, 08 March 2005

Another AppDev training CD has hit the download center: this time, it is the ISO image of the Developing Applications in Visual C# .NET (CD1) training course. Note that in contrast to Exploring ASP.NET 2.0 Using Visual C# 2005, this courseware is for Visual Studio .NET 2003. Download

Categories: .NET | C# | Cool Download
Tuesday, 08 March 2005 17:29:14 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

Carsten and I just returned from a Web Developer Meeting of the .NET Developers Association. For us, building forty is just a block away, so we decided to sit in on Michael Stiefel's talk on SOA. You can download the presentation and source code here.

Michael (who still remembered me from a book publishing summit waaay back) recommended that we (as in all attendees) check out the Metropolis Webcasts: Pat Helland relates the evolution of technology architectures to the evolution of city planning and shows us how far we have yet to go.

The Microsoft Architect Journal also has an article on Metropolis.

Categories: .NET | Community
Tuesday, 08 March 2005 06:28:48 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Saturday, 05 March 2005

From the description: This presentation is an overview of best practices and issues with the usage of exceptions, and different issues surrounding memory management including the IDisposable pattern, finalizers, memorypressure, HandleCollector, and why the using statement (Using in VB) is your friend! It's an excellent overview of some fundamental exception and memory management topics.

By Brad Abrams, so download it now.

Categories: .NET | Cool Download | Newsbites
Saturday, 05 March 2005 18:16:29 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 03 March 2005


#  Wednesday, 02 March 2005

Collected those articles over time, might be useful to somebody else too:

.Net Compact Framework Advanced Memory Management
http://blogs.msdn.com/mikezintel/archive/2004/12/08/278153.aspx

An Overview of the .Net Compact Framework Garbage Collector
http://blogs.msdn.com/stevenpr/archive/2004/07/26/197254.aspx

The perils of GC.Collect (or when to use GC.Collect)
http://blogs.msdn.com/scottholden/archive/2004/12/28/339733.aspx

Categories: .NET | Smartphone and PocketPC
Wednesday, 02 March 2005 17:06:13 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

Just picked up the book Customizing the Microsoft® .NET Framework Common Language Runtime by Steven Pratschner. Looks like it is going to be a very, very interesting read.
Categories: .NET | Books
Wednesday, 02 March 2005 00:08:03 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Sunday, 27 February 2005
Categories: .NET | ASP.NET | Security
Sunday, 27 February 2005 02:22:24 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 23 February 2005

A new property has been added to the TextBox control you already know: the AutoCompleteType property. What does it do? It let's you specify the field of a user's vCard to automatically populate the TextBox. Take a look at the following form:

autocompletetype_img1.png

The user must type in the name every time she is on the form. Tedious. No longer if you assign the DisplayName vCard attribute to the TextBox:

autocompletetype_img2.png

Now, if you had typed in your display name in a different form already, it will automatically pop up as a choice when filling in the form:

autocompletetype_img3.png

The screenshot already implies that this is a cross-browser feature, the generated HTML source code does indeed confirm this assumption:

<input name="txtName" type="text" vcard_name="vCard.DisplayName" id="txtName" />

Yet another nice feature of ASP.NET 2.0 to look forward to.

Categories: .NET | 2 Ohhhh | ASP.NET
Wednesday, 23 February 2005 04:26:49 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 22 February 2005

Once again working on my backlog... interested in ASP.NET 2.0? Then watch the videos on this page. Jeff Prosise talks about Web Forms, State Management, Security, Master Pages and Site Navigation, Data Access as well as Application Infrastructure.

Categories: .NET | 2 Ohhhh | ASP.NET | Training and Conferences
Tuesday, 22 February 2005 20:21:34 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 

The BCL Team has an interesting blog post for all those of you who want to solve every string matching problem using a regular expression. Kit George reflects on when not to use RegEx to match strings.

Categories: .NET | BCL
Tuesday, 22 February 2005 02:12:03 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Saturday, 12 February 2005
CodeHTMLer is a Web application for creating nicely formatted (and colored) HTML from your source code (C#, VB.NET, et cetera). Aside from the functionality, the newsworthy bit is that it comes with (C#) source code, which is BSD-licensed as far as I can tell from the wording.
Saturday, 12 February 2005 11:01:58 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 09 February 2005
If you ever need to explain .NET to the powers that be, download the .NET Core Brochure. This is what I call management-compatible, a developer wouldn't touch it with a ten foot pole.
Categories: .NET
Wednesday, 09 February 2005 08:25:30 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 31 January 2005
Quite a few things happened whilst I was whileing away on the community wintercamp: the Enterprise Library was released, and PatternShare.org went live.
Categories: .NET | Cool Download
Monday, 31 January 2005 10:11:28 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 27 January 2005
The Webcast ".NET development for free with #develop" which I announced recently is already available for download (it is still German though). Those who missed it, go get it.
Categories: .NET | Cool Download | this
Thursday, 27 January 2005 17:58:57 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 25 January 2005

After figuring out the previous problem (DLL dependencies), I decided to install the .NET Framework SDK into the VPC image (a Windows Server 2003). No such luck: "Extracting file failed.  It is most likely caused by low memory (low disk space for swapping file) or corrupted Cabinet file." No, not again a memory issue...

Wait a second! That image has 400 megs of memory assigned plus a 1.2 gig growth limit for the swap file. That can't be. As usual, I used Google to search for solutions. One (older) suggestion was to update Windows Installer - I gave it a shot anyways, and installed Windows Installer 3.0. No change, but that was expected. At least I am now up2date in that respect.

To spare myself further waste of time, I decided to take the easy route and ran

setup /c

on my XP box, copied the extracted setup files to the VPC image - and presto! The SDK is installing like a charm.

Categories: .NET | Administration
Tuesday, 25 January 2005 15:51:17 (W. Europe Standard Time, UTC+01:00)  #    Comments [2]

 

Once again it pays off to be in this game... erm industry for so long: I got a weird  Fusion loading error for an assembly:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of 
an invocation. ---> System.IO.FileNotFoundException: File or assembly name ConsoleControl, 
or one of its dependencies, was not found.

File name: "ConsoleControl"  at ConsolePad..ctor()

=== Pre-bind state information ===
LOG: DisplayName = ConsoleControl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified) LOG: Appbase = C:\SharpDevelop\Repository\SharpDevelop\bin\
LOG: Initial PrivatePath = NULL Calling assembly : ConsoleAddin, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null. === LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Post-policy reference: ConsoleControl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null LOG: Attempting download of new URL file:///C:/SharpDevelop/Repository/SharpDevelop/bin/ConsoleControl.DLL.

The assembly of course was right smack where the above URL is pointing to. So what was going on? First, I mailed the dev - no such luck, it was working on his machine (as if I would care: "I don't care if it runs on your machine, we are not shipping your machine!", Software Testers Anonymous).

As the test machine is a non-SDK machine (runtime installed only), fuslogvw was also out of the question. Mer...veilleux. Fallback to tools a C++ programmer loves and knows: Dependency Walker. This guy produced the following output:

A-ha! The dev checked in an assembly that was written in C++ (and thus he had all the runtime assemblies on his box), but he forgot the two beauties msvcp71 and msvcr71. Chalk one up for the old dogs.

Categories: .NET
Tuesday, 25 January 2005 15:11:54 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 12 January 2005

It feels good to be no longer grounded by the doctor, especially because this means that my Webcast next week is no longer in danger of being cancelled: ".NET development for free with #develop" (MSDN: .NET-Entwicklung zum Nulltarif mit SharpDevelop is the orginial title, because this Webcast is in German). I will be talking about what cool things you can do with #develop, how it was built, and what the future holds for this free (cost-wise et al) lightweight development environment. Join Uwe and me on Monday 17th @ 4pm (understanding German being a rather big bonus).

Categories: .NET | Community | this
Wednesday, 12 January 2005 13:22:22 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 27 December 2004

This can be pretty useful to get an idea which open source projects are available, and today I did it (again) for C#. Of course you will see the usual suspects (NUnit, NAnt, RSS Bandit, NHibernate and a lot of others), as well as ones you haven't yet heard of, such as dotLucene (I knew of the Java one) or Report.NET. And on occasion you stumble upon something really wacky, such as Pr0nspider, which is a multithreaded sample for the WebSpider library... this sample definitely drives home the concept!

Categories: .NET | C# | Use the source Luke
Monday, 27 December 2004 09:29:19 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 23 December 2004

This is the most current version of the Team Foundation Installation Guide for the December 2004 CTP release of Visual Studio Team System. It contains any changes that were made to the guide since the public release of the December 2004 CTP release of Visual Studio Team System.

Categories: .NET | 2 Ohhhh | Team System | Visual Studio
Thursday, 23 December 2004 08:36:04 (W. Europe Standard Time, UTC+01:00)  #    Comments [1]

 



#  Monday, 20 December 2004

I previewed the search feature last week with a couple of screenshots. Today I did what I promised to do (review the new code thoroughly), and now I'd like to invite you to download the latest version of the registry editor (0.8.2 dated 12/20/2004).

Note on the search feature: it is pretty intuitive in Tree View mode which node is the search root. However, in List View mode, things are inferred in a way that I hope is intuitive enough: when no subkey is selected, then the search root is the current key whose subkeys / values are currently displayed.

Also of note: deployment to the SmartPhone is now easier, please see the PDF for details (I am now using RapiDeploy).

Monday, 20 December 2004 12:13:17 (W. Europe Standard Time, UTC+01:00)  #    Comments [3]

 



#  Thursday, 16 December 2004

The Mobile and Embedded Application Developer Center has a nice Developer Resource Kits page. Especially interesting are the WeRock247.NET & Football247.NET Training DVDs, of which you can download the WeRock247.NET SmartClient Training DVD (Football 247.NET is order only).

For me, the most interesting parts are (as in I have the DVDs) the bonus sessions that are included on the DVDs. I wanted to blog about those Learn247 projects for a long time, but kept forgetting about it - now the Resource Kits page reminded me once again, for good this time.

Thursday, 16 December 2004 08:05:47 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Tuesday, 14 December 2004

Finally found some time to add a few missing things to the registry editor: most importantly editors for string[] (REG_MULTI_SZ) and byte[] (REG_BINARY), as well as some other improvements (mostly behind the scenes).

Like last time: please read doc\Program Notes (4 Dev and User).pdf before installing!

Details from ChangeLog.txt:

- Byte[] editor added (needs to be improved user-input-wise)
- String[] editor added
- Editors are now loaded via Hashtable and Reflection (easier to maintain)
- Menu restructuring (New Value submenu)
- KeyPress event for DWORD editor modified to only allow numbers to be entered
- New project directory structure

Download (795KB)

Tuesday, 14 December 2004 21:06:22 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Friday, 10 December 2004

I’m one of those next-cool-thing addicts that can’t resist to play with the latest most unstable Whidbey CTP coming out of Redmond. One of the red-hot things is generics that will be included with C#^H^H the CLR v2.0. This intentional blunder is the central point of this editorial - clearing up misconceptions about generics.

When reading postings or talking to fellow early .NET 2.0 adopters you come to categorize those into the following distinct groups:

  • The C++ developers
  • The Non-C#, Non-VB.NET, Non-Managed C++ developer
  • The Java developer (yes, I know…)
  • Generics, huh?

Let’s start out with the die-hard C++ programmer, a guy who really is in love with the templating system in C++ (when referring to C++ I really mean the unmanaged C++ world). This is the most vocal among the four groups, and they’ll be very forthcoming in telling you how much better C++ templates are than generics in C#. I hate to break the news to them, but generics are intentionally different: firstly, and most importantly, C++ templates are compile time only, whereas generics are compile as well as runtime. Anders Hejlsberg did a great job of explaining that in [1], and the C# team has a FAQ online on this topic too [2].

Secondly, the being different goal also extends to simplicity of use. Do you remember yourself screaming bloody murder when C# came along with single inheritance? Right. How many people did and do care in real life? See. Same here in generics-land: certain power has been stripped from you because it would tip the balance from easy to use to intimidating and overly complicated. That’s why constraints don’t cover the whole complexity spectrum and don’t allow operator constraining and the like, such as non-default constructor constraints. Oh, you can fake operator constraints if you really, really care with the approach detailed in [1] and [3], but admittedly this won’t solve the problems for intrinsic types.

Speaking of operator constraints constraints (couldn’t resist), a general misconception in the C++ camp is that everything they are used to should be just as dangerous – pardon me, powerful – in other implementations. C++ templates allow you to do what you damn well please, but generics don’t – that very type checking is the one thing to single out that rid us of AVs, remember?

The Non-C#, Non-VB.NET, Non-Managed C++ developer. So who are they? Try one of 30+ (don’t quote me on the actual figure) other programming languages that follow the CLS (Common Language Specification) and produce code that can run on the CLR. It is rather similar if not exactly the same as with Edit and Continue support – “me too!” is heard all around the globe. So, do they get generics? Depends. Because of the many programming languages that exist for .NET, Microsoft decided to not put generics in the CLS. So it is entirely up to the language vendor in 2.0 to support generics or not.

Has the C#/VB.NET developer any beef with that? You bet. If you write a framework that has to be used in other programming languages, that framework has to be CLS compliant (“should be” is too soft in my view). And this means you cannot use generics on the public interfaces if you want to mark your assembly with the CLSCompliant attribute. The Non-CLS compliance of generics is pointed out in [4] and [5], with hints that generics will find their way into the Common Language Specification in the Orcas / Longhorn timeframe.

The Java developer. Now, how do they fit into the picture of the early adopter of .NET 2.0? I’m sure one thing .NET developers will hear a lot is that “Java had generics long before .NET.” Not so fast, Scotty. Just like there are differences between C++ templates and .NET generics, there are differences between Java generics and their counterparts in .NET. Once again, Anders Hejlsberg did a great job in [1] of explaining what is different: for one, .NET generics are actually typed, which means no boxing for value types (a very good thing!). Secondly, .NET generics are runtime too, not just compile time – you can reflect on generics in .NET, you can’t do that in Java. The lowdown: generics in Java spare you the task of casting, but that’s about it.

Finally, the group “Generics, huh?” Those are developers who for example still have the misconception that generics are a C#-only feature, like many programmers using 1.0 initially thought that features offered by the CLR were actually C# features. Let’s chalk that one up to miscommunication, but a repeated one.

You know that generics (will) exist, but have no clear idea what they are intended to be used for? I’d like to quote Anders Hejlsberg: “Generics is essentially the ability to have type parameters on your type.”[1] D’accord? Really simple but really powerful.

You know what generics are (if not, please see the previous paragraph), but have no idea what to use them for? If you are like one of my friends “I’m not in the business of writing frameworks, and the .NET framework already has generic collections, so what use are generics to me?”, rest assured that there are plenty of other non-class uses: generic methods (data access, anyone?) and generic delegates (in an instant makes callbacks that much more fun). Did you know about those two generics use cases?

To conclude this editorial, I’d like to firmly state that generics are positioned somewhere between being  “just a fancy way of replacing typed collections” and the all-too-powerful for shooting yourself in the foot C++ templates. Well designed, tightly integrated in the CLR, the right dose of power – with one problem: too many different views of what generics are, what they are intended for, and what they can be used for. I for one am confident that they will be useful to programmers – yes, useful –  nothing more, nothing less.

[1] Generics in C#, Java, and C++
http://www.artima.com/intv/generics.html

[2] How do C# generics compare to C++ templates?
http://blogs.msdn.com/csharpfaq/archive/2004/03/12/88913.aspx

[3] Generics Algorithms
http://blogs.msdn.com/ericgu/archive/2003/11/14/52852.aspx

[4] Dan Fernandez's Blog - Quick information on Generics
http://blogs.msdn.com/danielfe/archive/2004/06/21/161962.aspx

[5] Q&A with VJ# and C# Team on Generics
http://www.thedatafarm.com/blog/CommentView.aspx?guid=a71779f2-7a6a-4df1-81d4-3ccaa2f18cff

[6] An introduction to Generics
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/csharp_generics.asp

Bootnote: This blog entry originallly was intended to be an editoral, however, an editorial is an opinion piece, and the publisher wanted a different opinion. This is why the text is now in my blog where you can read (and flame) it freely.

Categories: .NET | 2 Ohhhh | C# | this
Friday, 10 December 2004 10:22:26 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 08 December 2004

Today we released yet another open source project: #usblib (SharpUSBLib). The history for this project is quite similar to many other OS projects ("scratching an itch"): Mike built a terrarium for his soon-to-be-delivered chameleon, and he wanted to manage the ligthing using a USB-controlled power switch. Not having found a suitable USB library for .NET, he decided to write one himself.

The library is used for low level access to USB devices, and it works under WIN32/.NET and Linux/Mono. Documentation can be found in the wiki, a support forum also exists. The download includes source code for this dual-licensed (GPL and LGPL) library.

Categories: .NET | C# | Cool Download | this | Use the source Luke
Wednesday, 08 December 2004 11:28:39 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Monday, 06 December 2004

There is a new hands-on lab for Web Services Enhancements 2.0: Learn how to secure Web services without writing code. Sample code is provided for both C# and VB.NET, so it should fit almost everyone.

Categories: .NET | ASP.NET | Security
Monday, 06 December 2004 18:57:51 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 02 December 2004

Ok, I was convinced to release my current development bits to the general public for public criticism. A PDF document accompanies the download. Make sure you read that first before installing, because installation is rough to say the least (developer friendly, but not end user compatible). But judge for yourself.

Now for the more interesting part: source code is included! This nice registry editor is open source, licensed under the GNU General Public License (GPL). I hope that it can serve for more than just a bad example of how not to do things on a Smartphone ;-). Count on me for documenting the pitfalls and stumbling blocks that I magically wasn't able to avoid.

So without further ado, here is the download. If you want to read up on the history of the project, simply dig into the Smartphone / PPC category of this blog.

Thursday, 02 December 2004 20:00:35 (W. Europe Standard Time, UTC+01:00)  #    Comments [6]

 

Need a ViewState Decoder? Want to view the ASP.NET security context? Generate a machine key? Trying to understand the ASP.NET pipeline? Or looking for a password minding application? All this plus more can be found for free on this page.

Categories: .NET | ASP.NET | Cool Download
Thursday, 02 December 2004 14:39:37 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Thursday, 25 November 2004

In case this weekend turns out to be too long for you (and you get bored without a real .NET challenge), check out the CodeDOM MSIL Code Provider and the CodeDOM Subset Code Provider. The more interesting bits from the download description:

The Microsoft Intermediate Language (MSIL) code provider takes a CodeDom tree and generates MSIL syntax. MSIL code provider generates all the CodeDom elements that are part of the 1.1 conformance spec. MSIL code provider generates code for most of the CodeDom types that shipped in V1.1. Why emit C# when you can emit IL!

The CodeDom Subset Code provider consumes CodeDom trees in the way the C# code provider does, but whenever a node that does not fall into the subset is encountered, it emits a #error in the generated code. This will alert to the CodeDom tree builder of any place in their code where they don't meet subset conformance. Roll your own subset of the C# language - anyone interested?

Categories: .NET | C# | Cool Download
Thursday, 25 November 2004 20:32:10 (W. Europe Standard Time, UTC+01:00)  #    Comments [0]

 



#  Wednesday, 27 October 2004

Bijan Javidi, Senior Principal Consultant at Microsoft, held a two-day Trainer the Trainer (TTT) event in Augsburg for the GLS Development Process Best Practice training. In the audience: Alexander Zeitler, Peter Koen (soon to be Softie), Bernhard Spuida, Hannes Preishuber, Achim Oellers and others (no specific order, just to name a few).

As rehashing the entire two days would be a tad lengthy, I only pick two items that are important to understand why anyone would attend such a training:

  • Why Development Process?
  • Definition of Development Process Best Practice

Let's start with "Why Development Process?"

  • Make development
    • Predictable
    • Repeatable
    • Manageable
  • Reduce costs
  • Streamline application construction
  • Establish standards
  • Reduces risk in .NET projects

After those incentives to have a process at all, let's dig into what DPBP is - here is the definition:

  • Process based development methodology
    • Ultra light-weight, pragmatic and prescriptive
    • End-2-end development process model
      • From requirements to deployment
  • Minimum set of documents
    • Small number compared to UP
  • Step-by-step guideline
    • How to create these documents
  • Uses Office and Visio formats (UML)
    • DOC, XLS, and VSD templates
  • DPBP is agile
    • Leverages many XP features
  • End of prose text in development process
    • Minimizes text
    • Uses structured information
  • Lazy modeling
    • Model only if you have to
      • Architecture metaphor (XP)
    • Uses minimum of everything to do the job

Bascically we are talking initialization, analysis, design, implementation and deployment. And that was then the contents of the two-day workshop in Augsburg.

Networking was commenced at the evening event on Monday, in the Welser Kuche with a medieval meal:

Want see more fotos? Look no further (German titles and description though)

Wednesday, 27 October 2004 10:53:20 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Friday, 15 October 2004

Another MSR (Cambridge) project: The goal of the Samoa Project is to exploit recent theoretical advances in the analysis of security protocols in the practical setting of XML web services. Some early outcomes of this research include an implementation of declarative security attributes for web services and the design of a logic-based approach to checking SOAP-based protocols.

Even if this doesn't sound interesting to you, the site sports a really great resources section with lots of article links, security topics, bloggers and columnists, resource hubs and more. If you are working with Web Services, check this site out!

Categories: .NET | MSR | Security
Friday, 15 October 2004 10:04:38 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 04 October 2004

I had mentioned Paint.NET earlier here, but now version 1.1 is released which has even more exciting features, of which I picked a few ones:

  • New Effect: "RotoZoomer" which can perform arbitrary angle rotation, and zooming.
  • Layer Properties now visually previews and updates all properties in real time without having to press the "Apply" button.
  • Invert and Desature are put into the Image -> Adjustments menu, along with a new adjustment called "Brightness & Contrast."
  • User interface upgraded to make full use of XP themes. In v1.0, many dropdown boxes and "updowns" had a Win2K/OfficeXP look to them.
  • Extensibility! After you install the program, check out the "RotoZoomerSource.zip" for an example of how to write an Effect plugin. You will need Visual Studio 2003 .NET to write a new plugin. No other types of plugins are supported for v1.1.

Like last time, full source is provided too (which has lots of tweaks and refactorizations). Read more and download

Monday, 04 October 2004 08:02:41 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Thursday, 30 September 2004

OWASP (The Open Source Web Application Security Project) has a couple of projects online focused on ASP.NET security issues. Current projects include ANBS (ASP.NET Baseline Security), SAM'SHE (Security Analyzer for Microsoft's Shared Hosting Environments), ANSA (ASP.NET Security Analyzer) as well as the ASP.NET Security Guidelines for designing and deploying secure Web applications using ASP.NET (applicable to IIS 5 & 6).

OWASP .NET Projects Homepage

Categories: .NET | Administration | ASP.NET | Cool Download | Security
Thursday, 30 September 2004 07:48:15 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Monday, 27 September 2004

From the Web site: MbUnit is an evolutive Unit Test Framework for .Net. It provides new fixtures as well as the framework to create new ones. MbUnit is based QuickGraph, a directed graph library for C#.

As it is fully compatible with NUnit, this generative unit test framework does look promising. While I am at it, also check out .NET Mock Objects.

Categories: .NET | Use the source Luke
Monday, 27 September 2004 10:43:46 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Wednesday, 22 September 2004

Tune in to the flight deck communication and learn about how we achieve our primary target of creating an integrated development environment for .NET!

This now is my third blog - ok, in reality it is two when I count the #develop team blog and German .NET community blog as shared.

Categories: .NET | this | Use the source Luke
Wednesday, 22 September 2004 09:54:48 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 21 September 2004

Mike Harsh (PM on the Windows Forms team) is taking on the task of answering the question on whether Windows Forms are a dead end or not in his post Is Windows Forms Dead?

Categories: .NET
Tuesday, 21 September 2004 17:20:42 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 14 September 2004

Found at msmobiles.com: This eBook may be useful for you if you would be interested in writing software for Microsoft Smartphone powered cell phones. It covers both native code (C++) and managed code (C#, Visual Basic .NET).

Categories: .NET | Smartphone and PocketPC
Tuesday, 14 September 2004 11:05:49 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Saturday, 11 September 2004

Finally. At long last. It took us four years to lay a solid foundation for #develop's future as a great Integrated Development environment. During that time I worked as the project's senior project wrangler: trust me, steering (open source) developers with their egos makes herding cats look like an easy challenge.

I have to admit that I learned a lot, which after all was the initial idea of joining the project. Managing, architecting, building and testing a project that has a few kLOC of C# code under its belly is a challenge when you have a distributed team - at least the core team was able to meet a few times. I'm proud that it worked out so well.

Read the announcement for 1.0

Categories: .NET | Cool Download | this | Use the source Luke
Saturday, 11 September 2004 08:45:58 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 31 August 2004

It is available at long last. The Windows Server 2003 version is here, all other operating systems go here.

Categories: .NET
Tuesday, 31 August 2004 08:27:17 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Tuesday, 24 August 2004

C5 is a library of generic collection classes for the upcoming version 2.0 of the .Net platform. C5 extends the standard .Net System.Collections.Generic namespace with tree data structures, heap based priority queues and hash indexed array lists and linked lists, making it more comprehensive than most collection class libraries on similar platforms. Unlike many other collection class libraries, C5 is designed with a strict policy of supporting "code to interface not implementation".

Now that definitely looks worth checking out!

Categories: .NET | 2 Ohhhh | Use the source Luke | C#
Tuesday, 24 August 2004 08:35:52 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



#  Saturday, 21 August 2004

The book The .NET Developer's Guide to Windows Security is available for online reading in Keith Brown's wiki. It answers seventy-five questions, of which a .NET programmer better be able to answer quite a few of them! So be sure to check it and bookmark the page for your future programming endeavors.

Categories: Security | .NET
Saturday, 21 August 2004 01:01:42 (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]

 



© Copyright 2017 Christoph Wille

newtelligence dasBlog 2.3.9074.18820
Subscribe to this weblog's RSS feed with SharpReader, Radio Userland, NewsGator or any other aggregator listening on port 5335 by clicking this button.   RSS 2.0|Atom 1.0  Send mail to the author(s)

 
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.