Monday 11 July 2011

VS2010 Strongly Name key issue

Problem: Visual Studio 2010 using TFS2010 on multiple developer machines keeps erroring on all developers VM's after they get the latest code "cannot import the following key file" and mentions the sn key.

Resolution: On the projects properties > Signing > Click the drop down for "Choose a strong name key file:" Click the option, click "Cancel" button.  You are prompted with a dialog "enter password to enter file", add the keys password and select OK.  VS will stop erroring after you have done this once.

More Info: http://stackoverflow.com/questions/2815366/cannot-import-the-following-keyfile-blah-pfx-the-keyfile-may-be-password-protec

Building a WCF Web Service for InfoPath data

Problem: Create a WFC web Service to store an InfoPathForm

Initial Hypothesis:  Project consists of 3 parts: 1)SQL Server table for storing form data, 2)WCF web service for exposting the storage web service method and 3) consuming the Web Service using infoPath.

1) SQL Script to create the datbase table.  Once the table is available for storage we need to build the WCF web Service.
2) WCF web service:
2.1) Add the LINQ to SQL proxy (dbml file) to persist the data
2.2) Assign
2.3) Wire up the WCF WS
Edit as needed (apply business logic)
2.4) Expose the WCF thru an IIS website on your Dev machine (Create an IIS web site to host the WCF):
2.5) Publish the WCF using VS2010 as shown below to the local machine
Ensure the WCF service is available using the browser.

3) Consuming the WCF WS in InfoPath forms



How to Add a Service Reference?


1.> Ensure the WCF exists i.e. http://wcf-service/FormService.svc

2.> Generate the WCF proxy (VS > Right click the WFE project > Add Service Reference > Insert the url and save the WS reference)

3.> Copy the contents of the app.config bindings & endpoints elements into the web.config (this needs to be automated in the deployment script thru a configurable feature) Web.config is shown below:

4.> Call the WCF web Service (consumer)
WCFBanner.BannerClient ws = new WCFBanner.BannerClient();
WCFBanner.PatientBanner pb = ws.GetPatientBannerByPatientId("G3");
lit1.Text = "PatientId: " + pb.PatientId;
ws.Close();

Additional Info:
Comparing SharePoint InfoPath lists vs forms

Monday 4 July 2011

Web.config change

Overview: Change all the web.configs for all web applications on the farm except the Central Admin web application.

Tip: Use the id attribute as shown in the yellow box, it will ensure there are no duplicates created by reactivating the web.config.

Friday 1 July 2011

SP1 and SP2010 June 2011 CU

Overview:  There has been a lot of chatter on twitter about SP1.  I incorrectly installed SP1 on a dev machine and after reading "So what the Fuss? - Service Pack 1 and June 2011 CU for SharePoint 2010" from Spencer Harbar I thought I'd summerise the correct approach as detailed in Spencer's article.
Notes:
  • MS has released SP1 for SP2010 and June 2011 CU on the same day 27 June 2011. 
  • There are seperate downloads for SPF (SharePoint Foundation) and SPS (SharePoint Server) updates, you should install both.  Install the SPF update first followed by the SPS update.
  • June 2011 CU is not part of SP2010 SP1, only install the June 2011CU if directed by MS and wait a month to see the fall out regardless.
  • SP1 contains all CU updates including the April 2011 CU plus some other updates not in any CU.
From Spencer Harbor's blog regarding installation order "I approach the installation like this:
  1. SPF SP1
  2. SPF language packs SP1 (as needed)
  3. SPS SP1
  4. SPS language packs SP1 (as needed)
  5. OWA SP1 (as needed)
If it asks you to reboot, reboot once after the installs, not each time it asks. Then of course you run PSConfig on each server in the farm.".

As always test updates on your DTAP environment pre release onto production.

More Info:
http://blogs.technet.com/b/office_sustained_engineering/archive/2011/06/29/sharepoint-2010-sp1-and-the-june-cumulative-update-for-sharepoint-2010.aspx
New features added by SharePoint 2010 SP1
http://www.sharepointjoel.com/Lists/Posts/Post.aspx?ID=444
Patch SP2010 farms

Monday 27 June 2011

Interested in Writing a Chapter for a SP2010 Community Book

About this book:  This book consists of standalone chapters written by various authors with real world experience of SharePoint 2010.  The content is predominantly non-technical allowing people involved and managing SharePoint 2010 projects to deploy SharePoint successfully within their business.

More info ...

Friday 24 June 2011

AntiVirus for Windows 2008 Developer Machines or WAF

Problem: My developer machine always runs Windows 2008 R2 x64.  I use the machine to browse the Internet and would like anti-virus installed.  No workstation based anti-virus will install on Windows 2008 Sever.

Initial Hypothesis: All the vendors that provide Anti-virus for Windows 2008 are expensive and are Server based anti-virus software whereas I am using my developer machine to surf and occasionally bring on files so I only need workstation based anti-virus.  Unfortunately I have never found a regular anti-virus that runs on Windows 2008 until now ... and best of all it's free and from Microsoft.

Resolution:  Use "Microsoft Security Essentials"
http://www.microsoft.com/en-gb/security_essentials/default.aspx

List of anti-virus plug ins

Update: 04 Sept 2013 - Antivirus and SharePoint 2013 (Spencer Harbar)

Update: 31 May 2022 - WAF sometimes don't have a anti-virus or cost a lot.  This is a simple approach to use a Linux container to provide an Open API endpoint to programmatically allow files and links to be scanned.
"The SWS Virus Scan Container project leverages ClamAV docker image and provides a REST API over it, which can be used to scan files and URLs. This container image is compatible with Azure Web apps for Containers and could also be run within other orchestrators like Kubernetes (and AKS)."


Thursday 23 June 2011

SP2010 install using AutoSPInstaller from PowerGUI

Problem: I want to install SharePoint 2010 using Brian Lala's AutoSPInstaller codeplex project however, I want to be able to see values and debug using PowerShell

Resolution:
Ensure AutoSPInstaller is setup correctly and PowerGUI is installed.  Correct setup is shown below.  Ensure that the xml file is named correctly.

Tip: Windows has a built in graphical debuggger for PowerShell called ISE Editor
http://blogs.msdn.com/b/powershell/archive/2009/01/19/debugging-powershell-script-using-the-ise-editor.aspx
PS> c:\SP2010\AutoSPInstaller\AutoSPInstallerMain.ps1 c:\SP2010\AutoSPInstaller\AutoSPInstallerInput-WIN-2C5PI8TSRPA.xml

Press F5 or the arrow to debug.  I have all the .ps1 files in the PowerGUI editor and add break points. 

Note.  If you hit a break point and press F5 once you are debugging, PowerGUI will not stop at the next break point.  F10 will take you to your next breakpoint or where the next error is trapped.