SharpeRAD / Cake.IIS

IIS addin for Cake
http://cakebuild.net
MIT License
52 stars 28 forks source link

StopPool with remote location throws null exception #53

Open punkster91 opened 6 years ago

punkster91 commented 6 years ago

Cake version = 0.30.0 Cake.IIS version = 0.4.1

When specifying a remote location for these functions I get a null exception. DeletePool("127.0.0.1", "Test") - Fail StopPool("localhost", "Test") - Fail

The functions work if you don't use the remote-location at all. DeletePool( "Test") - Success StopPool("Test") - Success

Error:

Error: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.Web.Administration.ConfigurationManager.CreateWritableAdminManager(WebConfigurationMap webConfigMap, String configPathToEdit, Boolean isAdminConfig, Boolean isRedirectionConfig)
   at Microsoft.Web.Administration.ConfigurationManager.CreateConfiguration(WebConfigurationMap configMap, String configPathToEdit, Boolean isAdminConfig, Boolean isRedirectionConfig)
   at Microsoft.Web.Administration.ConfigurationManager.GetConfiguration(String rawConfigurationPath, String cacheKey, Boolean isAdminConfig, Boolean isRedirectionConfig)
   at Microsoft.Web.Administration.ConfigurationManager.GetApplicationHostConfiguration()
   at Microsoft.Web.Administration.ServerManager.ApplicationPoolsSectionCreator()
   at Microsoft.Web.Administration.Lazy.Initialize[T](T& target, CreateInstanceDelegate`1 valueFactory)
   at Microsoft.Web.Administration.ServerManager.ApplicationPoolCollectionCreator()
   at Microsoft.Web.Administration.Lazy.Initialize[T](T& target, CreateInstanceDelegate`1 valueFactory)
   at Cake.IIS.ApplicationPoolManager.Stop(String name)
   at Cake.IIS.ApplicationPoolAliases.StopPool(ICakeContext context, String server, String name)
   at Submission#0.StopPool(String server, String name)
   at Submission#0.<<Initialize>>b__0_1()

I had to downgrade to these versions to use the remote-location successfully Cake version = 0.22.0 Cake.IIS version = 0.3.1

pitermarx commented 6 years ago

same here

pitermarx commented 6 years ago

from here it seems that the IIS nuget package is not compatible with remote usage.

I think the NuGet package was only released for IIS Administration REST API, https://github.com/Microsoft/IIS.Administration Thus, the NuGet version is internally different from the version shipped with Windows.

Geolle commented 5 years ago

I came into this problem too! Can anybody help us with this, this is painful TAT

nrukavkov commented 4 years ago

The same problem. Does anybody know how to fix it?