Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jason Espin 368 posts 1335 karma points
    Apr 08, 2017 @ 15:32
    Jason Espin
    0

    Model builder api unable to communicate with server

    Hi all,

    I am trying to get to grips with the ModelsBuilder in Umbraco but it seems very flaky at best.

    I have a version of my website on my local IIS and I am trying to connect to this via a file in my .core project but I keep getting the following errors:

    UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.ValidateClientVersion() at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg) UmbracoModelsBuilder: Starting v3.0.6.97 08/04/2017 16:23:11. UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Forbidden) "API server does not want to talk to you." UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.ValidateClientVersion() at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg) UmbracoModelsBuilder: Starting v3.0.6.97 08/04/2017 16:23:38. UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Forbidden) "API server does not want to talk to you." UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.ValidateClientVersion() at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg) UmbracoModelsBuilder: Starting v3.0.6.97 08/04/2017 16:27:30. UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Forbidden) "API server does not want to talk to you." UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.ValidateClientVersion() at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg) UmbracoModelsBuilder: Starting v3.0.6.97 08/04/2017 16:29:12. UmbracoModelsBuilder: UmbracoModelsBuilder failed to generate code: Exception: Response status code does not indicate success (Forbidden) "API server does not want to talk to you." UmbracoModelsBuilder: at Umbraco.ModelsBuilder.Api.ApiClient.EnsureSuccess(HttpResponseMessage result) at Umbraco.ModelsBuilder.Api.ApiClient.ValidateClientVersion() at Umbraco.ModelsBuilder.CustomTool.CustomTool.UmbracoModelsBuilder.GenerateRaw(String wszInputFilePath, String wszDefaultNamespace, IntPtr[] rgbOutputFileContents, UInt32& pcbOutput, String& errMsg)

    Any ideas on how to resolve these?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Apr 09, 2017 @ 06:38
    Dave Woestenborghs
    4

    Hi Jason,

    Do you have the ModelbsBuilder API installed in your web project ?

    If so, can you check your web.config for following settings :

    <add key="Umbraco.ModelsBuilder.Enable" value="true" />
    <add key="Umbraco.ModelsBuilder.EnableApi" value="true" />
    <add key="Umbraco.ModelsBuilder.ModelsMode" value="Nothing" />
    

    I also believe that the debug attribute on the compilation tag should be set to true.

    Dave

  • pbl_dk 150 posts 551 karma points
    Apr 21, 2017 @ 16:44
    pbl_dk
    1

    Same problem. Using posted code and setting debug to true in webconfig solved it.

  • Emma Garland 41 posts 123 karma points MVP 7x c-trib
    Mar 03, 2018 @ 18:52
    Emma Garland
    2

    Ahh thanks, you're right, it needs debug mode set to true. I always forget to do this and have to revisit this page everytime I start a new build!

    In case anyone is wondering, hit F5 from Visual Studio to debug the website the first time you run it like this, and Enable Debugging and it will edit it for you...then stop the site and rerun ModelsBuilder.

    Or in your

    <compilation defaultLanguage="c#" debug="true" batch="false" targetFramework="4.5" numRecompilesBeforeAppRestart="50">
    
Please Sign in or register to post replies

Write your reply to:

Draft