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.