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

Commit

Permalink
Updated example after fix in example here: aspnet/DotNetTools#358 (co…
Browse files Browse the repository at this point in the history
  • Loading branch information
FlukeFan committed Nov 13, 2017
1 parent 71b6265 commit a81ba9b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 31 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1 +1,2 @@
/TextFilesCopy
obj
8 changes: 6 additions & 2 deletions Build/Build.proj → Build/Build.csproj
@@ -1,7 +1,12 @@
<Project ToolsVersion="15.0" DefaultTargets="UpdateFiles">
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="UpdateFiles">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
<Watch Include="..\TextFiles\*.txt" />
</ItemGroup>

<Target Name="UpdateFiles">
Expand All @@ -11,5 +16,4 @@
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="..\TextFilesCopy" />
</Target>

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets"/>
</Project>
1 change: 1 addition & 0 deletions CommandPrompt.bat
Expand Up @@ -2,4 +2,5 @@
@title WatchCustomProject Command Prompt
@SET PATH=C:\Program Files\dotnet\;%PATH%
type readme.txt
cd Build
%comspec%
1 change: 1 addition & 0 deletions TextFiles/File1.txt
@@ -0,0 +1 @@
Content of File1.txt
1 change: 1 addition & 0 deletions TextFiles/File2.txt
@@ -0,0 +1 @@
Content of File2.txt
36 changes: 7 additions & 29 deletions readme.txt
@@ -1,34 +1,12 @@

An attempt to get 'dotnet watch' running against a custom MSBuild project.
dotnet watch example
====================

Open a command prompt in the root folder (or open CommandPrompt.bat);
Open a command prompt in the Build folder (or open CommandPrompt.bat).

Type: dotnet msbuild Build\Build.proj
Type:
dotnet restore
dotnet watch msbuild

The folder TextFilesCopy is created, with a copy of the files from the folder TextFiles.

Type: dotnet watch msbuild Build\Build.proj

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

I added the following to the Build.proj:

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>

Type: dotnet restore Build\Build.proj

I get the error: Build\Build.proj : error MSB4057: The target "Restore" does not exist in the project

I added the following to the Build.proj:

<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets"/>

Type: dotnet restore Build\Build.project

I get the 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]
Modifying files in the TextFiles folder will automatically copy changes to the TextFilesCopy folder.

0 comments on commit a81ba9b

Please sign in to comment.