wcf icon indicating copy to clipboard operation
wcf copied to clipboard

Visual Studio 16.8 breaks SvcUtil build targets

Open pmiddleton opened this issue 5 years ago • 13 comments

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.

pmiddleton avatar Nov 17 '20 18:11 pmiddleton

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

yalin78 avatar Nov 18 '20 17:11 yalin78

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:......\obj\project.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....nuget\packages\dotnet-svcutil.xmlserializer\1.2.0\build\dotnet-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.

pmiddleton avatar Nov 18 '20 17:11 pmiddleton

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.

yalin78 avatar Nov 18 '20 18:11 yalin78

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.

ajarrott avatar Nov 23 '20 23:11 ajarrott

There will be any fixes without this hacks?

rutriff avatar Dec 31 '20 17:12 rutriff

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

HongGit avatar Feb 02 '21 02:02 HongGit

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.

imcarolwang avatar Feb 05 '21 03:02 imcarolwang

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.

pmiddleton avatar Feb 22 '21 22:02 pmiddleton

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

raphaelmarcucci avatar May 27 '21 09:05 raphaelmarcucci

+1 thank goodness for things like github and open discussion on issues !

aktxyz avatar Oct 14 '21 16:10 aktxyz