Serialisation in C# 3.0

21 12 2007

This is a great article demonstrating Serialisation in C# 3.0 including the DataContractSerializer.

O’Reilly C# 3.0 in a Nutshell





Deploy an InfoPath 2007 Form with Managed Code to a Browser Enabled Sharepoint Document Library

17 12 2007

InfoPath forms can be deployed to a Sharepoint document library, and assuming that the form template has been developed to be browser compatible, the form can be opened in a browser client (either when the user’s machine doesn’t have the InfoPath client or when the Sharepoint document library is configured to open forms by browser only).

Such form templates can usually be published directly to a Sharepoint document library without Administrator intervention, however, when the form template contains managed code the form cannot be published directly to the Sharepoint document library, but has to be first Approved by the Sharepoint Administrator.

The Administrator has to approve the template, upload it and then activate it against 1 or more site collections.

The process begins be publishing the form template as usual, at the screen shown below, select “Enable this form to be filled out using a Browser” and select “Administrator Approved form template”

image

Continue the publish procedure as normal, except that you will be publishing to a network share (or other location) accessible to the Sharepoint Administrator who can then review the form template and approve it.

The Sharepoint Administrator must then;

  1. Upload the template to Sharepoint
  2. Activate it against site collection(s)
  3. Associate the form template with a form library

To Upload the template;

  1. Go to Central Administration for your farm
  2. Select Application Management, from there select InfoPath Forms Services, and then choose Manage Form Templates.
  3. The Form Template library is opened, which is where administrator approved templates for the farm are stored.
  4. Select “Upload Form Template”. Locate and select the saved template file and click the Verify button. You will be shown any errors or warnings related to your template (review them if necessary), and click OK.
  5. Locate your form template again. The Upgrade options exist for you to choose how to upgrade the form template if it already exists.
  6. Click the Upload button to perform the form template upload. It is now available as a Feature to be activated against any site collection in the farm.

To Activate the form template on a Site Collection;

  1. You can activate the form template feature from the Manage Form Templates page of Central Administration, the same page where we just uploaded the template. From the templates context menu, choose Activate to a Site Collection.
  2. In the Location section of the page, choose the relevant Site Collection and click the OK button.

Note, that you may have to change the Web Application location in order to find the right site collection.

To Associate the Form Template with a Form Library;

  1. Create a new form library or use an existing one
  2. Select the library’s advanced settings page and configure the library to allow content-type management
  3. Optionally, you might want to select the “Display as Web-Page” setting
  4. Click OK
  5. From the Content Types section, select “Add from existing site content types”, from the list box displayed locate your form template, click Add then click OK.

If you return to your form library and select New from the library menu, you should see an option there for your form template. If you choose this new option, the form template should be opened in the browser.





Load InfoPath Forms with Managed Code from Sharepoint

17 12 2007

When loading an InfoPath form from a Sharepoint document library, you may be presented with a policy error message indicating that (Internet) forms with managed code cannot be loaded.

This can be a pain in the neck while developing, but can be circumvented by making the following registry change;

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\InfoPath\Security:RunManagedCodeFromInternet(DWORD) = 1





Unable to run tests in VS 2008 Unit Testing

11 12 2007

Had a problem today trying to run tests in Visual Studio 2008, where the test run would complete saying that all tests were not executed. A look in the test run details shoed the following error message;

“Code coverage collection error: The Visual Studio performance and coverage logging engine is already running on the computer. Therefore, the test run cannot continue. Close the pending performance or code coverage session and then rerun the tests.”

The solution is to shutdown the VSPerfMon.Exe process which gets left in memory when you debug a unit test and stop the debugger before the test finishes.

More information can be found here at Microsoft Connect.