- Fix a NullRef exception that was happening when projects have resx files
- Print the changed file name in all cases
This commit is contained in:
parent
c769d8dee9
commit
ed91ba0c2f
|
|
@ -93,6 +93,7 @@ namespace Microsoft.DotNet.Watcher.Core
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
string changedFile;
|
||||||
if (finishedTaskIndex == 0)
|
if (finishedTaskIndex == 0)
|
||||||
{
|
{
|
||||||
// This is the dotnet task
|
// This is the dotnet task
|
||||||
|
|
@ -109,13 +110,17 @@ namespace Microsoft.DotNet.Watcher.Core
|
||||||
|
|
||||||
_logger.LogInformation("Waiting for a file to change before restarting dotnet...");
|
_logger.LogInformation("Waiting for a file to change before restarting dotnet...");
|
||||||
// Now wait for a file to change before restarting dotnet
|
// Now wait for a file to change before restarting dotnet
|
||||||
await WaitForProjectFileToChangeAsync(projectFile, cancellationToken);
|
changedFile = await WaitForProjectFileToChangeAsync(projectFile, cancellationToken);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This is a file watcher task
|
// This is a file watcher task
|
||||||
string changedFile = fileWatchingTask.Result;
|
changedFile = fileWatchingTask.Result;
|
||||||
_logger.LogInformation($"File changed: {fileWatchingTask.Result}");
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(changedFile))
|
||||||
|
{
|
||||||
|
_logger.LogInformation($"File changed: {changedFile}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,8 @@ namespace Microsoft.DotNet.Watcher.Core.Internal
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
filesToWatch.AddRange(runtimeProject.Files.ResourceFiles.Values);
|
// For resource files the key is the name of the file, not the value
|
||||||
|
filesToWatch.AddRange(runtimeProject.Files.ResourceFiles.Keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
filesToWatch.AddRange(runtimeProject.Files.SharedFiles);
|
filesToWatch.AddRange(runtimeProject.Files.SharedFiles);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue