Adding Web User Controls (.ascx) to WSPBuilder Project

I was working on a SharePoint webpart in Visual Studio 2005,  few days before, creating a WSPBuilder project. At one stage i wanted to add a web user control (.ascx file) to my project and make use of it in my webpart. So i right clicked the appropriate folder i want to place it in the 12 hive and chose add new item.

But i was not able to see a Web User Control item in the list of Add New Items. I tried a few items to add the item and then thought of an ugly idea of creating the ascx in another project and copying it into this project. Then i got this solution from an online article for adding web application items support to the wspbuilder project.

1. Right click the project and choose ‘Unload Project’ from the menu.

2. Right the project node in Solution Explorer and choose Edit ProjectName.csproj.

3. Look for the highlighted line in the .csproj file.

2 <PropertyGroup>

3 <Configuration Condition= ‘$(Configuration)’ == ” >Debug</Configuration>

4 <Platform Condition= ‘$(Platform)’ == ” >AnyCPU</Platform>

5 <ProductVersion>8.0.50727</ProductVersion>

6 <SchemaVersion>2.0</SchemaVersion>

7 <ProjectGuid>{375819D3-5E9F-41ED-B8A5-2888B82C2539}</ProjectGuid>

8 <OutputType>Library</OutputType>

9 <AppDesignerFolder>Properties</AppDesignerFolder>

10 <RootNamespace>SampleWSP</RootNamespace>

11 <AssemblyName>SampleWSP</AssemblyName>

12 <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

13 <SignAssembly>true</SignAssembly>

14 <AssemblyOriginatorKeyFile>SampleWSP.snk</AssemblyOriginatorKeyFile>

15 <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

16 </PropertyGroup>

4. Add {349c5851-65df-11da-9384-00065b846f21} to the ProjectTypeGUIDs node.

2 <PropertyGroup>

3 <Configuration Condition= ‘$(Configuration)’ == ” >Debug</Configuration>

4 <Platform Condition= ‘$(Platform)’ == ” >AnyCPU</Platform>

5 <ProductVersion>8.0.50727</ProductVersion>

6 <SchemaVersion>2.0</SchemaVersion>

7 <ProjectGuid>{375819D3-5E9F-41ED-B8A5-2888B82C2539}</ProjectGuid>

8 <OutputType>Library</OutputType>

9 <AppDesignerFolder>Properties</AppDesignerFolder>

10 <RootNamespace>SampleWSP</RootNamespace>

11 <AssemblyName>SampleWSP</AssemblyName>

12 <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

13 <SignAssembly>true</SignAssembly>

14 <AssemblyOriginatorKeyFile>SampleWSP.snk</AssemblyOriginatorKeyFile>

15 <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>

16 </PropertyGroup>

5. Now right click the Project and choose ‘Reload Project’ and try adding a .ascx file.

You must get it now.

Note: Cross posted – http://blog.sharepointpowerpack.com/archive/2010/11/22/adding-web-user-controls-ascx-to-wspbuilder-project.aspx

NLV

Advertisements

Removing Windows Server 2008 boot loader (from a dual boot machine)

A month ago i installed Windows Server 2008 in my XP box with a dual boot setup. After a few days i was forced to remove Windows Server 2008 from my machine and install Windows Server 2003. So i checked out for any good uninstall options using the Server 2008 bootable DVD. But i found none.

So i went on formatting the Server 2008 drive (L:) and tried rebooting the system. As expected the Server 2008 boot loader was not removed and it pointed to an invalid entry of Server 2008. I went through a couple of painful days trying to remove the boot loader during when i installed/uninstalled server 2008 few times. Arrgh! After spending a few hours googling for a solution i found a gem of a solution for this from the MSDN forums.

Easy BCD

So here is the complete solution for removing windows server 2008 from a XP installed machine (Expecting you XP to be installed in C: drive and Server 2008 in any other drive).

  1. Boot into XP
  2. Format the Server 2008 drive (If you cant format the drive from the Format menu, try formatting it from the command prompt. The command prompt gives you the option to format the drive by unmounting it remounting if after it is done)
  3. Download and install EasyBCD from http://neosmart.net/dl.php?id=1
  4. Open EasyBCD
  5. Go to Manage Boot Loader
  6. In Boot Loader Options, select ‘Uninstall the Vista Boot Loader (use to restore XP)
  7. Click Write MBR
  8. What else? You’re done!

Me