Autodesk-Forge / forge-api-dotnet-design.automation

Forge Design Automation .NET SDK: Provides .NET SDK to help you easily integrate Forge Design Automation v3 REST APIs into the application
https://www.nuget.org/packages/Autodesk.Forge.DesignAutomation
Apache License 2.0
29 stars 14 forks source link

UpdateActivityAsync(activity, Constants.Activity.Label) is failing #9

Closed khilton2 closed 4 years ago

khilton2 commented 4 years ago

I've been using the same code for a while to post activities. It's suddenly failing and giving me the following error:

System.Net.Http.HttpRequestException: The server returned the non-success status code 400 (Bad Request). More error details: {"commandLine":["Invalid switch [$(appbundles[UpdateUserParameters].path)]. Variables that expand to paths must be quoted. (Parameter 'commandLine')"]}. at Autodesk.Forge.Core.HttpResponseMessageExtensions.EnsureSuccessStatusCodeAsync(HttpResponseMessage msg) at Autodesk.Forge.DesignAutomation.Http.ActivitiesApi.CreateActivityVersionAsync(String id, Activity item, String scopes, IDictionary`2 headers, Boolean throwOnError) at Autodesk.Forge.DesignAutomation.DesignAutomationClient.CreateActivityVersionAsync(String id, Activity item) at Autodesk.Forge.DesignAutomation.DesignAutomationClient.UpdateActivityAsync(Activity activity, String label) at Interaction.Publisher.PublishActivityAsync()

The inputs to the UpdateActivityAsync(activity, Constants.Activity.Label) function appear to be correct and have not changed.

The commandLine argument is:

private static List<string> GetActivityCommandLine()
{
    return new List<string> { $"$(engine.path)\\InventorCoreConsole.exe /al + $(appbundles[{Constants.Activity.Id}].path)" };
}
erymski commented 4 years ago

Hello,

The quotes are requirements now - as the error details said: "Variables that expand to paths must be quoted.". Please update the GetActivityCommandLine() method. More details can be found in this blog entry:

Starting October 1st, Design Automation will enforce the quotes for start model (args[].path) and appbundle (appbundles[].path) parameters.

https://forge.autodesk.com/blog/design-automation-command-line