在MVC应用程序改变输出目录 [英] Changing output directory in MVC Application

查看:93
本文介绍了在MVC应用程序改变输出目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的MVC应用程序的问题后,我设置了不同的输出文件夹,而不是默认的Bin文件夹中。我也删除了bin文件夹。

I am having a problem with my MVC application after I set a different output folder instead of the default Bin folder . I also deleted the bin folder .

这导致Global.asax文件中的异常在应用程序运行无法加载类型Global.Mvc的应用程序。

This resulted in Global.asax file exception "Cannot load the type Global.Mvc application" during application runtime.

我试图摆脱所有的bin文件夹到只有一个输出文件夹我的应用程序。我想知道是否有可能在所有摆脱bin文件夹的完全。我在这里缺少一些设置,或者是一个必须有bin文件夹?

I am trying to get rid of all the bin folders to have just one output folder for my application . I would like to know if it is possible at all to get rid of the bin folder completely . Am I missing some setting here or is it a must to have bin folder ?

推荐答案

我找到一个方法来改变bin文件夹。
就像你说的,当我们更改默认的输出文件夹:BIN \\,那么它​​会显示一些例外,也许这就是从Visual Studio中的错误

I find a way to change bin folder. Just like you say, When we change the default output folder:"bin\", then it will display some exception, Maybe that's a bug from visual studio.

其实很多人都想默认的bin文件夹更改为某个RAM磁盘位置,那么这将节省硬盘寿命(不要让硬盘总是一遍又一遍写),也挺快的读取和写入。

Actually a lot people want to change the default bin folder to some RAM disk position, then it will save HDD life(don't let the HDD always write again and again), also very fast for read and write.

我们无法更改默认地址,但我们可以改变它用这样的方式(删除前bin文件夹):

We can't change the default address, but we can change it use this way(delete bin folder before):

开放的CMD.exe(管理员模式),把这个code和执行:

Open CMD.exe(administrator mode), put this code and execute:

mklink /d "Your project folder\bin" "new address(like RAM disk address)\bin"

MLINK可以重定向原来的文件夹位置,以新的位置。然后,所有的罚款诸如此类你需要的。

mlink can redirect the original folder position to new position. Then, all fine such like you need.

这篇关于在MVC应用程序改变输出目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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