Hi,
I'm trying to build a custom provider for executing commandLine or PowerShell commands and are running into problems during my initial testing. I have build an empty provider based on the mySQL example that do nothing but I can't get it to execute. I get the error:
Unknown factory 'commmandLine'
I have put the assembly in the using:
gacutil /if MSDeploy.dll /f
I have registered it in the registry using:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\1\Providers\commandLine" /v type /t REG_SZ /d "Concordia.Tools.MSDeploy.CommandLineProviderFactory, MSDeploy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58d853ef4d7b79b5"
When i run MSDeploy in the command window the provider is listed but when I run:
msdeploy -verb:sync -source:commmandLine="Test" -dest:commandLine="Test"
It fails with:
Unknown factory 'commmandLine'
Any thoughts?
code:
Imports Microsoft.Web.Deployment
Public Class CommandLineProvider
Inherits DeploymentObjectProvider
Protected Const providerName As String = "commandLine"
Protected Const keyAttributeName As String = "path"Public Sub New(ByVal providerContext As DeploymentProviderContext, ByVal baseContext As DeploymentBaseContext)
MyBase.New(providerContext, baseContext)
End Sub
Public Overrides ReadOnly Property Name() As String
GetReturn providerName
End Get
End Property
Private ReadOnly Property Path() As String
GetReturn Me.ProviderContext.Path
End Get
End PropertyPublic Overrides Function CreateKeyAttribute() As Microsoft.Web.Deployment.DeploymentAttribute
Return New DeploymentAttribute(keyAttributeName, Me.Path, DeploymentAttributeFlags.InsensitiveCompare)
End FunctionPublic Overrides Sub Add(ByVal source As Microsoft.Web.Deployment.DeploymentObject, ByVal whatIf As Boolean)
If whatIf Then
ReturnEnd If
End Sub
End Class
Public
Class CommandLineProviderFactoryInherits DeploymentProviderFactory
Public Overrides Function CreateProvider(ByVal providerContext As DeploymentProviderContext, ByVal baseContext As DeploymentBaseContext) As DeploymentObjectProviderReturn New CommandLineProvider(providerContext, baseContext)
End Function
Public Overrides ReadOnly Property Description() As String
Get
Return "CommandLine custom provider"
End Get
End Property
Public Overrides ReadOnly Property ExamplePath() As String
Get
Return "Test"
End Get
End PropertyPublic Overrides Function GetSupportedSettings() As DeploymentProviderSettingInfo()
Return New DeploymentProviderSettingInfo() {New CommandLinePath()}
End Function
Public Overrides ReadOnly Property FriendlyName() As String
Get
Return "commandLine"
End GetEnd Property
End
ClassPublic Class CommandLinePath
Inherits DeploymentProviderSettingInfoPublic Sub New()
End Sub
Public Overrides ReadOnly Property Name() As String
Get
Return "commandLinePath"
End Get
End Property
Public Overrides ReadOnly Property Description() As String
Get
Return "Description"
End Get
End PropertyPublic Overrides ReadOnly Property Type() As Type
GetReturn GetType(String)
End Get
End PropertyPublic Overrides Sub Validate(ByVal value As Object)
End Sub
Public Overrides ReadOnly Property FriendlyName() As String
Get
Return "commandLinePath"
End GetEnd Property
End
Class