How to add a WPF control library template to Visual C# Express 2008

December 5, 2007 at 9:05 am | Posted in C#, Visual Studio 2008, WPF | 7 Comments

Visual C# Express 2008 does not come with a project template for creating custom controls (.dll files).  You can create your own template by following these steps:

  1. 1. Open Visual C# Express 2008.
  2. 2. Create New WPF Application with name: MyLibrary
  3. 3. Project > Add User Control
  4. 4. In Solution Explorer, Delete Window1.xaml and App.xaml (the corresponding .cs files should be deleted by this step)
  5. 5. Project > MyLibrary Properties > Application > Output Type = Class Library
  6. 6. Build Solution.  There should be no errors and the bin/Release folder should have a MyLibrary.dll file
  7. 7. File > Export Template
  8. 8. Select Project Template then Next
  9. 9. Under Template Options change name to: WPF Control Library and Description: Create WPF Control .dll

The next time you open VS, you will find your newly created template ready to use.



RSS feed for comments on this post. TrackBack URI

  1. Great post, worked like a charm… now to figure out how to use it.

  2. The problem I am finding is that once you pull this new library into windows forms, it does not recognize using System.Windows.Forms or any other Graphics components. I wanted this work around because there is another tutorial on how to build your own progress bar in VisualStudio Express 2008 and It requires this WPF library Template. Can you tell me how to get this Libary Template to think it’s a windows forms component?

  3. Okay I went back and carefully rewrote the progress bar code and it compiles. Thanks for the workaround on the WPF Library.

  4. I’m back again I’m Afraid. Everything that needs this WPF control library eventually wants me to inherit the base class of a form control and this library will not recognize using System.Windows.Forms; When I tried to make a custom progress bar, I got it to compile but when I tried to add to the toolbox the error was There are no components that can be placed on the tool box. I don’t think this is working.

  5. Thank you. Works great. I didn’t know anything about exporting projects as templates, so that’s helpful overall as well.

  6. Thanks. FYI, this works in VS2012 Express for Windows too.

  7. The only thing I would add is that you should probably delete “App.config” from the solution explorer before you export the template. Class libraries don’t typically have this; this is an application thing.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at
Entries and comments feeds.

%d bloggers like this: