I have installed and configured MS WebDeploy 2.0 on a (test) server so that WebMatrix and Visual Studio 2010 users can use this to upload their applications to our Windows 2008R2 environments.
This works well with WebMatrix but I encountered a problem deploying an application from Visual Studio 2010. If I click publish and use the WebDeploy method, Visual Studio reports an error and nothing gets published:
So I turned on Failed Request Tracing for the Web Management Service and I see this:
53 AspNetModuleDiagErrorEvent Uri /MsDeploy.axd eventData Tracing deployment agent exception. Request ID ''. Request Timestamp: '01/22/2011 00:18:54'. Error Details: System.UnauthorizedAccessException: Access to the path 'd:\' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.DriveInfo.get_DriveFormat()
To facilitate use of the WebDeploy feature the site's delegated management user is granted Full Control of a site's web folders. This is covered in this article:
Configure the Web Deploy Component on the Web Server
No other permissions are mentioned. Given the nature of the error I tried giving the site's delegated management user Read Attribut开发者_如何学Pythone
permission on D:\
and limited it to This Folder Only
and immediately Visual Studio 2010 is able to publish the application using WebDeploy.
Do I really need to assign read permissions to the root of the drive where a website is hosted to get Web Deploy 2.0 to work with Visual Studio 2010?
This is a bug with Visual Studio 2010 which defaults to using the wrong Microsoft.Web.Deployment
assembly (7.1.0.0
).
To overcome this issue an edit needs to be made to VS 2010's configuration file to force it to use 8.0.0.0
:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
<dependentAssembly>
<assemblyIdentity
name="Microsoft.Web.Deployment"
publicKeyToken="31bf3856ad364e35"
culture="neutral"/>
<bindingRedirect
oldVersion="7.1.0.0"
newVersion="8.0.0.0"/>
</dependentAssembly>
The xml fragment above should be added to:
/configuration/runTime/assemblyBinding
This was confirmed with Microsoft's PSS group. Apparently Visual Studio 2010 SP1 will address this issue.
Obviously you need MS WebDeploy 2.0 installed on the deployment computer. This can be obtained via the Web Platform Installer or by installing Web Matrix 1.0 RTM which incidentally does the right thing.
精彩评论