Azure Web角色回收,无法在ChallengeResult.cs中加载入口点“ ExecuteAsync()”

问题描述 投票:1回答:1

因此,它一直像永远一样工作(并且在模拟器中仍然可以正常工作)。

[当我在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工具运行windbg;它没有提供任何线索。我怀疑某个地方的DLL期望使用不同的签名。

但是哪一个?谁叫这个?

奇怪的是,即使角色正在回收,该服务实际上仍在工作。

azure azure-web-roles
1个回答
0
投票

我遇到了同样的问题。由于某些原因,System.Net.Http的绑定重定向有效,从而导致了问题。

为了解决该问题,我已复制了我的web.config,将其重命名为MyProjectName.dll.config,并将Copy to Output Directory设置为Copy always。您可以使用csproj中的BeforeBuild自动执行此操作。

© www.soinside.com 2019 - 2024. All rights reserved.