如何解决找不到方法:netcoreapp2.2 中的 GraphQL.ExecutionOptions.set_NameConverter
我需要在 NetCoreApp 2.2 'standard declarations
Dim IE As Object
Dim doc As HTMLDocument
Dim i As Long
Dim iWin As HTMLIFrame
Set IE = CreateObject("InternetExplorer.application")
IE.Visible = True
IE.navigate "https://leavexpert.com/"
do while IE.Busy
Application.Wait DateAdd("s",1,Now)
Loop
Set doc = IE.document
'This part puts in the login details and clicks the login button
doc.getElementById("UserName").Value = "*******"
doc.getElementById("Password").Value = "*******"
doc.getElementsByClassName("validateAndSubmit k-button")(0).Click
'wait for the website to finish loading
do while IE.Busy
Application.Wait DateAdd("s",Now)
Loop
'Go to the report section of the website
IE.navigate "https://leavexpert.com/Reports"
Set doc = IE.document
'Having the program wait while IE.busy does not seem to work,so wrapping the button click in it's own function
'and using error handling to return a 1 or 0 on success or failure is my creative work around
i = 0
do while i = 0
i = OpenReport(doc)
Application.Wait DateAdd("s",Now)
Loop
'Not quite sure if i need to set the doc variable here or not. I read somewhere that you need to do it every time you change webpages.
'Don't kNow if opening a child window counts,but better safe than sorry.
Set doc = IE.document
'Set the iWin object to the report window.
Set iWin = doc.getElementsByClassName("k-content-frame")(0)
'Wait for the report to finish loading. I kNow the program is looking at the correct object,because the debug printouts match when the window
'finishes loading.
do while iWin.readyState <> "complete"
Application.Wait DateAdd("s",Now)
Loop
Application.Wait DateAdd("s",Now)
'This is the line that clicks the button!!!!!
iWin.contentDocument.querySelector("a[title=Excel][onclick*=EXCELOPENXML]").Click
中集成 GraphQL(由于其他原因我无法升级到 NetCore 3)。
附注。我们在 .Net Core 3.1 中有另一个项目,我们可以使用 GraphQL.Server.Transports.AspNetCore.SystemTextJson,我们没有任何问题。在该项目中,一切都按预期进行。
我目前收到以下错误:
<TargetFramework>netcoreapp2.2</TargetFramework>
如果我没有记错,我会收到此错误,因为我使用的是 Nuget 包的不同组合,而其中一个程序集缺少所需的方法。
这是我当前在 csproj 中的设置,我尝试与其他版本(例如 GraphQL 4.0)交换,但我仍然无法使其工作。
System.MissingMethodException: Method not found: 'Void GraphQL.Executionoptions.set_NameConverter(GraphQL.Conversion.INameConverter)'.
at GraphQL.Server.Internal.DefaultGraphQLExecuter`1.Getoptions(String operationName,String query,Inputs variables,IDictionary`2 context,IServiceProvider requestServices,CancellationToken cancellationToken)
at GraphQL.Server.Internal.DefaultGraphQLExecuter`1.ExecuteAsync(String operationName,CancellationToken cancellationToken) in /_/src/Core/Internal/DefaultGraphQLExecuter.cs:line 45
at GraphQL.Server.Transports.AspNetCore.GraphQLHttpMiddleware`1.InvokeAsync(HttpContext context) in /_/src/Transports.AspNetCore/GraphQLHttpMiddleware.cs:line 144
at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
我的 Startup.cs - ConfigureServices 方法
<packagereference Include="GraphQL" Version="4.2.0" />
<packagereference Include="GraphQL.MicrosoftDI" Version="4.2.0" />
<packagereference Include="GraphQL.Server.Transports.AspNetCore.NewtonsoftJson" Version="4.4.1" />
<packagereference Include="GraphQL.Server.Ui.Playground" Version="4.4.1" />
配置方法
services.AddSingleton<ISchema,MyDataSchema>(serviceProvider => new MyDataSchema(new SelfActivatingServiceProvider(serviceProvider)));
services.AddGraphQL(options =>
{
options.EnableMetrics = true;
})
.AddNewtonsoftJson()
.AddErrorInfoProvider(opt => opt.ExposeExceptionStackTrace = true);
能否请您建议我如何在 .Net Core 2.2 中使用 GraphQL?
如果您知道我可以参考以使其在 .Net Core 2.2 中工作的程序集/代码/文档的正确组合,请帮助我。我找不到旧文档,而且总是最新版本。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。