Skip to content

CSharp template generates SDK requiring access to temp folder that raise exception when environment has restricted access. #4748

@bunnyc1986

Description

@bunnyc1986
Description

The C# SDK generated from the template requires system permission to get the temp folder. However some hosting environment doesn't grant permission to access system folders. That makes the ApiClient initialization fails.

Swagger-codegen version

latest.

Related issues

square/connect-csharp-sdk#5

Suggest a Fix

Two options here:

  1. Let caller handle the Steam instead of saving it in temp folder. So the SDK doesn't need to obtain the temp folder path. (Preferred)
  2. Still save the Stream, but only obtain the temp folder path inside the Deserialize when it's needed. This is actually just a small change: set _templateFolderPath in Configuration to be null instead of Path.GetTempPath() on line 237

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions