Visual Studio 2017 MSBuild Development

When developing a custom MSBuild task with Visual Studio 2017 RC, I have the following problem: as soon as I add other dependencies, and not just Microsoft.Build.Utilities.Core(using v15.1.0-preview-000458-02 to support .NET Core), I cannot load the task into another .csproj MSBuild project, because no dependencies were found.

Is there a way to automatically copy all dependencies to the Debug folder? Or do I need to publish it every time I want to test it?

Update1:
The publishing issue was something local to my environment and was fixed.

Update2 :
It seems that as soon as I changed TargetFramework from netstandard1.4 to netstandard1.6, it can't even load the task at all. As soon as I use netstandard 1.6, it throws an exception:

The task could not be loaded from the assembly.
Could not load file or assembly 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies.
+4
source share
1 answer

Is there a way to automatically copy all dependencies to the Debug folder? Or do I have to publish it every time I want to test it?

By default and for good reasons, .NET Core and .NET Standard projects do not copy referenced assemblies to the assembly folder. Instead, they allow them from the NuGet cache.

, , CopyLocalLockFileAssemblies.

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Cref: https://github.com/dotnet/sdk/blob/d20405f91a2959fa91fea6285d9a896286727f2a/src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.Sdk.BeforeCommon.targets#L55-L56

, TargetFramework netstandard1.4 netstandard1.6

, "MSBuild.exe", "dotnet.exe msbuild", netstandard1.4 . netstandard1.6 .NET Framework 4.6.1 ( MSBuild.exe.)

API, netstandard1.4, - .NET Framework .NET Standard, , .

+2

Source: https://habr.com/ru/post/1666447/


All Articles