开发者

How do you integrate custom providers into the Microsoft Web Deployment Tool? [closed]

开发者 https://www.devze.com 2023-01-23 05:48 出处:网络
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.

This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.

Closed 5 years ago.

Improve this question

I am trying to extend the Microsoft Web Deployment tool and MSDeploy with a custom provider because I want to run custom ta开发者_开发问答sks on the destination deployment machine as part of the process. The general documentation is pretty good outside of custom provider development, but the documentation for doing any sort of extension seems to be non-existent towards abysmal.

I've been researching this for several days now and have found some bits and pieces that have allowed me to get pretty far into the process without any real documentation. I've almost hacked my way through the process but now I have one final problem: MSDeploy will not recognize my custom provider.

I have created two classes one that extends Microsoft.Web.Deployment.DeploymentProviderFactory (which has both the Name and FriendlyName properties overriden to the name of my custom provider "archimedes"); the other extends Microsoft.Web.Deployment.DeploymentObjectProvider which also has an overriden Name property "archimedes". I did this by following the custom BatchProvider example you can find online. It looks like this:

ArchimedesProviderFactory (which extends DeploymentProviderFactory and has the Deployment ProviderFactory attribute assigned to the class):

public override string FriendlyName
{
    get { return "archimedes"; }
}

public override string Name
{
    get { return "archimedes"; }
}

The ArchimedesProvider class extends DeploymentObjectProvider and has this:

public override string Name
{
    get { return "archimedes"; }
}

In my sourcemanifest.xml file I have it added an entry:

<archimedes path="..." />

I have placed the assembly file that contains those classes in %program files%\IIS\Microsoft Web Deploy\Extensibility as I was directed too by the material I found online.

The funny thing is that during the build of a package in Visual Studio 2010, my providers are having code called on them from that directory - so VS is definitely connecting to my assembly placed in there somehow (for example I can throw exceptions and see that they were thrown during the process of building a package).

However during actual test deployment of the package from the generated .cmd file, I get an error that the factory for provider "archimedes" cannot be found. Also typing:

MSDeply -verb:dump -source:archimedes -debug

Returns the following:

    Microsoft.Web.Deployment.DeploymentException: Unknown factory 'archimedes'.
   at Microsoft.Web.Deployment.DeploymentProviderSettingCollection..ctor(String factoryName)
   at Microsoft.Web.Deployment.DeploymentProviderOptions..ctor(String factoryName)
   at MSDeploy.MSDeploy.GetObjectParameters(Dictionary`2 parameters, Boolean isDestination, DeploymentBaseOptions& retbaseOptions, DeploymentProviderOptions& re
tproviderOptions)
   at MSDeploy.MSDeploy.ExecuteWorker()
   at MSDeploy.MSDeploy.Execute()
   at MSDeploy.MSDeploy.Main(String[] unusedArgs)
Error count: 1.

So besides the fact that there appears to be no coherent, central source of documentation for custom provider development (does anyone know of a place, please do tell if you found one), my main problem is that for some reason Visual Studio will see and call my provider factory from the assembly file I dumped into the Extensibility folder, but the actual msdeploy/webdeploy does not see it. Does anyone have any ideas?

Thanks a ton...


OK, this was a simple mistake, although a non-obvious one since the package building portion accessed the code alright and called it from my provider assembly. The problem was that since just about everything in the web application targets the 4.0 framework the class library project I added with the custom provider code did as well. I had to set the target framework to 2.0 and it all started working. None of the error reporting was overly obvious.

0

精彩评论

暂无评论...
验证码 换一张
取 消