所以,这一直有效(并且在模拟器中继续正常工作)。
当我在 Azure 中启动经典云服务时,出现以下错误。 ExecuteAsync()
位于 Web 角色中,位于 Results/ChallengeResult.cs
(直到现在我还没有注意到的文件夹)。
Role entrypoint could not be created:
System.TypeLoadException: Unable to load the role entry point due to the following exceptions:
-- System.TypeLoadException: Method 'ExecuteAsync' in type
'MyWebRole.Results.ChallengeResult' from assembly 'MyWebRole, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
当我查看时,ChallengeResult.cs 确实有 ExecuteAsync()
的实现。这是默认实现,其签名如下:
public Task<HttpResponseMessage> ExecuteAsync(CancellationToken cancellationToken)
我使用 RDP 并使用 Azure Tools 来运行 windbg
;它没有提供任何线索。我怀疑某个 DLL 需要不同的签名。
但是哪一个呢?谁叫这个?
奇怪的是,即使角色是回收,该服务实际上仍然有效。
最佳答案
我也遇到了同样的问题。由于某种原因,绑定(bind)重定向对 System.Net.Http 生效,从而导致了该问题。
为了解决这个问题,我复制了 web.config,将其重命名为 MyProjectName.dll.config,并将复制到输出目录
设置为始终复制
。
您可以使用 csproj 中的 BeforeBuild
自动执行此操作。您可以查看WebRole entry point and config file了解更多信息。
关于Azure Web角色回收,无法加载ChallengeResult.cs中的入口点 "ExecuteAsync()",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49289024/