dotnet / wcf

This repo contains the client-oriented WCF libraries that enable applications built on .NET Core to communicate with WCF services.
MIT License
1.7k stars 559 forks source link

dotnet-svcutil.xmlserializer can't find netstandard 2.1.0.0 #4243

Open epignosisx opened 4 years ago

epignosisx commented 4 years ago

I'm trying to make dotnet-svcutil.xmlserializer work, but it's failing with:

Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

This is a slimmed down version of the csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="dotnet-svcutil.xmlserializer" Version="1.2.0" />
    <PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
    <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.7.0" />
    <PackageReference Include="System.Private.ServiceModel" Version="4.7.0" />
    <PackageReference Include="System.ServiceModel.Duplex" Version="4.7.0" />
    <PackageReference Include="System.ServiceModel.Http" Version="4.7.0" />
    <PackageReference Include="System.ServiceModel.NetTcp" Version="4.7.0" />
    <PackageReference Include="System.ServiceModel.Security" Version="4.7.0" />
  </ItemGroup>
</Project>

When I run dotnet build, this is the error shown:

EXEC : warning : There were errors loading types in an assembly loaded from 'c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\obj\Debug\netstandard2.1\Company.Extensions.Messaging.dll' some types in the assembly could not be loaded and will not be available to the tool. [c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\Company.Extensions.Messaging.csproj]
EXEC : warning : An error occurred in the tool. [c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\Company.Extensions.Messaging.csproj]
EXEC : warning : Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. [c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\Company.Extensions.Messaging.csproj]
C:\Users\alex\.nuget\packages\dotnet-svcutil.xmlserializer\1.2.0\build\dotnet-svcutil.xmlserializer.targets(35,5): warning MSB3073: The command "dotnet svcutil.xmlserializer obj\Debug\netstandard2.1\Company.Extensions.Messaging.dll --quiet --out:obj\Debug\netstandard2.1\Company.Extensions.Messaging.XmlSerializers --smreference:"C:\Users\alex\.nuget\packages\Company.extensions.clock\3.0.0\lib\netstandard2.0\Company.Extensions.Clock.dll;C:\Users\alex\.nuget\packages\microsoft.extensions.logging.abstractions\1.1.2\lib\netstandard1.1\Microsoft.Extensions.Logging.Abstractions.dll;C:\Users\alex\.nuget\packages\newtonsoft.json\12.0.2\lib\netstandard2.0\Newtonsoft.Json.dll;C:\Users\alex\.nuget\packages\system.appcontext\4.3.0\lib\netstandard1.6\System.AppContext.dll;C:\Users\alex\.nuget\packages\system.buffers\4.4.0\lib\netstandard2.0\System.Buffers.dll;C:\Users\alex\.nuget\packages\system.collections.concurrent\4.3.0\lib\netstandard1.3\System.Collections.Concurrent.dll;C:\Users\alex\.nuget\packages\system.componentmodel\4.3.0\lib\netstandard1.3\System.ComponentModel.dll;C:\Users\alex\.nuget\packages\system.componentmodel.annotations\4.7.0\lib\netstandard2.1\System.ComponentModel.Annotations.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.componentmodel.primitives\4.3.0\lib\netstandard1.0\System.ComponentModel.Primitives.dll;C:\Users\alex\.nuget\packages\system.diagnostics.diagnosticsource\4.7.0\lib\netstandard1.3\System.Diagnostics.DiagnosticSource.dll;C:\Users\alex\.nuget\packages\system.io.compression.zipfile\4.3.0\lib\netstandard1.3\System.IO.Compression.ZipFile.dll;C:\Users\alex\.nuget\packages\system.io.filesystem.primitives\4.3.0\lib\netstandard1.3\System.IO.FileSystem.Primitives.dll;C:\Users\alex\.nuget\packages\system.linq\4.3.0\lib\netstandard1.6\System.Linq.dll;C:\Users\alex\.nuget\packages\system.linq.expressions\4.3.0\lib\netstandard1.6\System.Linq.Expressions.dll;C:\Users\alex\.nuget\packages\system.memory\4.5.3\lib\netstandard2.0\System.Memory.dll;C:\Users\alex\.nuget\packages\system.numerics.vectors\4.4.0\lib\netstandard2.0\System.Numerics.Vectors.dll;C:\Users\alex\.nuget\packages\system.objectmodel\4.3.0\lib\netstandard1.3\System.ObjectModel.dll;C:\Users\alex\.nuget\packages\system.private.servicemodel\4.7.0\lib\netstandard2.0\System.Private.ServiceModel.dll;C:\Users\alex\.nuget\packages\system.reflection.dispatchproxy\4.5.0\lib\netstandard2.0\System.Reflection.DispatchProxy.dll;C:\Users\alex\.nuget\packages\system.reflection.emit\4.3.0\lib\netstandard1.3\System.Reflection.Emit.dll;C:\Users\alex\.nuget\packages\system.reflection.emit.ilgeneration\4.3.0\lib\netstandard1.3\System.Reflection.Emit.ILGeneration.dll;C:\Users\alex\.nuget\packages\system.reflection.emit.lightweight\4.3.0\lib\netstandard1.3\System.Reflection.Emit.Lightweight.dll;C:\Users\alex\.nuget\packages\system.reflection.typeextensions\4.3.0\lib\netstandard1.5\System.Reflection.TypeExtensions.dll;C:\Users\alex\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll;C:\Users\alex\.nuget\packages\system.runtime.interopservices.runtimeinformation\4.3.0\lib\netstandard1.1\System.Runtime.InteropServices.RuntimeInformation.dll;C:\Users\alex\.nuget\packages\system.runtime.numerics\4.3.0\lib\netstandard1.3\System.Runtime.Numerics.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.accesscontrol\4.5.0\lib\netstandard2.0\System.Security.AccessControl.dll;C:\Users\alex\.nuget\packages\system.security.cryptography.cng\4.4.0\lib\netstandard2.0\System.Security.Cryptography.Cng.dll;C:\Users\alex\.nuget\packages\system.security.cryptography.openssl\4.3.0\lib\netstandard1.6\System.Security.Cryptography.OpenSsl.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.cryptography.pkcs\4.5.0\lib\netstandard2.0\System.Security.Cryptography.Pkcs.dll;C:\Users\alex\.nuget\packages\system.security.cryptography.primitives\4.3.0\lib\netstandard1.3\System.Security.Cryptography.Primitives.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.cryptography.xml\4.5.0\lib\netstandard2.0\System.Security.Cryptography.Xml.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.permissions\4.5.0\lib\netstandard2.0\System.Security.Permissions.dll;C:\Program Files\dotnet\sdk\NuGetFallbackFolder\system.security.principal.windows\4.5.0\lib\netstandard2.0\System.Security.Principal.Windows.dll;C:\Users\alex\.nuget\packages\system.servicemodel.duplex\4.7.0\lib\netstandard2.0\System.ServiceModel.Duplex.dll;C:\Users\alex\.nuget\packages\system.servicemodel.http\4.7.0\lib\netstandard2.0\System.ServiceModel.Http.dll;C:\Users\alex\.nuget\packages\system.servicemodel.nettcp\4.7.0\lib\netstandard2.0\System.ServiceModel.NetTcp.dll;C:\Users\alex\.nuget\packages\system.servicemodel.primitives\4.7.0\lib\netstandard2.0\System.ServiceModel.Primitives.dll;C:\Users\alex\.nuget\packages\system.servicemodel.primitives\4.7.0\lib\netstandard2.0\System.ServiceModel.dll;C:\Users\alex\.nuget\packages\system.servicemodel.security\4.7.0\lib\netstandard2.0\System.ServiceModel.Security.dll;C:\Users\alex\.nuget\packages\system.text.regularexpressions\4.3.0\lib\netstandard1.6\System.Text.RegularExpressions.dll;C:\Users\alex\.nuget\packages\system.threading\4.3.0\lib\netstandard1.3\System.Threading.dll;C:\Users\alex\.nuget\packages\system.threading.tasks.extensions\4.3.0\lib\netstandard1.0\System.Threading.Tasks.Extensions.dll;C:\Users\alex\.nuget\packages\system.xml.readerwriter\4.3.0\lib\netstandard1.3\System.Xml.ReaderWriter.dll;C:\Users\alex\.nuget\packages\system.xml.xdocument\4.3.0\lib\netstandard1.3\System.Xml.XDocument.dll"" exited with code 9. [c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\Company.Extensions.Messaging.csproj]
C:\Users\alex\.nuget\packages\dotnet-svcutil.xmlserializer\1.2.0\build\dotnet-svcutil.xmlserializer.targets(36,5): warning : Warning : Fail to generate the serializer for Company.Extensions.Messaging.dll. [c:\ccls\Company.Messaging\src\Company.Extensions.Messaging\Company.Extensions.Messaging.csproj]
    5 Warning(s)
    0 Error(s)
dasetser commented 4 years ago

@imcarolwang Can you look into reproducing this?

imcarolwang commented 4 years ago

@dasetser I can reproduce the exact issue on my machine. This could be a similar problem as reported in https://github.com/dotnet/runtime/issues/630.

imcarolwang commented 11 months ago

This issue doesn't reproduce in the private build created from the latest code that has PR #5321 merged.