Skip to content

Visual Studio SvcUtil integration uses xmlparse to read properties where they should be evaluated #4658

@MeikTranel

Description

@MeikTranel

Describe the bug
When using property references to control the target framework of a project, svcutils reads the msbuild syntax instead of the actual value crashing the update servicereference option in Visual Studio 2019 16.10.2.

svcutil should use either use MSBuild evaluation libraries or receive the values from Visual Studio as parameters. XML parsed values are super suboptimal alltogether - with the advent of Directory.Build.props etc. lots of projects depend on evaluation to really a get the actual picture of references, properties and such.

To Reproduce

./Directory.Build.props

<Project>
  <PropertyGroup>
    <DefaultTFM>net452</DefaultTFM>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="./SampleLib.dll" />
  </ItemGroup>
</Project>

./Client/Client.csproj

<Project Sdk="Microsoft.Net.Sdk">
  <PropertyGroup>
    <TargetFramework>$(DefaultTFM)</TargetFramework>
  </PropertyGroup>
</Project>

Expected behavior
svcutil picks up net452 as the designed targetframework for code generation.

stretch-goal: svcutil picks up SampleLib.dll as a designated reference to reuse types from.

Screenshots
image

Additional context
A friendly aussie wizard dropped by and found the root cause: https://twitter.com/davkean/status/1410532553530875904

Metadata

Metadata

Assignees

Labels

investigation neededAdditional investigation needed before issue can be triaged.toolingAn issues related to any tool shipped from this repo.triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions