Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
PreBuildEvent Use Macros Parameter On Linux Is Not Working Properly #2397
.NET Core version:2.0.0-preview2-006497
It can work in Windows VS, but in Linux will be thrown
No executable found matching command "dotnet-tools/copyfiles/CopyFiles.dll"
dotnet $(SolutionDir)tools/copyfiles/CopyFiles.dll "$(SolutionDir)src/Infrastructures/DbScript" "*.config" "Configuration/Data"
@baiyunchen I tried to reproduce this with a simple one-project solution, and I don't see the behavior you describe.
I created the PreBuildEvent in Visual studio, which resulted in this change in my project file:
diff --git a/proj/proj.csproj b/proj/proj.csproj index 049d1c7..b6370f7 100644 --- a/proj/proj.csproj +++ b/proj/proj.csproj @@ -4,4 +4,8 @@ <TargetFramework>netstandard1.4</TargetFramework> </PropertyGroup> + <Target Name="PreBuild" BeforeTargets="PreBuildEvent"> + <Exec Command="dotnet $(SolutionDir)tools/copyfiles/CopyFiles.dll" /> + </Target> + </Project>
Thanks for your answer!
I Define the pre-build event in the build event tab in the project property.
Here are some of the code in my .csproj file:
CopyFiles.dll is a simple .net core console application for copying files in linux and windows.It contains three parameters,the first parameter for the source directory,the second parameter for the target directory,the last parameter for the file search condition.
Builds from within the Visual Studio UI and command-line builds that start with the solution file both provide information to individual projects about the solution, including
If you must build the individual project because you can't publish through the solution, you can redefine the event so it's not dependent on solution variables.
You could just include a relative path like
Or you could create a
and change the reference to