Skip to content
This repository has been archived by the owner on Jul 6, 2020. It is now read-only.

Commit

Permalink
Fixed the application crash on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Mar 22, 2015
1 parent 8aa1e3a commit f7b751f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DNTProfiler.MetaData/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#endif

// Assembly Versions are incremented manually when branching the code for a release.
[assembly: AssemblyVersion("1.0.808.0")]
[assembly: AssemblyVersion("1.0.810.0")]
// Assembly File Version should be incremented automatically as part of the build process.
[assembly: AssemblyFileVersion("1.0.808.0")]
[assembly: AssemblyFileVersion("1.0.810.0")]

4 changes: 3 additions & 1 deletion DNTProfiler/DNTProfiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Net.Http.2.2.29\lib\net40\System.Net.Http.Primitives.dll</HintPath>
Expand Down
13 changes: 10 additions & 3 deletions Plugins/DNTProfiler.Dumper/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class MainViewModel : MainViewModelBase
private readonly string _settingsPath = Path.Combine(AppMessenger.ExecutablePathDir, "Plugins", "DNTProfiler.Dumper.json");
private DirectoryMonitor _directoryMonitor;
private JsonLogger _jsonLogger;

public MainViewModel(ProfilerPluginBase pluginContext)
: base(pluginContext)
{
Expand All @@ -48,6 +49,12 @@ public MainViewModel(ProfilerPluginBase pluginContext)

public MainGuiModel ThisGuiModelData { set; get; }

private void createDumperDirectory()
{
if (!Directory.Exists(ThisGuiModelData.DumperSettings.DumperDirectory))
Directory.CreateDirectory(ThisGuiModelData.DumperSettings.DumperDirectory);
}

private void disposeLogger()
{
if (_jsonLogger != null)
Expand Down Expand Up @@ -200,6 +207,8 @@ private void setDirectoryMonitor()
if (_directoryMonitor != null)
_directoryMonitor.Dispose();

createDumperDirectory();

_directoryMonitor = new DirectoryMonitor(ThisGuiModelData.DumperSettings.DumperDirectory, "*.json")
{
OnFileSystemChanged = file =>
Expand All @@ -219,9 +228,7 @@ private void setEvenets()

private void showFilesList()
{
if (!Directory.Exists(ThisGuiModelData.DumperSettings.DumperDirectory))
Directory.CreateDirectory(ThisGuiModelData.DumperSettings.DumperDirectory);

createDumperDirectory();
var files = new DirectoryInfo(ThisGuiModelData.DumperSettings.DumperDirectory).GetFiles("*.json").OrderByDescending(x => x.LastWriteTime);
ThisGuiModelData.Files = new ObservableCollection<FileInfo>(files);

Expand Down

0 comments on commit f7b751f

Please sign in to comment.