Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

dotnet watch stops to work when having a resource (resx) file in the project #139

Closed
WGroenestein opened this issue Jul 15, 2016 · 12 comments

Comments

@WGroenestein
Copy link

Functional impact

Can't use dotnet watch, instead have to manual dotnet run on change

Minimal repro steps

  1. File => New Project => .NET Core => ASP.Net Core Web Application (.NET Core) => Web Application
  2. Add folder "Resources"
  3. Create new resource file in the create folder (e.g. Strings.resx)
  4. Add dotnet watch (1.0.0-preview2-final) to tools in project.json
  5. Run dotnet restore
  6. Run dotnet watch run

Expected result

dotnet watch working when having 1 or multiple resource files in the project.

Actual result

[DotNetWatcher] info: Running dotnet with the following arguments: run
[DotNetWatcher] info: dotnet process id: 1992
Unhandled Exception: System.AggregateException: One or more errors occurred. (One or more errors occurred. (Object reference not set to an instance of an object.)) ---> System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.DotNet.Watcher.Core.Internal.FileWatcher.<>c__DisplayClass7_0.<AddDirectoryWatcher>b__0(KeyValuePair`2 d)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at Microsoft.DotNet.Watcher.Core.Internal.FileWatcher.AddDirectoryWatcher(String directory)
   at Microsoft.DotNet.Watcher.Core.Internal.ProjectWatcher.<WaitForChangeAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.DotNet.Watcher.Core.DotNetWatcher.<WaitForProjectFileToChangeAsync>d__7.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.DotNet.Watcher.Core.DotNetWatcher.<WatchAsync>d__6.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Microsoft.DotNet.Watcher.Tools.Program.<>c__DisplayClass3_0.<MainInternal>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.DotNet.Watcher.Tools.Program.MainInternal(String[] args, CancellationToken cancellationToken)
   at Microsoft.DotNet.Watcher.Tools.Program.Main(String[] args)

Further technical details

  • VS2015 Community Update 3
  • .NET Core 1.0.0 VS 2015 Tooling Preview 2
  • Windows 10 home x64
@victorhurdugaci
Copy link
Contributor

Thanks for reporting this. I can reproduce it.
Expect a fix soon.

@Knaackee
Copy link

Still having this problem.

  "tools": {
    "Microsoft.DotNet.Watcher.Tools": "1.0.0-*"
  },

Any ideas?

@victorhurdugaci
Copy link
Contributor

The fix is in 1.1.0. Unfortunately, 1.0.0 will always have that problem.

@victorhurdugaci
Copy link
Contributor

cc @natemcmaster

@Knaackee
Copy link

Thanks! I suggest updating the readme. ;)

@Knaackee
Copy link

This isn't yet available on NuGet, right?

@victorhurdugaci
Copy link
Contributor

It's on the nightly feed (myget/aspnetvnext)

@Knaackee
Copy link

I am really sorry but I can't find the right feed. Could you please post the feed URL on where I can find dotnet watch 1.1.0.

@natemcmaster
Copy link
Contributor

The latest versions are 1.0.0-preview3-*, not 1.1.0-*. The feeds are explained in https://github.com/aspnet/Home/wiki/NuGet-feeds.

@qbikez
Copy link

qbikez commented Oct 14, 2016

Microsoft.DotNet.Watcher.Tools.1.0.0-preview3-22398 depends on Microsoft.NETCore.App.1.1.0-preview1-001100-00. It seems to install it into packages dir, but then when running dotnet watch run, I get:

The specified framework 'Microsoft.NETCore.App', version '1.1.0-preview1-001100-00' was not found.

  • Check application dependencies and target a framework version installed at:
  • Alternatively, install the framework version '1.1.0-preview1-001100-00'.

How can I obtain this newer versions of SDK? I tried to use install script from https://github.com/dotnet/cli/tree/rel/1.0.0/scripts/obtain, but it cannot find this specific version.

@natemcmaster
Copy link
Contributor

@qbikez prerelease builds require a prerelease installation of the shared framework, which goes in %DOTNET_HOME/shared/Microsoft.NETCore.App directory. Installation of the nupkg isn't enough. Yes, this is confusing, and yes it is hard to get the 1.1.0 runtime preview right now. Slightly intentional as there are some big changes pending. To get the 1.1.0 shared fx, use the args: dotnet-install.ps1 -Channel release/1.1.0 -SharedRuntime -Version 1.1.0-preview1-001100-00. cref https://github.com/aspnet/KoreBuild/blob/142539693e5d9eb944e3be4a2b47921feb9b326b/build/KoreBuild.ps1#L58

@qbikez
Copy link

qbikez commented Oct 15, 2016

@natemcmaster thanks, that's what I was looking for.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants