Wcf: Visual Studio 16.8 breaks SvcUtil build targets

Created on 17 Nov 2020  路  9Comments  路  Source: dotnet/wcf

We are using the dotnet-avcutil.xmlserilizer package in our solution to build xml serializes for a 3rd party wcf service we consume. We just upgraded our version of Visual Studio to 16.8 and are now receiving the following two build errors.

Error MSB4063 The "ResolvePackageAssets" task could not be initialized with its input parameters.

Error MSB4064 The "TargetFrameworkMoniker" parameter is not supported by the "ResolvePackageAssets" task. Verify the parameter exists on the task, and it is a settable public instance property.

We verified with that the code builds fine on a machine with 16.7.x and then fails on the same machine once the 16.8.1 update is applied.

Our code is in a .Net Standard 2.0 class library.

The errors is coming from the ResolvePackageAssets task in the dotnet-svcutil.xmlserializer.targets file.

tooling

Most helpful comment

Is there any update on this? We have worked around things for local development but we need to build some nuget packages in our devops pipelines and area dead in the water until this is fixed.

All 9 comments

Any luck with this? I am also facing similar issue my project is .net core 2.1

Not much luck.

It turns out the build team renamed the TargetFrameworkMoniker to just TargetFramework. I tried updating the targets file and that gets me past those two errors. However now a new error appears.

Error NETSDK1005 Assets file 'c:......objproject.assets.json' doesn't have a target for '.NETStandard,Version=v2.0'. Ensure that restore has run and that you have included '.NETStandard,Version=v2.0' in the TargetFrameworks for your project. C:Users....nugetpackagesdotnet-svcutil.xmlserializer1.2.0builddotnet-svcutil.xmlserializer.targets 16

That's where I got stuck. I am targeting .Net Standard 2.0 in the project. The project.assets.json file does have a .netstandard 2 target so I'm not sure what the issue is.

The start of that file looks like this.

{
"version": 3,
"targets": {
".NETStandard,Version=v2.0": {
"dotnet-svcutil.xmlserializer/1.2.0": {
"type": "package",
"build": {
"build/dotnet-svcutil.xmlserializer.props": {},
"build/dotnet-svcutil.xmlserializer.targets": {}
}
},

I'm not sure what else to try at this point.

Thanks for your help. But I edited target framework as below for xml serializer target as per your suggestion and it started working.

TargetFramewok="netcoreapp2.1"

and it started working.

Had the same issue, using a different framework for a class library (netstandard2.0), consolidating the other comments into this response:

  • Open [YourLibrary].csproj file and get the value in the TargetFramework tag
  • Open [Project] -> Dependencies -> Packages -> dotnet-svcutil.xmlserializer

    • Rename TargetFrameworkMoniker attribute to TargetFramework

    • Replace $(NuGetTargetMoniker) with the copied value (in my case netstandard2.0)

Project should build and output your xmlserializers again.

There will be any fixes without this hacks?

@imcarolwang can you please see what is the issue here?

The ResolvePackageAssets task called by dotnet-svcutil.xmlserializer.targets comes from .NETCore SDK, the properties defined in ResolvePackageAssets task changed between different .NETCore SDK releases so if a client machine has different .NETCore SDK version installed than the one used when defining dotnet-svcutil.xmlserializer.targets, then build the target could throw error like the one described in issue. It appears relate to VS version it actually was the .NETSDK version installed that matters. @HongGit we need to fix the dotnet-svcutil.xmlserializer.targets, we can discuss this offline.

Is there any update on this? We have worked around things for local development but we need to build some nuget packages in our devops pipelines and area dead in the water until this is fixed.

This fix would seriously be needed.
Any update would be more than welcome.

Was this page helpful?
0 / 5 - 0 ratings