Welcome to my blog on all things SharePoint. I have a range of articles that will interest you if you've made it as far as visiting my blog. I was awarded as an SharePoint MVP by Microsoft in July 2010. I currently live in New York and am an Enterprise Architect at AvePoint Inc.. I co founded www.NothingButSharePoint.com with Mark Miller in 2010.

MVP AwardJeremy Thake Profile Photo

Whitepapers

NBSP

Check out my articles on NothingButSharePoint.com

Solution Development in SharePoint 2007

This series was inspired by the chatter amongst SharePoint blogs on the best ways to approach customisations in SharePoint using Solutions.

Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6 - Part 7 - Part 8

Leveraging the SharePoint Platform

This series was inspired by a discussion had with Andrew Coates at a Perth SharePoint User Group meeting. This then turned into a 6 part series on Arno Nell's SharePointMagazine.net web site.

Initial post - Part 1 - Part 2 - Part 3 - Part 4 - Part 5 - Part 6

Webcasts

I have recorded various web casts that I present at User Groups or just on a specific topic by request:
How ASP.NET Developers can leverage SharePoint webcast
SPSource Webcast: Reverse engineer Lists to ListTemplates and much more
SharePoint Development with Unit Testing webcast
Perth SharePoint UG Web Cast on approaches to deploying artefacts (SPSource)
More...


Podcasts

I have been interviewed about Leveraging the SharePoint Platform by the SharePoint Pod Show: listen here .

RSS Feed Feed your read!

Archives

March 2012 (1)
February 2012 (1)
January 2012 (5)
September 2011 (2)
August 2011 (1)
July 2011 (3)
June 2011 (7)
May 2011 (3)
April 2011 (3)
March 2011 (3)
February 2011 (2)
January 2011 (1)
December 2010 (4)
September 2010 (4)
July 2010 (5)
June 2010 (4)
May 2010 (6)
April 2010 (7)
March 2010 (5)
February 2010 (7)
January 2010 (3)
December 2009 (1)
November 2009 (6)
October 2009 (9)
September 2009 (7)
August 2009 (6)
July 2009 (13)
June 2009 (4)
May 2009 (12)
April 2009 (4)
March 2009 (4)
February 2009 (13)
January 2009 (4)
December 2008 (4)
November 2008 (11)
October 2008 (16)
September 2008 (4)
August 2008 (5)
July 2008 (4)
June 2008 (8)
May 2008 (5)
April 2008 (9)
March 2008 (5)
February 2008 (6)
January 2008 (1)
November 2007 (11)
October 2007 (8)
September 2007 (24)
August 2007 (5)
July 2007 (2)
May 2007 (1)
April 2007 (1)
March 2007 (1)
February 2007 (3)
January 2007 (4)
November 2006 (7)
October 2006 (7)
September 2006 (18)
August 2006 (14)
June 2006 (3)
May 2006 (8)
April 2006 (4)
March 2006 (38)
February 2006 (30)
January 2006 (2)
December 2005 (3)
November 2005 (28)
May 2005 (1)
April 2005 (5)
March 2005 (1)
November 2004 (1)
August 2004 (11)
July 2004 (1)
Failed to render control: An error occurred during a call to extension function 'createMonthUrl'. See InnerException for a complete description of the error.

Links

Tag Cloud

Ajax, Apple, DotNetNuke, Enterprise Content Management, Error Resolution, Gadgets, General, Governance, Microsoft .Net Development, Mobile, SharePoint, Sharepoint Business Forms, Sharepoint Business Intelligence, Sharepoint Collaboration, SharePoint Development, Sharepoint Enterprise Content Management, Sharepoint Enterprise Search, Sharepoint Portal, US Migration, Web 2.0, Workflow

VSeWSS 1.3 CTP - why does it require SQL access?   

Tags:

So the new VSeWSS 1.3 CTP creates a Web Application to host a WCF web service. Nice to see the SharePoint Development Product team playing with new technology. In my experience of installing it into a Development environment where I follow Least Priviledged installation approach recommended by Microsoft I found that you'll receive an error when trying to Package any VSeWSS Project in Visual Studio 2008:

Error    1    VSeWSS Service Error: Assembly C:\Documents and Settings\admin\My Documents\Visual Studio 2008\Projects\Empty1\Empty1\bin\Debug\Empty1.dll not found. This may occur because the VSeWSS WCF Service does not have local administrator permissions. Please review the release notes. 

Log file written to: C:\Documents and Settings\Default User\Application Data\Microsoft\VSeWSS 1.3\VSeWSS1.3 service.log        0    0    

You can get round this by adding the domain account running the Application Pool that the VSeWSS web application is running under to the Local Administrators group and running IISRESET. Not the best configuration in the World required just to write a log file to the Application Data folder! I would suggest to the team rethinking the architectural approach of writing log files here if it requires this configuration.

This also fired another little gotcha as I tried to create a new local admin user to run the application pool, then I realised that the user running the isolated Application Pool would have to be part of these groups (according to the VSeWSS 1.3 CTP release notes):

  • Administrators
  • IIS_IUSRS
  • Users
  • WSS_ADMIN_WPG
  • WSS_RESTRICTED_WPG
  • WSS_WPG
  • SQLServer2005MSSQLUser$ - Unique on your machine created for SQL Server access

Why on Earth does the account require access to the SQL Server? After much thought I decided to run the Solution Generator to reverse engineer a List Definition and got this error (because I didn't grant the account access to SQL):

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
Microsoft.SharePoint.Tools.Utilities.VSeWSSServiceException: VSeWSS Service Error: Cannot open database "WSS_Content_Portal" requested by the login. The login failed.
Login failed for user 'DEV-MOSS01\VSEWSS'.

Log file written to: C:\Documents and Settings\Default User\Application Data\Microsoft\VSeWSS 1.3\VSeWSS1.3 service.log
   at Microsoft.SharePoint.Tools.Utilities.SPProxy.HandleResponse(Response response)
   at Microsoft.SharePoint.Tools.Forms.ListSelectionPanel.UpdateListView()
   at Microsoft.SharePoint.Tools.Forms.ExportDetailForm.ListSelectionPanelVisibleChanged(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnLocationChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
SPSolGen
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.4518.1092
    CodeBase: file:///C:/Program%20Files/Microsoft%20SharePoint%20Developer%20Tools%209.0/ssg%201.3/SPSolGen.exe
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.4506.2152 (SP.030729-0100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Serialization/3.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.ServiceModel
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.4506.2152 (SP.030729-0100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.ServiceModel/3.0.0.0__b77a5c561934e089/System.ServiceModel.dll
----------------------------------------
SMDiagnostics
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.4506.2152 (SP.030729-0100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/SMDiagnostics/3.0.0.0__b77a5c561934e089/SMDiagnostics.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Web
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
System.WorkflowServices
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.594.1152
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.WorkflowServices/3.5.0.0__31bf3856ad364e35/System.WorkflowServices.dll
----------------------------------------
System.ServiceModel.Web
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.594.1152
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.ServiceModel.Web/3.5.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll
----------------------------------------
Microsoft.VisualStudio.Diagnostics.ServiceModelSink
    Assembly Version: 3.0.0.0
    Win32 Version: 9.0.30729.1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Diagnostics.ServiceModelSink/3.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Diagnostics.ServiceModelSink.dll
----------------------------------------
System.IdentityModel
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.4506.2152 (SP.030729-0100)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.IdentityModel/3.0.0.0__b77a5c561934e089/System.IdentityModel.dll
----------------------------------------
Microsoft.SharePoint.Tools.Resources
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.4518.1092
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.Tools.Resources/12.0.0.0__5c284271f0d9907c/Microsoft.SharePoint.Tools.Resources.dll
----------------------------------------
Microsoft.SharePoint.Tools.FileResources
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.4518.1092
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.SharePoint.Tools.FileResources/12.0.0.0__5c284271f0d9907c/Microsoft.SharePoint.Tools.FileResources.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

The log file had this entry:

2009/02/22 14:13:08    Error
System.Data.SqlClient.SqlException: Cannot open database "WSS_Content_Portal" requested by the login. The login failed.
Login failed for user 'DEV-MOSS01\VSEWSS'.
   at Microsoft.SharePoint.Tools.Reflection.ReflectionUtility.InvokeMethod(MethodBase method, Object instance, Object[] parameters)
   at Microsoft.SharePoint.Tools.Reflection.ReflectionUtility.InvokeGetProperty(Type type, String propertyName, Object instance)
   at Microsoft.SharePoint.Tools.SharePointProxies.SPProxy.InvokeGetProperty(String name)
   at Microsoft.SharePoint.Tools.SharePointProxies.SPWebProxy.get_ID()
   at Microsoft.SharePoint.Tools.SharePointProxies.SPProxyUtility.GetWeb(SPSiteProxy site, String relativeUrl)
   at Microsoft.SharePoint.Tools.SharePointProxies.SPProxyUtility.GetWeb(String url)
   at Microsoft.SharePoint.Tools.SharePointProxies.SPListCollectionFacade.GetLists(String siteUrl)
   at VSeWSS.Server.Services.SPService.GetListCollectionLists(String siteUrl)

VSeWSS 1.2

I used RedGate Reflector to look at VSeWSS 1.2 to see how it reverse engineered and they were using RPC in the ExportListTemplate.

VSeWSS 1.3

I used RedGate Reflector again to look at VSeWSS 1.3 new WCF web service located at C:\Program Files\Microsoft SharePoint Developer Tools 9.0\svc\bin\ . There are four dlls: Microsoft.SharePoint.Tools.FileResources.dll, Microsoft.SharePoint.Tools.Resources.dll, VSeWSS.Server.Services.dll and VSeWSS.Server.SPProxies.dll.

The code appears to be the same as VSeWSS. I was in the Disassembled version of the ExportListTemplate method. I had a flick through here and it's just doing a lot of hacking at the schema file generated by the RPC method to get it to be compatible with a schema file in a wsp package (e.g. removing unsupported fields, tweaking the summary view, updating the content type references etc.).

Looking at the log entry again, it looks like its trying to use reflection to get at the Web object. I can't see any code that is calling off to System.Data.SqlClient but it's calling it and needs an account for it to work.

Are they breaking the rules?

So why is Solution Generator trying to access the SQL Database directly using this account rather than going through the API? Is there a limitation to the API that means you have to use the SQL Database directly? Isn't this breaking the main rule Microsoft have set with regards to Developing on top of SharePoint?

If these guys are breaking the rules...why won't the rest of the SharePoint Developer community? Be great to get some feedback on this?!?!

I've added this to the forum to make sure the team are aware of it. Any thoughts would be greatly appreciated!

UPDATE 24-Feb-2009

Paul Andrew kindly sent me an email explaining the reasoning behind this:

"You have to have local administrator permissions (and those others) for the SharePoint deployment API’s to succeed. This is required whether you use STSADM or the APIs. We chose not to add the permissions automatically to the WCF service, and hence you have to add them before it will work. This isn’t a change in VSeWSS 1.3, but is just a requirement of the SharePoint APIs."

Thanks again for Paul getting back so swiftly on this one.

 
Posted by  Jeremy Thake  on  2/21/2009
2  Comments  |  Trackback Url  | 0  Links to this post | Bookmark this post with:        
 

Links to this post

Comments


clayton  commented on  Sunday, February 22, 2009  4:50 AM 
Hi J
I am not sure if there is a limitation with the API but in relation to accessing SharePoint content databases directly.
From what I understand Microsoft has put forward this best practice due to the complexities of the database design and support issues. If you allowed direct access there could be issues with performance, data integrity, upgrades, etc...which could lead to many support requests.
Only allowing/recommending customers to use SharePoints API provides a common access point. This can be controlled. If direct database access was allowed then you lose this structured approach to accessing SharePoint content which could lead to an unsupportable product.
I don’t have a problem if a company accesses their own product via methods that aren’t available (or in SharePoint’s case recommended) to the public to maintain a structured/supportable approach.
In saying this...they show follow their own recommendations if practical and possible.
I am interested as to their reasons.
Clayton



Paul Andrew  commented on  Tuesday, May 05, 2009  9:19 AM 
Hi Jeremy,

I answered your specific blog question in more detail on your gforum post. Linked here: http://social.technet.microsoft.com/Forums/en-US/sharepointdevelopment/thread/9ff720b5-a9fe-4339-8215-ae723fd69427

Regards,
Paul

blog comments powered by Disqus