Asp.net mvc 未找到MVC DoddleReports 404

Asp.net mvc 未找到MVC DoddleReports 404,asp.net-mvc,Asp.net Mvc,我最近尝试在我的MVC应用程序中实现DoddleReports功能,就像大约一小时前一样 非常肯定的是,我按照文档进行了T。然而,当我输入我的URL时,它给了我一个404未找到。我通过NuGet安装了这些包,我只需要Excel,所以我添加了OpenXML(以及依赖项) 我的控制器: using System; using System.Data; using System.Collections.Generic; using System.Linq; using System.Web; usin

我最近尝试在我的MVC应用程序中实现DoddleReports功能,就像大约一小时前一样

非常肯定的是,我按照文档进行了T。然而,当我输入我的URL时,它给了我一个404未找到。我通过NuGet安装了这些包,我只需要Excel,所以我添加了OpenXML(以及依赖项)

我的控制器:

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VAGTC.Models;
using VAGTC.ViewModels;
using VAGTC.Helpers;
using DoddleReport.Web;
using DoddleReport;

namespace VAGTC.Controllers
{

    public class reportsController : Controller
    {
        //
        // GET: /Excel/
        VAGTCEntities db = new VAGTCEntities();
        public ActionResult Index()
        {
            return View();
        }

        public ReportResult OrganizationReport()
        {
            var matrix = from d in db.Organizations
                         select d;
            var report = new Report(matrix.ToReportSource());


            return new ReportResult(report);
        }
    }
}
路由配置:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using DoddleReport.Web;

    namespace VAGTC
    {
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapReportingRoute();
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
            );
        }
    }
}
当我用NuGet安装Doddle时,它还自动在web.config中输入所需的内容(而不是视图文件夹中的web.config!)。我在使用MVC配置Doddle的文档中阅读了一条注释,并替换了代码。(但它也不能处理自动生成的代码)。我还不喜欢定制任何东西,因为我只是想先让它工作

那么,404页面怎么会出现呢?这让我觉得这似乎与路由有关,但我不确定具体是什么

非常感谢您的帮助

我在调试模式下使用它-所以这可能是一个原因?这是我正在使用的链接:

编辑*上传到我的网站,但仍然给出404

http://localhost:2530/reports/OrganizationReport.xls
编辑2* 根据@fiorebat给出的论坛帖子,在胡闹之后,改变了一些事情。我在它生成报告后立即对其进行了调试,
var report=new report(matrix.ToReportSource())
返回报告后会出现此错误

No Source Available
There is no source code available for the current location.

Call stack location:
DoddleReport.dll!DoddleReport.ReportBuilder.ToReportSource(System.Collections.IEnumerable source) Line 12

Source file information:
Locating source for 'c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs'. Checksum: MD5 {61 dc e5 8e 25 79 c2 94 c4 27 5b d0 d7 92 56 ae}
The file 'c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs' does not exist.
Looking in script documents for 'c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs'...
Looking in the projects for 'c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\crt\src\vccorlib\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\atlmfc\include'...
Looking in directory 'C:\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs.
The debugger could not locate the source file 'c:\Users\Matt\Development\Projects\DoddleReport\src\DoddleReport\ReportBuilder.cs'.

您需要在web配置文件的system.webServer下添加此配置:

<modules runAllManagedModulesForAllRequests="true" ></modules>

我也有同样的问题,报告没有扩展,我用“RouteDebuggin”调试了路由,它运行正常。DoodleReport插件似乎没有调用正确的操作


谢谢-这有点帮助<代码>var矩阵=数据库中的d。组织选择d当我将此代码更改为
d.OrganizationID
时,页面将加载,但为空。当我刚刚拥有它时
选择d页面位于加载时。我还删除了RouteConfig中的和“ignoreroutes”行。我从示例DoddleReport中准确地复制了产品存储库和其他相关项。当我添加扩展时,它仍然会给我一个404错误。我简化了doddle reports,开发了这个解决方案:一开始有很多代码,但在您可以轻松构建和重用视图操作之后,这根本不是解决方案。你知道设置意味着什么吗?启用它将使每个http请求都通过ASP.NET管道,包括css、文本、javascript、图像。。。这对表演有着巨大的负面影响。我很不高兴看到,这是迄今为止提出的唯一解决办法。如果没有其他方法使其工作,我将被迫放弃doddle报告。对于像我这样的小型流量企业应用程序来说,这不是问题。在另一种情况下,DoodleReports被放弃了,有更好的解决方案,比如用closedxml插件替换openxml