2016-07-27 218 views
2

後,所有oData Web API都會在使用Dynamics CRM 2016的情況下中斷,在導入組織中的非託管解決方案(通過Web API Action ImportSolution,然後PublishAllXml)後,所有Web API都停止工作,並返回以下:在導入解決方案

(例如:https://MyDynamicsServer/MyOrganization/api/data/v8.0/contacts

{ 
    "Message": "Object reference not set to an instance of an object.", 
    "ExceptionMessage": "Object reference not set to an instance of an object.", 
    "ExceptionType": "System.NullReferenceException", 
    "StackTrace": " at Microsoft.OData.Edm.ExtensionMethods.AddAlternateKeyAnnotation(EdmModel model, IEdmEntityType type, IDictionary`2 alternateKey)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataModelProvider.DeclareAlternateKeys(EdmEntityType entityType, EntityMetadata entityMetadata, EdmModel edmModel)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataModelProvider.AddEntitiesToModel(ICollection`1 edmEntitySets, EdmModel model, EdmEntityContainer container)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataModelProvider.AddEntities(Dictionary`2 edmModels, Dictionary`2 containers, DynamicMetadataCache cache)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataModelProvider.InitializeEdmModels(DynamicMetadataCache cache)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataModelProvider.GetEdmModel(ModelVisibility requestedEdmType)\r\n at Microsoft.Crm.Extensibility.OData.CrmEdmModel.get_InternalEdmModel()\r\n at Microsoft.Crm.Extensibility.OData.CrmEdmModel.get_EntityContainer()\r\n at Microsoft.OData.Edm.ExtensionMethods.FindDeclaredEntitySet(IEdmModel model, String qualifiedName)\r\n at Microsoft.OData.Edm.ExtensionMethods.FindDeclaredNavigationSource(IEdmModel model, String qualifiedName)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.TryCreateSegmentForNavigationSource(String identifier, String parenthesisExpression)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.CreateFirstSegment(String segmentText)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.ParsePath(ICollection`1 segments)\r\n at Microsoft.OData.Core.UriParser.Parsers.ODataPathFactory.BindPath(ICollection`1 segments, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.Core.UriParser.ODataUriParser.Initialize()\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath, ODataUriResolverSetttings resolverSettings, Boolean enableUriTemplateParsing)\r\n at System.Web.OData.Routing.DefaultODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)\r\n at Microsoft.Crm.Extensibility.OData.CrmODataPathHandler.Parse(IEdmModel model, String serviceRoot, String odataPath)\r\n at System.Web.OData.Routing.ODataPathRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, String parameterName, IDictionary`2 values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.ProcessConstraint(HttpRequestMessage request, Object constraint, String parameterName, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.ProcessConstraints(HttpRequestMessage request, HttpRouteValueDictionary values, HttpRouteDirection routeDirection)\r\n at System.Web.Http.Routing.HttpRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)\r\n at System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)", 
    "ErrorCode": 500 
} 

這是至關重要的,因爲它使我們的自定義不可用! (同時也阻止了我們自動導入自定義,因爲這個過程中使用Web API)

需要注意的是相同的解決方案已在其他組織中被導入沒有問題,以同樣的方式...

的解決方案通過進口界面仍然有效,但是這完全破壞了我們自動化管道的重要性......

有沒有人遇到過這個問題?我應該在哪裏看?

(注:我也張貼了這個問題在這裏:https://community.dynamics.com/crm/f/117/t/206996

+1

您可能想要打開一個支持票與MSFT這一 –

+0

同意Matt Dearing。 –

回答

0

看來你的OData未啓用或不支持。請檢查通過

Settings => Customizations => Developer Resources