ASP.NET MVC认为我的虚拟目录是一个控制器 [英] ASP.NET MVC thinks my virtual directory is a controller
问题描述
我在我的MVC的网站在IIS虚拟目录名为文件。此目录是在同一水平作为我的浏览目录。当我将文件目录下链接到一个文件从我的MVC应用程序到一个文件中,我得到以下错误:
I have a virtual directory under my MVC website in IIS called "Files". This directory is at the same level as my Views directory. When I link to a file from my MVC app to a file under my Files directory, I get the following error:
有关路径控制器
/Files/Images/1c7f7eb8-5d66-4bca-a73a-4ba6340a7805.JPG
没有被发现,或者不执行
一个IController。
The controller for path '/Files/Images/1c7f7eb8-5d66-4bca-a73a-4ba6340a7805.JPG' was not found or does not implement IController.
据认为我的文件VD是一个控制器。如何访问我的文件,像一个正常的VD不干扰MVC?
It thinks that my Files VD is a controller. How do I access my files like a normal VD without MVC interfering?
感谢。
推荐答案
ASP.Net查找目录,然后再尝试匹配的控制器,你在做什么等等应该工作。你确定与该名称的文件存在并且可访问?
ASP.Net looks for the directory first and then tries to match a controller, so what you are doing should work. Are you sure the file with that name exists and is accessible?
这篇关于ASP.NET MVC认为我的虚拟目录是一个控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!