none
Not able to debug server controller for custom resource provider Admin Extension in Windows azure pack

    Question

  • Hi,

      im able deploy and debug the sample resource provider(Hello World) which was given in this link

    http://blogs.technet.com/b/privatecloud/archive/2014/02/11/custom-resource-providers-in-windows-azure-pack-deploying-the-hello-world-sample.aspx

    but i created my own resource provider and deploy it im unable to debug server controller method GetAdminSettings

    or any method in Admin Extension project breakpoint is not getting hitted getting the below error.

    ‎4‎:‎38‎:‎23‎ ‎PM: Failure: Ajax call to: /CmpWapExtensionAdmin/AdminSettings?ts=1406849902661. failed with status: error (404) in 0.349 seconds. x-ms-client-request-id was: 67267f73-004c-4bcd-a887-52515b3f73d3-2014-07-31 23:38:22Z. Response: "System.Web.HttpException (0x80004005): The controller for path \u0027/CmpWapExtensionAdmin/AdminSettings\u0027 was not found or does not implement IController.\r\n at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)\r\n at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)\r\n at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController\u0026 controller, IControllerFactory\u0026 factory)\r\n at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)\r\n at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean\u0026 completedSynchronously)"

    when i tried using fiddler i got the below message...

    HTTP/1.1 404 Not Found
    Content-Type: application/json; charset=utf-8
    Server: Microsoft-IIS/8.5
    x-build-version: 3.14.8196.32 (rd_auxsmp_stable_v2_gdr.140416-1654)
    x-config-version: Dojbdzw/
    X-Content-Type-Options: nosniff
    Strict-Transport-Security: max-age=2592000; includeSubDomains
    X-AspNetMvc-Version: 4.0
    X-Powered-By: ASP.NET
    Date: Thu, 31 Jul 2014 23:46:53 GMT
    Content-Length: 893

    "System.Web.HttpException (0x80004005): The controller for path \u0027/CmpWapExtensionAdmin/AdminSettings\u0027 was not found or does not implement IController.\r\n   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)\r\n   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)\r\n   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController\u0026 controller, IControllerFactory\u0026 factory)\r\n   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)\r\n   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()\r\n   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean\u0026 completedSynchronously)"

    Please help regarding the same...



    • Edited by shiv455 Thursday, July 31, 2014 11:52 PM
    Thursday, July 31, 2014 11:48 PM

Answers

  • Looked at this. Issue was mainly because of the MVC version mismatch. We did recompile the admin extension against MVC 4 and it started working.
    • Proposed as answer by Manesh Raveendran Tuesday, August 19, 2014 11:17 PM
    • Marked as answer by shiv455 Tuesday, September 9, 2014 9:18 PM
    Tuesday, August 19, 2014 11:17 PM

All replies

  • There is a recent July release of WAP samples. If you are not using the latest, it may be good to use that.

    I am also working on building a custom resource provider. I am planning to share it so that it will be useful for others as well.

    Did you refer http://blogs.technet.com/b/privatecloud/archive/2014/04/23/custom-resource-providers-in-windows-azure-pack-moving-from-hello-world-to-your-own-resource-provider.aspx ?

    Saturday, August 9, 2014 6:25 AM
  • I got a new custom resource provider to work. I implemented only the admin extension. I uploaded the code to Git. https://github.com/terawe/WindowsAzurePack/tree/master/StorageSample

    In my sample, the settings request is going to '/StorageSampleAdmin/AdminSettings?ts=1407784582627' in https://server.fqdn:30091/ (which is the admin site).In my case controller class name is StorageSampleAdminController (Note: based on the sample term 'extension' is not in the controller class name).

    What is the name of your controller? Ideally based on the request, your controller class should be CmpWapExtensionAdminController. Can you cross check if that is the case and if admin extensino DLL is available under C:\inetpub\MgmtSvc-AdminSite\bin


    Monday, August 11, 2014 7:19 PM
  • Hi manesh,

                    yes the controller name is CmpWapExtensionAdminController only and i have the adminextension dll in C:\inetpub\MgmtSvc-AdminSite\bin ..still im facing the issue mentioned above :(

    Wednesday, August 13, 2014 7:18 PM
  • im able to see the below error as well in the eventvwr..

    Could not connect to Resource Provider. Error: Resource not found.

    under Operational logs under MgmtSvc-AdminSite 

    Wednesday, August 13, 2014 9:58 PM
  • Okay. This is what I have done to debug code on my WAP development machine.

    • Build project form Visual Studio
    • Bopy the dll and pdb files to MgmtSvc-AdminSite\bin (Make sure you copy any dependency files as well, for example I had to copy HelloWorld.Samples.dll as it had many contracts etc.)
    • Launch admin portal
    • Attach to process from VS debug, and attach AdminSite w3wp process

    You should ideally get breakpoint enabled on your controller.

    Note: Ensure that you copy all required DLL files also to the bin folder.

    Let me know if this works, or else I can see if we can meet on Skype or so and I could take a quick look at your problem.

    Thursday, August 14, 2014 9:31 PM
  • Looked at this. Issue was mainly because of the MVC version mismatch. We did recompile the admin extension against MVC 4 and it started working.
    • Proposed as answer by Manesh Raveendran Tuesday, August 19, 2014 11:17 PM
    • Marked as answer by shiv455 Tuesday, September 9, 2014 9:18 PM
    Tuesday, August 19, 2014 11:17 PM
  • Thanks manesh that really helped to fix the issue

    Wednesday, August 20, 2014 12:01 AM