Skip to content

SupportedMediaTypes.json Location #25

@wjvii

Description

@wjvii

In issue #23 it mentions that it uses an embedded version of this file in the assembly but in the code in Documents.cs it also look like if there is not a file on disk it tries to write it out to disk.

`var assembly = Assembly.GetAssembly(typeof(Documents));
var assemblyPath = Path.GetDirectoryName(assembly.Location);
var typesFile = Path.Combine(assemblyPath, "SupportedMediaTypes.json");

if (!File.Exists(typesFile))
{
// unpack the types file to the assembly path
using (var resource = assembly.GetManifestResourceStream("InterFAX.Api.SupportedMediaTypes.json"))
{
using (var file = new FileStream(typesFile, FileMode.Create, FileAccess.Write))
{
resource.CopyTo(file);
}
}
}`

This is a problem I am encountering because it is trying to write the file into the same folder as that the assembly is located in, which if often protected from writing and which with a Store applications it cannot do.

Would it be possible to have a property that is set to define where to write this file and any other files it needs? I have seen other products that define something like "ReferencePath" so that we can define where this is written or I believe this location will work properly for most desktop scenarios, Store and non-Store, although I am not sure about web.

Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions