【问题标题】:OData Endpoint with .NET带有 .NET 的 OData 端点
【发布时间】:2023-03-17 07:14:01
【问题描述】:

我正在尝试为数据库中的表值函数创建一个 odata 端点。我确信代码,但是在运行应用程序时我得到了错误

Server Error in '/' Application.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not load type 'ODataService.WebApiApplication'.

Source Error: 


Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="ODataService.WebApiApplication" Language="C#" %>

Source File: /global.asax    Line: 1 

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

我已经验证了程序集路径和我的代码,但是我无法理解这个错误,我被困了 3 个小时。同样的事情。

【问题讨论】:

    标签: c# asp.net visual-studio-2013 odata asp.net-web-api


    【解决方案1】:

    在 web.config 中检查您的程序集绑定。您可能需要这样的东西(或者您可能必须删除一个)。确保所有绑定都指向 bin 文件夹中存在的程序集。

      <dependentAssembly>
        <assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
      </dependentAssembly>
    

    此外,更新 NuGet 包以确保下载并解析所有最新的程序集。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多