[英]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.