2016-12-08 4 views
2

.NET 4.6.2およびMVC v5.2.3で最新の3.0.1 Azure Searchライブラリを実行しています。私の問題は、検索インデックスクライアントが次のコードでエラーを投げていることです。これは、別の.NET 4.5 Webアプリケーションでは発生しません。 Azure検索エラー "継承セキュリティルール違反"

var SearchIndexClient = new SearchIndexClient(AZURE_SEARCH_SERVICE_NAME, AZURE_SEARCH_INDEX_NAME, new SearchCredentials(AZURE_SEARCH_API_KEY));

私はこの記事が見つかりました: https://github.com/dotnet/corefx/issues/11100

関連しているように見えますが、修正の実装では動作しません。私は.NETコアを使用していないので、なぜそれが私に関係しないのかという私の前提です。私はこれを約1週間、最新のAzure Searchパッケージで修正していないので、ここで何か助けを求めています。

エラーの完全なダンプ。

Server Error in '/' Application. 

Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.TypeLoadException: Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible. 

Source Error: 

Line 390:    var SearchIndexClient = new SearchIndexClient(AZURE_SEARCH_SERVICE_NAME, AZURE_SEARCH_INDEX_NAME, new SearchCredentials(AZURE_SEARCH_API_KEY)); 
Line 391:    var Params = new SearchParameters() 
Line 392:    { 

Source File: C:\Users\~stuff\Data\Catalog\style.cs Line: 390 

Stack Trace: 


[TypeLoadException: Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible.] 
Microsoft.Rest.ServiceClient`1.CreateRootHandler() +0 
Microsoft.Azure.Search.SearchIndexClient..ctor(String searchServiceName, String indexName, SearchCredentials credentials) +34 
WebThings.Data.Catalog.<GetByAzureSearch>d__289.MoveNext() in C:\Users\me\Documents\Source Control\Git Repos\Digger Digital\Data\Catalog\style.cs:390 
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28 
WebThings.Sites.Models.<SearchAzure>d__89.MoveNext() in C:\Users\me\Documents\Source Control\Git Repos\Digger Digital\Sites\Models\CategoryDisplay.cs:182 
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +28 
WebThings.Sites.MainSite.Controllers.<Index>d__0.MoveNext() in C:\Users\me\Documents\Source Control\Git Repos\Digger Digital\Sites\MainSite\MainSite\Controllers\SearchController.cs:27 
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 
System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +97 
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +17 
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50 
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225 
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225 
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225 
System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225 
System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10 
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 
System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26 
System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100 
System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13 
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36 
System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12 
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26 
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21 
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29 
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49 
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28 
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +576 
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0 

必要に応じて詳細を記入してください。

+0

症状がGitHubの問題で説明したものとまったく同じであることを考えれば、私はそれが無関係なら非常に驚くでしょう。 .NET 4.6をターゲットとし、同じ問題を抱えている他の人々もいました。私が修正案を待っている間にあなたのバインディングリダイレクトを再確認する以外に何が示唆できるか分からない。 –

+0

1年後、私は同じ問題の修正を見つけようとしています –

答えて

0

System.Net.Httpをバージョン> 4.3.0にアップグレードした場合(最新のバージョンが4.3.3など)、問題は解決しません。

関連する問題