VSSDK: it is impossible to create a solution with mixed styles of csproj projects containing VSIX projects

I have a solution containing several projects designed for both net461 and netcoreapp2.0. The solution also contains VSIX projects with the DslTools extension. VSIX projects use the old csproj format, while other projects use the new csproj format (SDK). But all projects use the PackageReference format for nuget links.
Therefore, there are no .config packages, no project.json.

The VSIX project depends on the Microsoft.VSSDK.BuildToolsnuget package and other packages in the VSExtensibility family.

For DSL tools, I need to copy the necessary resources from the DSL SDK (Modeling SDK) to my project and specify them explicitly.

The solution built in VS2017 is just fine.

When I create it through the dotnet build, I get this error:

D:\..\src\packages\microsoft.vssdk.buildtools\15.5.72\tools\VSSDK\Microsoft.VsSDK.targets(82,5): error MSB4062: The "CompareCommonBuildTaskVersion" task could not be loaded from the assembly D:...\src\packages\microsoft.vssdk.buildtools\15.5.72\tools\VSSDL\Microsoft.VisualStudio.Sdk.BuildTasks.dll. Could not load file or assembly 'System.IO.Packaging, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Probably MSBuild in the dotnet CLI cannot load Microsoft.VisualStudio.Sdk.BuildTasks.dllfrom VSSDK.

Therefore, a VSIX project cannot be built using the command line using dotnet.

Then I try to build through msbuild.exe. It should work as it works in VS, but it is not.

At this time, I get:

"D:..\Src\DslDesigner\Dsl\Dsl.csproj" (default target) (2) ->
(ResolveNuGetPackageAssets target) ->
Z:\Prog\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(184,5): error : Your project.json doesn't have a runtimes section. You should add '"runtimes": { "win": { } }' to your project.json and then re-run NuGet restore. [D:...\Src\DslDesigner\Dsl\Dsl.csproj]

This is a kind of obsolete post in NuGet according to this issue . But this is not an error message.

VSIX-csproj have: ToolsVersion = "15.0" TargetFrameworkVersion = 4.6.1

Therefore, I have no idea how to build my solution on the command line. Any suggestion?

+4
source share
1 answer

- ( ) csproj-s, VSIX:

<RuntimeIdentifiers>win</RuntimeIdentifiers>
+3

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


All Articles