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

Error restoring watch when trying WatchMultipleProjects in samples #358

Closed
FlukeFan opened this issue Nov 12, 2017 · 2 comments
Closed

Error restoring watch when trying WatchMultipleProjects in samples #358

FlukeFan opened this issue Nov 12, 2017 · 2 comments
Assignees

Comments

@FlukeFan
Copy link

I am trying to watch multiple projects. An example repo is here: https://github.com/FlukeFan/WatchCustomProject

When I try to run dotnet watch ...

I get the error No executable found matching command "dotnet-watch"

I added the following to my .proj file:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>

Then I ran dotnet restore ...

I get the error error MSB4057: The target "Restore" does not exist in the project

I added the following line to my .proj file (taken from the WatchMultupleProjects sample):
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets"/>

Then I ran dotnet restore ...

Now I get the more cryptic error:
C:\Program Files\dotnet\sdk\2.0.2\NuGet.targets(102,5): error : Value cannot be null.\r [C:\work\scratch\dotnet\WatchCustomProject\Build\Build.proj] C:\Program Files\dotnet\sdk\2.0.2\NuGet.targets(102,5): error : Parameter name: key [C:\work\scratch\dotnet\WatchCustomProject\Build\Build.proj]

I tried cloning the DotNetTools repo, and ran dotnet restore watch.proj in the WatchMultipleProjects folder and got the same error.

Is this a bug? Or am I missing something?

@natemcmaster natemcmaster self-assigned this Nov 13, 2017
@natemcmaster
Copy link
Contributor

I updated the samples to work with the 2.0.0 SDK. NuGet made some changes to their internal targets that were causing the "Valeu cannot be null" error. 1cc289c

Give it a shot and let me know if it doesn't work. We can re-open if it doesn't.

Side note: this sample is sort of a hack until we can implement #319

@FlukeFan
Copy link
Author

Thanks, that seems to work perfectly.

IMHO, the ability to watch arbitrary targets in a custom msbuild file is a more flexible solution than #319.

(i.e., I prefer the custom build file, rather than a long (potentially, very long) command line of projects to watch)

Thanks again.

FlukeFan added a commit to FlukeFan/WatchCustomProject that referenced this issue Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants