Skip to content

Commit

Permalink
quick fix for new appsettings.json creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kvikku committed Feb 13, 2024
1 parent 0719247 commit da2fb59
Show file tree
Hide file tree
Showing 23 changed files with 18 additions and 27 deletions.
Binary file modified .vs/IntuneAssignments/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/IntuneAssignments/v17/.futdcache.v2
Binary file not shown.
Binary file modified .vs/IntuneAssignments/v17/.suo
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/intuneassignments.metadata.v7.bin
Binary file not shown.
Binary file modified .vs/ProjectEvaluation/intuneassignments.projects.v7.bin
Binary file not shown.
5 changes: 2 additions & 3 deletions AppSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"Entra": {
"TenantId": "",
"ClientId": "",
"ClientSecret": ""
"ClientId": ""
}
}
}
18 changes: 9 additions & 9 deletions HomePage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,20 +144,20 @@ private void createPrimaryLogFile()
// release the file
}

private void createAppSettingsFile()
private async void createAppSettingsFile()
{
if (!System.IO.File.Exists(appSettingsFile))
{
using (FileStream fs = File.Create(appSettingsFile))
{
// Do nothing
WriteToLog("The configuration file is missing. It may have been deleted or it is the first time the app is running on the system");
WriteToLog("Creating the configuration file");

// copy file from the appsettings.json file in the project to the configuration folder
string sourceFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AppSettings.json");
string destinationDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "IntuneAssignments");
string destinationFilePath = Path.Combine(destinationDirectory, "AppSettings.json");
File.Copy(sourceFile, appSettingsFile, false); // The 'true' argument allows overwriting if the file already exists


// FIX CREATION OF THE FILE WITH JSON CONTENT

}


}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void saveSettings()

// Save the new settings to appsettings.json

string originalPath = AppSettingsFile;
string originalPath = appSettingsFile;

IConfigurationRoot configuration = new ConfigurationBuilder()
.AddJsonFile(originalPath)
Expand Down
7 changes: 0 additions & 7 deletions bin/Debug/net6.0-windows10.0.22621.0/AppSettings.json

This file was deleted.

5 changes: 2 additions & 3 deletions bin/Release/net6.0-windows10.0.22621.0/AppSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"Entra": {
"TenantId": "",
"ClientId": "",
"ClientSecret": ""
"ClientId": ""
}
}
}
Binary file modified bin/Release/net6.0-windows10.0.22621.0/IntuneAssignments.dll
Binary file not shown.
Binary file modified bin/Release/net6.0-windows10.0.22621.0/IntuneAssignments.exe
Binary file not shown.
Binary file modified bin/Release/net6.0-windows10.0.22621.0/IntuneAssignments.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[assembly: System.Reflection.AssemblyCompanyAttribute("IntuneAssignments")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+89ab2f619c87447a795b9232eeef26fc0885f8b7")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+07192477fe826ab03279865a39f04b733b0458d5")]
[assembly: System.Reflection.AssemblyProductAttribute("IntuneAssignments")]
[assembly: System.Reflection.AssemblyTitleAttribute("IntuneAssignments")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ac4dfce9013c563f70f78831f8dc195c70481709cf35e50faed809d5427263b1
dd9293017b440d37fab2dc7d39d9e8d062ddc5ac7caa2edc77d209a5cba10b3c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\IntuneAssignments.exe
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\AppSettings.json
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\IntuneAssignments.deps.json
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\IntuneAssignments.runtimeconfig.json
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\IntuneAssignments.dll
Expand Down Expand Up @@ -74,3 +73,4 @@ C:\Github\IntuneAssignments\obj\Release\net6.0-windows10.0.22621.0\refint\Intune
C:\Github\IntuneAssignments\obj\Release\net6.0-windows10.0.22621.0\IntuneAssignments.pdb
C:\Github\IntuneAssignments\obj\Release\net6.0-windows10.0.22621.0\IntuneAssignments.genruntimeconfig.cache
C:\Github\IntuneAssignments\obj\Release\net6.0-windows10.0.22621.0\ref\IntuneAssignments.dll
C:\Github\IntuneAssignments\bin\Release\net6.0-windows10.0.22621.0\AppSettings.json
Binary file modified obj/Release/net6.0-windows10.0.22621.0/IntuneAssignments.dll
Binary file not shown.
Binary file modified obj/Release/net6.0-windows10.0.22621.0/IntuneAssignments.pdb
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documents":{"C:\\Github\\IntuneAssignments\\*":"https://raw.githubusercontent.com/Kvikku/IntuneAssignments/89ab2f619c87447a795b9232eeef26fc0885f8b7/*"}}
{"documents":{"C:\\Github\\IntuneAssignments\\*":"https://raw.githubusercontent.com/Kvikku/IntuneAssignments/07192477fe826ab03279865a39f04b733b0458d5/*"}}
Binary file not shown.
Binary file modified obj/Release/net6.0-windows10.0.22621.0/apphost.exe
Binary file not shown.
Binary file modified obj/Release/net6.0-windows10.0.22621.0/ref/IntuneAssignments.dll
Binary file not shown.
Binary file not shown.

0 comments on commit da2fb59

Please sign in to comment.