1

我们正在将我们的 Windows Mobile 手持终端移植到 Android,因此我们需要更改我们的 WCF 服务。我目前正在编写代理以使用 .NET Core (2.2) 将 WCF 服务转换为 REST API

我创建了一个 .NET Core 2.2 API 项目并尝试将我的 WCF 服务添加为连接服务。但是当我尝试添加我的 WCF 服务时,我收到以下错误:

我对该错误进行了搜索,发现可以在“C:\Users{UserName}\AppData\Local\Temp\WCFConnectedService”文件夹中找到日志。我检查了这些文件,没有发现任何信息可以帮助解决这个问题。

WCFConnectedServiceLog.txt:

[10/24/2019 15:35:40],6,Importing web service metadata ...
[10/24/2019 15:35:40],49,Number of service endpoints found: 1
[10/24/2019 15:35:40],47,Scaffolding service reference code ...
[10/24/2019 15:35:40],92,Executing command [C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\svcutil_starter]
 "dotnet new console --no-restore --force --type project --language C# --output . --name svcutil_starter"
[10/24/2019 15:35:51],90,Executing command [C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\svcutil_starter]
 "dotnet restore --ignore-failed-sources"
[10/24/2019 15:35:52],92,Executing command [C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\svcutil_starter]
 "dotnet svcutil --additionalprobingpath "C:\Users\{username}\.nuget\packages" "C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\SvcUtilParams.txt""
[10/24/2019 15:36:02],53,Restoring NuGet packages for bootstrapper ...
[10/24/2019 15:36:06],26,Building bootstrapper project ...
[10/24/2019 15:36:10],5,Invoking bootstrapper ...
[10/24/2019 15:36:11],26,The build failed. Fix the build errors and run again.
[10/24/2019 15:36:11],96,An error occurred in the tool.
[10/24/2019 15:36:11],42,Done.

SvcUtilParams.txt:

"C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\wsdl\tempuri.org.wsdl" 
"C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\wsdl\MazotService.Objects.xsd" 
"C:\Users\{username\\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\wsdl\noNamespace.xsd" 
"C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\wsdl\schemas.microsoft.com.2003.10.Serialization.xsd" 
"C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\wsdl\tempuri.org.xsd" 
-nl
-v Minimal
-elm
-tml Infrastructure
-npu
-nrr
-o "Reference"
-d "C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40"
-bd "C:\Users\{username}\AppData\Local\Temp\WCFConnectedService\2019_Oct_24_15_35_40\svcutil_bootstrap"
-cn en-US
-n "*,ServiceReference1"
-ct "System.Array"
-ct "System.Collections.Generic.Dictionary`2"
-r "System.Runtime, {Microsoft.NETCore.App, *}"
-r "System.Collections, {Microsoft.NETCore.App, *}"
-r "Microsoft.AspNetCore, {Microsoft.AspNetCore, 2.2.0}"
-r "Microsoft.AspNetCore.Antiforgery, {Microsoft.AspNetCore.Antiforgery, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication, {Microsoft.AspNetCore.Authentication, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Abstractions, {Microsoft.AspNetCore.Authentication.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Cookies, {Microsoft.AspNetCore.Authentication.Cookies, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Core, {Microsoft.AspNetCore.Authentication.Core, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Facebook, {Microsoft.AspNetCore.Authentication.Facebook, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Google, {Microsoft.AspNetCore.Authentication.Google, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.JwtBearer, {Microsoft.AspNetCore.Authentication.JwtBearer, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.MicrosoftAccount, {Microsoft.AspNetCore.Authentication.MicrosoftAccount, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.OAuth, {Microsoft.AspNetCore.Authentication.OAuth, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.OpenIdConnect, {Microsoft.AspNetCore.Authentication.OpenIdConnect, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.Twitter, {Microsoft.AspNetCore.Authentication.Twitter, 2.2.0}"
-r "Microsoft.AspNetCore.Authentication.WsFederation, {Microsoft.AspNetCore.Authentication.WsFederation, 2.2.0}"
-r "Microsoft.AspNetCore.Authorization, {Microsoft.AspNetCore.Authorization, 2.2.0}"
-r "Microsoft.AspNetCore.Authorization.Policy, {Microsoft.AspNetCore.Authorization.Policy, 2.2.0}"
-r "Microsoft.AspNetCore.Connections.Abstractions, {Microsoft.AspNetCore.Connections.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.CookiePolicy, {Microsoft.AspNetCore.CookiePolicy, 2.2.0}"
-r "Microsoft.AspNetCore.Cors, {Microsoft.AspNetCore.Cors, 2.2.0}"
-r "Microsoft.AspNetCore.Cryptography.Internal, {Microsoft.AspNetCore.Cryptography.Internal, 2.2.0}"
-r "Microsoft.AspNetCore.Cryptography.KeyDerivation, {Microsoft.AspNetCore.Cryptography.KeyDerivation, 2.2.0}"
-r "Microsoft.AspNetCore.DataProtection, {Microsoft.AspNetCore.DataProtection, 2.2.0}"
-r "Microsoft.AspNetCore.DataProtection.Abstractions, {Microsoft.AspNetCore.DataProtection.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.DataProtection.Extensions, {Microsoft.AspNetCore.DataProtection.Extensions, 2.2.0}"
-r "Microsoft.AspNetCore.Diagnostics, {Microsoft.AspNetCore.Diagnostics, 2.2.0}"
-r "Microsoft.AspNetCore.Diagnostics.Abstractions, {Microsoft.AspNetCore.Diagnostics.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore, {Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore, 2.2.0}"
-r "Microsoft.AspNetCore.Diagnostics.HealthChecks, {Microsoft.AspNetCore.Diagnostics.HealthChecks, 2.2.0}"
-r "Microsoft.AspNetCore.HostFiltering, {Microsoft.AspNetCore.HostFiltering, 2.2.0}"
-r "Microsoft.AspNetCore.Hosting, {Microsoft.AspNetCore.Hosting, 2.2.0}"
-r "Microsoft.AspNetCore.Hosting.Abstractions, {Microsoft.AspNetCore.Hosting.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Hosting.Server.Abstractions, {Microsoft.AspNetCore.Hosting.Server.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Html.Abstractions, {Microsoft.AspNetCore.Html.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Http, {Microsoft.AspNetCore.Http, 2.2.0}"
-r "Microsoft.AspNetCore.Http.Abstractions, {Microsoft.AspNetCore.Http.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Http.Connections, {Microsoft.AspNetCore.Http.Connections, 1.1.0}"
-r "Microsoft.AspNetCore.Http.Connections.Common, {Microsoft.AspNetCore.Http.Connections.Common, 1.1.0}"
-r "Microsoft.AspNetCore.Http.Extensions, {Microsoft.AspNetCore.Http.Extensions, 2.2.0}"
-r "Microsoft.AspNetCore.Http.Features, {Microsoft.AspNetCore.Http.Features, 2.2.0}"
-r "Microsoft.AspNetCore.HttpOverrides, {Microsoft.AspNetCore.HttpOverrides, 2.2.0}"
-r "Microsoft.AspNetCore.HttpsPolicy, {Microsoft.AspNetCore.HttpsPolicy, 2.2.0}"
-r "Microsoft.AspNetCore.Identity, {Microsoft.AspNetCore.Identity, 2.2.0}"
-r "Microsoft.AspNetCore.Identity.EntityFrameworkCore, {Microsoft.AspNetCore.Identity.EntityFrameworkCore, 2.2.0}"
-r "Microsoft.AspNetCore.Identity.UI, {Microsoft.AspNetCore.Identity.UI, 2.2.0}"
-r "Microsoft.AspNetCore.Identity.UI.Views.V3, {Microsoft.AspNetCore.Identity.UI, 2.2.0}"
-r "Microsoft.AspNetCore.Identity.UI.Views.V4, {Microsoft.AspNetCore.Identity.UI, 2.2.0}"
-r "Microsoft.AspNetCore.JsonPatch, {Microsoft.AspNetCore.JsonPatch, 2.2.0}"
-r "Microsoft.AspNetCore.Localization, {Microsoft.AspNetCore.Localization, 2.2.0}"
-r "Microsoft.AspNetCore.Localization.Routing, {Microsoft.AspNetCore.Localization.Routing, 2.2.0}"
-r "Microsoft.AspNetCore.MiddlewareAnalysis, {Microsoft.AspNetCore.MiddlewareAnalysis, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc, {Microsoft.AspNetCore.Mvc, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Abstractions, {Microsoft.AspNetCore.Mvc.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.ApiExplorer, {Microsoft.AspNetCore.Mvc.ApiExplorer, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Core, {Microsoft.AspNetCore.Mvc.Core, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Cors, {Microsoft.AspNetCore.Mvc.Cors, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.DataAnnotations, {Microsoft.AspNetCore.Mvc.DataAnnotations, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Formatters.Json, {Microsoft.AspNetCore.Mvc.Formatters.Json, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Formatters.Xml, {Microsoft.AspNetCore.Mvc.Formatters.Xml, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Localization, {Microsoft.AspNetCore.Mvc.Localization, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Razor, {Microsoft.AspNetCore.Mvc.Razor, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.Razor.Extensions, {Microsoft.AspNetCore.Mvc.Razor.Extensions, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.RazorPages, {Microsoft.AspNetCore.Mvc.RazorPages, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.TagHelpers, {Microsoft.AspNetCore.Mvc.TagHelpers, 2.2.0}"
-r "Microsoft.AspNetCore.Mvc.ViewFeatures, {Microsoft.AspNetCore.Mvc.ViewFeatures, 2.2.0}"
-r "Microsoft.AspNetCore.NodeServices, {Microsoft.AspNetCore.NodeServices, 2.2.0}"
-r "Microsoft.AspNetCore.Owin, {Microsoft.AspNetCore.Owin, 2.2.0}"
-r "Microsoft.AspNetCore.Razor, {Microsoft.AspNetCore.Razor, 2.2.0}"
-r "Microsoft.AspNetCore.Razor.Language, {Microsoft.AspNetCore.Razor.Language, 2.2.0}"
-r "Microsoft.AspNetCore.Razor.Runtime, {Microsoft.AspNetCore.Razor.Runtime, 2.2.0}"
-r "Microsoft.AspNetCore.ResponseCaching, {Microsoft.AspNetCore.ResponseCaching, 2.2.0}"
-r "Microsoft.AspNetCore.ResponseCaching.Abstractions, {Microsoft.AspNetCore.ResponseCaching.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.ResponseCompression, {Microsoft.AspNetCore.ResponseCompression, 2.2.0}"
-r "Microsoft.AspNetCore.Rewrite, {Microsoft.AspNetCore.Rewrite, 2.2.0}"
-r "Microsoft.AspNetCore.Routing, {Microsoft.AspNetCore.Routing, 2.2.0}"
-r "Microsoft.AspNetCore.Routing.Abstractions, {Microsoft.AspNetCore.Routing.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Server.HttpSys, {Microsoft.AspNetCore.Server.HttpSys, 2.2.0}"
-r "Microsoft.AspNetCore.Server.IIS, {Microsoft.AspNetCore.Server.IIS, 2.2.0}"
-r "Microsoft.AspNetCore.Server.IISIntegration, {Microsoft.AspNetCore.Server.IISIntegration, 2.2.0}"
-r "Microsoft.AspNetCore.Server.Kestrel, {Microsoft.AspNetCore.Server.Kestrel, 2.2.0}"
-r "Microsoft.AspNetCore.Server.Kestrel.Core, {Microsoft.AspNetCore.Server.Kestrel.Core, 2.2.0}"
-r "Microsoft.AspNetCore.Server.Kestrel.Https, {Microsoft.AspNetCore.Server.Kestrel.Https, 2.2.0}"
-r "Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions, {Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions, 2.2.0}"
-r "Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, {Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets, 2.2.0}"
-r "Microsoft.AspNetCore.Session, {Microsoft.AspNetCore.Session, 2.2.0}"
-r "Microsoft.AspNetCore.SignalR, {Microsoft.AspNetCore.SignalR, 1.1.0}"
-r "Microsoft.AspNetCore.SignalR.Common, {Microsoft.AspNetCore.SignalR.Common, 1.1.0}"
-r "Microsoft.AspNetCore.SignalR.Core, {Microsoft.AspNetCore.SignalR.Core, 1.1.0}"
-r "Microsoft.AspNetCore.SignalR.Protocols.Json, {Microsoft.AspNetCore.SignalR.Protocols.Json, 1.1.0}"
-r "Microsoft.AspNetCore.SpaServices, {Microsoft.AspNetCore.SpaServices, 2.2.0}"
-r "Microsoft.AspNetCore.SpaServices.Extensions, {Microsoft.AspNetCore.SpaServices.Extensions, 2.2.0}"
-r "Microsoft.AspNetCore.StaticFiles, {Microsoft.AspNetCore.StaticFiles, 2.2.0}"
-r "Microsoft.AspNetCore.WebSockets, {Microsoft.AspNetCore.WebSockets, 2.2.0}"
-r "Microsoft.AspNetCore.WebUtilities, {Microsoft.AspNetCore.WebUtilities, 2.2.0}"
-r "Microsoft.CodeAnalysis, {Microsoft.CodeAnalysis.Common, 2.8.0}"
-r "Microsoft.CodeAnalysis.CSharp, {Microsoft.CodeAnalysis.CSharp, 2.8.0}"
-r "Microsoft.CodeAnalysis.Razor, {Microsoft.CodeAnalysis.Razor, 2.2.0}"
-r "Microsoft.CSharp, {Microsoft.NETCore.App, 2.2.0}"
-r "Microsoft.DotNet.PlatformAbstractions, {Microsoft.DotNet.PlatformAbstractions, 2.1.0}"
-r "Microsoft.EntityFrameworkCore, {Microsoft.EntityFrameworkCore, 2.2.0}"
-r "Microsoft.EntityFrameworkCore.Abstractions, {Microsoft.EntityFrameworkCore.Abstractions, 2.2.0}"
-r "Microsoft.EntityFrameworkCore.InMemory, {Microsoft.EntityFrameworkCore.InMemory, 2.2.0}"
-r "Microsoft.EntityFrameworkCore.Relational, {Microsoft.EntityFrameworkCore.Relational, 2.2.0}"
-r "Microsoft.EntityFrameworkCore.SqlServer, {Microsoft.EntityFrameworkCore.SqlServer, 2.2.0}"
-r "Microsoft.Extensions.Caching.Abstractions, {Microsoft.Extensions.Caching.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.Caching.Memory, {Microsoft.Extensions.Caching.Memory, 2.2.0}"
-r "Microsoft.Extensions.Caching.SqlServer, {Microsoft.Extensions.Caching.SqlServer, 2.2.0}"
-r "Microsoft.Extensions.Configuration, {Microsoft.Extensions.Configuration, 2.2.0}"
-r "Microsoft.Extensions.Configuration.Abstractions, {Microsoft.Extensions.Configuration.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.Configuration.Binder, {Microsoft.Extensions.Configuration.Binder, 2.2.0}"
-r "Microsoft.Extensions.Configuration.CommandLine, {Microsoft.Extensions.Configuration.CommandLine, 2.2.0}"
-r "Microsoft.Extensions.Configuration.EnvironmentVariables, {Microsoft.Extensions.Configuration.EnvironmentVariables, 2.2.0}"
-r "Microsoft.Extensions.Configuration.FileExtensions, {Microsoft.Extensions.Configuration.FileExtensions, 2.2.0}"
-r "Microsoft.Extensions.Configuration.Ini, {Microsoft.Extensions.Configuration.Ini, 2.2.0}"
-r "Microsoft.Extensions.Configuration.Json, {Microsoft.Extensions.Configuration.Json, 2.2.0}"
-r "Microsoft.Extensions.Configuration.KeyPerFile, {Microsoft.Extensions.Configuration.KeyPerFile, 2.2.0}"
-r "Microsoft.Extensions.Configuration.UserSecrets, {Microsoft.Extensions.Configuration.UserSecrets, 2.2.0}"
-r "Microsoft.Extensions.Configuration.Xml, {Microsoft.Extensions.Configuration.Xml, 2.2.0}"
-r "Microsoft.Extensions.DependencyInjection, {Microsoft.Extensions.DependencyInjection, 2.2.0}"
-r "Microsoft.Extensions.DependencyInjection.Abstractions, {Microsoft.Extensions.DependencyInjection.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.DependencyModel, {Microsoft.Extensions.DependencyModel, 2.1.0}"
-r "Microsoft.Extensions.DiagnosticAdapter, {Microsoft.Extensions.DiagnosticAdapter, 2.2.0}"
-r "Microsoft.Extensions.Diagnostics.HealthChecks, {Microsoft.Extensions.Diagnostics.HealthChecks, 2.2.0}"
-r "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions, {Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.FileProviders.Abstractions, {Microsoft.Extensions.FileProviders.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.FileProviders.Composite, {Microsoft.Extensions.FileProviders.Composite, 2.2.0}"
-r "Microsoft.Extensions.FileProviders.Embedded, {Microsoft.Extensions.FileProviders.Embedded, 2.2.0}"
-r "Microsoft.Extensions.FileProviders.Physical, {Microsoft.Extensions.FileProviders.Physical, 2.2.0}"
-r "Microsoft.Extensions.FileSystemGlobbing, {Microsoft.Extensions.FileSystemGlobbing, 2.2.0}"
-r "Microsoft.Extensions.Hosting, {Microsoft.Extensions.Hosting, 2.2.0}"
-r "Microsoft.Extensions.Hosting.Abstractions, {Microsoft.Extensions.Hosting.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.Http, {Microsoft.Extensions.Http, 2.2.0}"
-r "Microsoft.Extensions.Identity.Core, {Microsoft.Extensions.Identity.Core, 2.2.0}"
-r "Microsoft.Extensions.Identity.Stores, {Microsoft.Extensions.Identity.Stores, 2.2.0}"
-r "Microsoft.Extensions.Localization, {Microsoft.Extensions.Localization, 2.2.0}"
-r "Microsoft.Extensions.Localization.Abstractions, {Microsoft.Extensions.Localization.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.Logging, {Microsoft.Extensions.Logging, 2.2.0}"
-r "Microsoft.Extensions.Logging.Abstractions, {Microsoft.Extensions.Logging.Abstractions, 2.2.0}"
-r "Microsoft.Extensions.Logging.Configuration, {Microsoft.Extensions.Logging.Configuration, 2.2.0}"
-r "Microsoft.Extensions.Logging.Console, {Microsoft.Extensions.Logging.Console, 2.2.0}"
-r "Microsoft.Extensions.Logging.Debug, {Microsoft.Extensions.Logging.Debug, 2.2.0}"
-r "Microsoft.Extensions.Logging.EventSource, {Microsoft.Extensions.Logging.EventSource, 2.2.0}"
-r "Microsoft.Extensions.Logging.TraceSource, {Microsoft.Extensions.Logging.TraceSource, 2.2.0}"
-r "Microsoft.Extensions.ObjectPool, {Microsoft.Extensions.ObjectPool, 2.2.0}"
-r "Microsoft.Extensions.Options, {Microsoft.Extensions.Options, 2.2.0}"
-r "Microsoft.Extensions.Options.ConfigurationExtensions, {Microsoft.Extensions.Options.ConfigurationExtensions, 2.2.0}"
-r "Microsoft.Extensions.Options.DataAnnotations, {Microsoft.Extensions.Options.DataAnnotations, 2.2.0}"
-r "Microsoft.Extensions.Primitives, {Microsoft.Extensions.Primitives, 2.2.0}"
-r "Microsoft.Extensions.WebEncoders, {Microsoft.Extensions.WebEncoders, 2.2.0}"
-r "Microsoft.IdentityModel.JsonWebTokens, {Microsoft.IdentityModel.JsonWebTokens, 5.3.0}"
-r "Microsoft.IdentityModel.Logging, {Microsoft.IdentityModel.Logging, 5.3.0}"
-r "Microsoft.IdentityModel.Protocols, {Microsoft.IdentityModel.Protocols, 5.3.0}"
-r "Microsoft.IdentityModel.Protocols.OpenIdConnect, {Microsoft.IdentityModel.Protocols.OpenIdConnect, 5.3.0}"
-r "Microsoft.IdentityModel.Protocols.WsFederation, {Microsoft.IdentityModel.Protocols.WsFederation, 5.3.0}"
-r "Microsoft.IdentityModel.Tokens, {Microsoft.IdentityModel.Tokens, 5.3.0}"
-r "Microsoft.IdentityModel.Tokens.Saml, {Microsoft.IdentityModel.Tokens.Saml, 5.3.0}"
-r "Microsoft.IdentityModel.Xml, {Microsoft.IdentityModel.Xml, 5.3.0}"
-r "Microsoft.Net.Http.Headers, {Microsoft.Net.Http.Headers, 2.2.0}"
-r "Microsoft.VisualBasic, {Microsoft.NETCore.App, 2.2.0}"
-r "Microsoft.Win32.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "Microsoft.Win32.Registry, {Microsoft.Win32.Registry, 4.5.0}"
-r "mscorlib, {Microsoft.NETCore.App, 2.2.0}"
-r "netstandard, {Microsoft.NETCore.App, 2.2.0}"
-r "Newtonsoft.Json, {Newtonsoft.Json, 11.0.2}"
-r "Newtonsoft.Json.Bson, {Newtonsoft.Json.Bson, 1.0.1}"
-r "Remotion.Linq, {Remotion.Linq, 2.2.0}"
-r "System, {Microsoft.NETCore.App, 2.2.0}"
-r "System.AppContext, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Buffers, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Collections.Concurrent, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Collections.Immutable, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Collections.NonGeneric, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Collections.Specialized, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel.Annotations, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel.DataAnnotations, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel.EventBasedAsync, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ComponentModel.TypeConverter, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Configuration, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Console, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Core, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Data, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Data.Common, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Data.SqlClient, {System.Data.SqlClient, 4.6.0}"
-r "System.Diagnostics.Contracts, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.Debug, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.DiagnosticSource, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.FileVersionInfo, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.Process, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.StackTrace, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.TextWriterTraceListener, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.Tools, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.TraceSource, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Diagnostics.Tracing, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Drawing, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Drawing.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Dynamic.Runtime, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Globalization, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Globalization.Calendars, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Globalization.Extensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IdentityModel.Tokens.Jwt, {System.IdentityModel.Tokens.Jwt, 5.3.0}"
-r "System.Interactive.Async, {System.Interactive.Async, 3.2.0}"
-r "System.IO, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.Compression, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.Compression.Brotli, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.Compression.FileSystem, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.Compression.ZipFile, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.FileSystem, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.FileSystem.DriveInfo, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.FileSystem.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.FileSystem.Watcher, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.IsolatedStorage, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.MemoryMappedFiles, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.Pipelines, {System.IO.Pipelines, 4.5.2}"
-r "System.IO.Pipes, {Microsoft.NETCore.App, 2.2.0}"
-r "System.IO.UnmanagedMemoryStream, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Linq, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Linq.Expressions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Linq.Parallel, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Linq.Queryable, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Memory, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Http, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Http.Formatting, {Microsoft.AspNet.WebApi.Client, 5.2.6}"
-r "System.Net.HttpListener, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Mail, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.NameResolution, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.NetworkInformation, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Ping, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Requests, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Security, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.ServicePoint, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.Sockets, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebClient, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebHeaderCollection, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebProxy, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebSockets, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebSockets.Client, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Net.WebSockets.WebSocketProtocol, {System.Net.WebSockets.WebSocketProtocol, 4.5.1}"
-r "System.Numerics, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Numerics.Vectors, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ObjectModel, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.DispatchProxy, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Emit, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Emit.ILGeneration, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Emit.Lightweight, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Extensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Metadata, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Reflection.TypeExtensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Resources.Reader, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Resources.ResourceManager, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Resources.Writer, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.CompilerServices.Unsafe, {System.Runtime.CompilerServices.Unsafe, 4.5.1}"
-r "System.Runtime.CompilerServices.VisualC, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Extensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Handles, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.InteropServices, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.InteropServices.RuntimeInformation, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.InteropServices.WindowsRuntime, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Loader, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Numerics, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Serialization, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Serialization.Formatters, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Serialization.Json, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Serialization.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Runtime.Serialization.Xml, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.AccessControl, {System.Security.AccessControl, 4.5.0}"
-r "System.Security.Claims, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.Algorithms, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.Cng, {System.Security.Cryptography.Cng, 4.5.0}"
-r "System.Security.Cryptography.Csp, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.Encoding, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.Primitives, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.X509Certificates, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Cryptography.Xml, {System.Security.Cryptography.Xml, 4.5.0}"
-r "System.Security.Permissions, {System.Security.Permissions, 4.5.0}"
-r "System.Security.Principal, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Security.Principal.Windows, {System.Security.Principal.Windows, 4.5.0}"
-r "System.Security.SecureString, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ServiceModel.Web, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ServiceProcess, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Text.Encoding, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Text.Encoding.Extensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Text.Encodings.Web, {System.Text.Encodings.Web, 4.5.0}"
-r "System.Text.RegularExpressions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Channels, {System.Threading.Channels, 4.5.0}"
-r "System.Threading.Overlapped, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Tasks, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Tasks.Dataflow, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Tasks.Extensions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Tasks.Parallel, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Thread, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.ThreadPool, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Threading.Timer, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Transactions, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Transactions.Local, {Microsoft.NETCore.App, 2.2.0}"
-r "System.ValueTuple, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Web, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Web.HttpUtility, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Windows, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.Linq, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.ReaderWriter, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.Serialization, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.XDocument, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.XmlDocument, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.XmlSerializer, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.XPath, {Microsoft.NETCore.App, 2.2.0}"
-r "System.Xml.XPath.XDocument, {Microsoft.NETCore.App, 2.2.0}"
-r "WindowsBase, {Microsoft.NETCore.App, 2.2.0}"
-tf "netcoreapp2.2"

我该如何解决这个问题,我该怎么办?

4

6 回答 6

2

你可以在这里找到答案:https ://github.com/dotnet/wcf/issues/3383#issuecomment-463747870

这对我有用。我的项目是 .net core 2.1,我的机器上安装了 .net core 2.2 和 3。我无法为具有相同问题的项目添加 WCF 引用,并且运行dotnet --version结果为 3.0.100

我通过运行查看了我拥有的版本dotnet --info我选择了我拥有的最新的 .net core 2.1 并运行了这个命令dotnet new globaljson --sdk-version 2.1.509

509 是我机器上最新的 SDK 2.1 版本。

所以现在我可以将 WCFreference 添加到我的项目中。

于 2020-03-06T15:46:15.633 回答
1

创建一个新的 .net 标准项目来保存该服务。该服务在 api/web 项目中不起作用

于 2020-09-05T15:37:16.410 回答
0

由于 Asp.Net 内核与 WCF 不兼容,因此没有必要进行此转换。我们可以使用 Webhttpbinding 创建的 WCF 直接创建 Rest API。只有 Basichttpbinding 创建的 WCF 才能在 Core 项目中正确引用。所以想知道服务端的WCF是怎么创建的,服务端使用的是哪个绑定?
此外,清理您的项目并再次引用 WCF 有时会很有用。
您可以在以下存储库中检查 Asp.Net Core 项目的支持状态issues
https://github.com/dotnet/wcf
或者,我们可以简单地使用 Webhttpbinding 创建 WCF Rest API。 https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-create-a-basic-wcf-web-http-service
如果有什么我可以帮忙的,请随时告诉我。

于 2019-10-25T07:14:52.267 回答
0

您是否安装了 .NET Core 3.0 预览版 sdk?尝试在命令行上运行 dotnet --version 以查看 3.0 preview 是否是正在使用的 sdk。

在我的机器上安装 .NET Core 3.0 预览版后,我能够重现这一点。这看起来像是工具中的一个错误,我们没有正确使用您项目的目标框架,而是使用您当前 sdk 的默认目标框架(例如,当使用“dotnet new”创建项目时)。我将研究如何解决这个问题并在我们修复它后更新这个线程。

目前,我可以通过在驱动器根目录的 global.json 中指定较旧的 sdk 版本来解决此问题。为此,只需在 C:\ 目录中打开一个管理员命令提示符并运行:dotnet new globaljson --sdk-version 2.2.104

用您安装的任何 2.2 版本替换该版本。您可以使用 dotnet --info 进行检查。

于 2020-01-12T08:03:46.597 回答
0

使用 dotnet core 2.1 和 Visual Studio 2017

 <TargetFramework>netstandard2.0</TargetFramework>

在 Web 和 API 中它不起作用但是一旦添加了新的 dotnet 标准 2.0 库。那里添加了服务参考它对我有用。

于 2022-01-12T15:39:12.350 回答
0

就我而言,dotnet core 3.0 预览版正是问题所在!我的问题开始于圣诞节前后,我发现 .netcore preview 3.0 是在 12 月 19 日安装的......一旦我卸载它,问题就消失了,WCF 导入又开始工作了。

于 2020-01-29T23:17:51.787 回答