为什么我们在MVC4中创建WebAPI时会有两个web.config文件?两者都需要吗? [英] Why we have two web.config file when we create WebAPI in MVC4? Is both needed?

查看:61
本文介绍了为什么我们在MVC4中创建WebAPI时会有两个web.config文件?两者都需要吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用MVC4创建了Web API。它工作正常。但是,我在视图文件夹下有web.config文件,外部还有另一个web.config文件。







我们默认需要两个web.config文件吗?如果是,为什么我们有两个web.config文件?



谢谢,

Hi,

I created Web API using MVC4. It works fine. But, i have web.config file under the views folders and also another web.config file externally.



do we need both web.config file by default? if it is, why we have two web.config file ?

Thanks,

推荐答案

我认为views文件夹下的web.config阻止视图直接访问(而不是通过控制器)。



希望它有所帮助。
I think the web.config under the views folder prevents the views being access directly (instead of via the controller).

Hope it helps.


这篇关于为什么我们在MVC4中创建WebAPI时会有两个web.config文件?两者都需要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆