Skip to content

Commit 281406d

Browse files
committed
Create mg directory on module initialization.
1 parent 5ec8f8e commit 281406d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/Authentication/Authentication.Test/Helpers/AuthenticationHelpersTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public AuthenticationHelpersTests()
2424
{
2525
GraphSession.Initialize(() => new GraphSession());
2626
GraphSession.Instance.InMemoryTokenCache = new InMemoryTokenCache();
27+
GraphSession.Instance.GraphOption = new GraphOption();
2728
mockAuthRecord = new MockAuthRecord("test");
2829
mockAuthRecord.SerializeToFile();
2930
}

src/Authentication/Authentication/Common/GraphSessionInitializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public static void InitializeSession()
2929
internal static GraphSession CreateInstance(IDataStore dataStore = null)
3030
{
3131
IGraphOption graphOptions = null;
32+
// Try to create directory if it doesn't exist.
33+
Directory.CreateDirectory(Core.Constants.GraphDirectoryPath);
3234
if (File.Exists(Constants.GraphOptionsFilePath))
3335
{
3436
// Deserialize the JSON into the GraphOption instance

0 commit comments

Comments
 (0)