You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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);
The text was updated successfully, but these errors were encountered: