我正在尝试设置现有的Web API项目以使用OWIN Self-Host,类似于: http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api
我遇到了与Windows Azure Media Service SDK相关的问题。当我尝试在Microsoft.WindowsAzure.MediaServices.Client.CloudMediaContext中调用以下方法时:
_context = new CloudMediaContext(credentials);
var account = _context.StorageAccounts.Where(obj => obj.Name == "accountName").FirstOrDefault() //error
我收到以下错误:
System.MissingMethodException未被用户代码处理 的HResult = -2146233069 Message =找不到方法:'Microsoft.Data.OData.IODataRequestMessage System.Data.Services.Client.SendingRequest2EventArgs.get_RequestMessage()'。 来源= Microsoft.WindowsAzure.MediaServices.Client 堆栈跟踪: 在Microsoft.WindowsAzure.MediaServices.Client.OAuth.OAuthDataServiceAdapter.OnSendingRequest(Object sender,SendingRequest2EventArgs e) 在System.EventHandler
1.Invoke(Object sender, TEventArgs e) at System.Data.Services.Client.DataServiceContext.FireSendingRequest2(SendingRequest2EventArgs eventArgs) at System.Data.Services.Client.RequestInfo.FireSendingRequest2(SendingRequest2EventArgs eventArgs) at System.Data.Services.Client.ODataRequestMessageWrapper.FireSendingRequest2(Descriptor descriptor) at System.Data.Services.Client.DataServiceRequest.CreateExecuteResult(Object source, DataServiceContext context, AsyncCallback callback, Object state, String method) at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents) at System.Data.Services.Client.DataServiceQuery
1.Execute() 在System.Data.Services.Client.DataServiceQuery1.GetEnumerator() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1来源) at System.Data.Services.Client.DataServiceQueryProvider.ReturnSingleton [TElement](表达式表达式) 在System.Data.Services.Client.DataServiceQueryProvider.Execute [TResult](表达式表达式) 在Microsoft.WindowsAzure.MediaServices.Client.MediaQueryProvider1.Execute[TResult](Expression expression) at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable
1来源) AzureMediaService.cs中的MediaCloud.Azure.Stores.Azure.AzureMediaService.GetStorageAccounts(String [] storageAccounts):第239行 在AzureMediaService.cs中的MediaCloud.Azure.Stores.Azure.AzureMediaService..ctor(String mediaSvcAccountName,String mediaSvcAccountKey,String inputAccounts,String outputAccounts)中:第78行 在lambda_method(Closure,IBuilderContext) 在Microsoft.Practices.ObjectBuilder2.DynamicBuildPlanGenerationContext。<> c__DisplayClass1.b__0(IBuilderContext context) 在Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) 在Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) 在Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) InnerException:
我想我的问题是:Azure Media Service SDK是否支持此自托管方案,以及是否有针对此情况的解决方法。