简体   繁体   English

将DLL控制器添加到ASP.NET MVC项目

[英]Add DLL controller to ASP.NET MVC project

Can I add a compiled DLL to my MVC project? 我可以将编译的DLL添加到我的MVC项目中吗? I tried just adding it without doing any additional route configuration but was not able to access it after running the project. 我尝试仅添加它而不进行任何其他路由配置,但是在运行项目后无法访问它。 I am trying to add a compiled controller for my Web API 2 project. 我正在尝试为我的Web API 2项目添加一个已编译的控制器。

Of course, you can add a compiled DLL to your Web Api 2 project. 当然,您可以将已编译的DLL添加到Web Api 2项目中。 If the configuration route bind your DLL controller actions, you will be able to navigate to them. 如果配置路由绑定了您的DLL控制器操作,您将能够导航到它们。

Just to test, you can create two "Empty Web Api 2" projects and create Test Controllers on both. 为了进行测试,您可以创建两个“ Empty Web Api 2”项目,并在两个项目上创建“测试控制器”。 Then add the DLL reference from one project to the other and check that you can access to the controllers in the referenced project from the main one. 然后将一个项目中的DLL引用添加到另一个项目中,并检查是否可以从主项目访问所引用项目中的控制器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在VS2013中将ASP.NET MVC 5控制器添加到简单的ASP.NET MVC项目 - Cannot add ASP.NET MVC 5 Controller to simple ASP.NET MVC project in VS2013 如何在ASP.NET MVC 5项目中获得“添加控制器”和“添加视图”菜单选项? - How do I get the “Add Controller” and “Add View” menu options in my ASP.NET MVC 5 project? 如何访问ASP.NET MVC项目的bin文件夹中的DLL? - How to access DLL in bin folder of ASP.NET MVC project? 将MapPageRoute添加到asp.net mvc项目后,该站点将停止进入Home Controller - After add MapPageRoute to an asp.net mvc project, the site stops to enter in Home Controller 我想向我的 ASP.NET MVC 项目添加一个控制器,但出现错误 - I want to add a controller to my ASP.NET MVC project, but I get an error 我如何在asp.net 5项目中添加本地dll - How can i add local dll at the asp.net 5 project 在Controller ASP.NET MVC中获取项目根路径? - Getting Project Root Path In Controller ASP.NET MVC? Asp.net MVC项目中的Angularjs调用Web API控制器 - Angularjs in Asp.net MVC project calling web api controller ASP.NET MVC - 向Controller中的RedirectToAction添加查询字符串值 - ASP.NET MVC - Add Query String Value to RedirectToAction in Controller 在 ASP.NET 核心 MVC 中从 controller 添加 session 超时 - Add session timeout from controller in ASP.NET Core MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM