MVC应用程序是建立非常缓慢 [英] MVC Application is extremely slow to build

查看:121
本文介绍了MVC应用程序是建立非常缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个Visual Studio MVC-4项目。这需要大约2分钟来构建解决方案,这是没有意义的。这是5个项目,有少量(小于几百)在每个项目文件小的解决方案。为了比较,我们有一个项目,该项目是这个项目(Web表单),它建立在不到3秒我的电脑上的大小10-15次。

I am working on a Visual Studio MVC-4 project. It takes approximately 2 minutes to build the solution, which makes no sense. It is a small solution with 5 projects, with few (less than a few hundred) files in each project. To compare, we have a project which is 10-15 times the size of this project (Web forms), which builds in less than 3 seconds on my computer.

我听说我们从MVC2迁移到MVC4,而球队记住的解决办法是要快得多迁移之前,但他们不能准确地记住它。

I have heard we migrated from MVC2 to MVC4, and the team remembers the solution was much faster before the migration, but they can't exactly remember it.

这不仅是我的电脑上,但对球队的计算机的其余部分。我是pretty确保它在解决方案文件弄好了。

It is not only on my computer, but the rest of the computers on the team. I am pretty sure it is in the solution file somehow.

我们只有1后生成事件,并没有影响到其删除。

We only have 1 post build event, and it has no effect to remove it.

怎样做任何想法?

我试图

符号的:

我在这里读了岗位上SO,有关设置符号在本地运行,而不是服务器。我做的是:

I read a post here on SO, about setting symbols to run locally instead of server. I've done that:

启用只是我的code
确保只有我的code调试:

Enable "just my code" Make sure only my code is debugged:

删除临时文件夹

删除我的计算机上的所有不同的临时文件夹左右。

Deleted all the different temp folders around on my computer.

解决方案文件

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Data", "Data", "{C337490A-F7A8-4800-9BD3-668F5231AE2D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{58E3725E-75D2-4AB0-A693-D482152A28E5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Business", "Business", "{8999D8ED-77FD-42F4-A11A-F6F3B4224A41}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C1BC5D04-B71F-4E66-9C2F-352ED8A0AF84}"
    ProjectSection(SolutionItems) = preProject
        Saxo.Application.Publish.build = Saxo.Application.Publish.build
    EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Database", "Database", "{8F63871C-600E-49E5-9858-D3023485CD06}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Changescripts", "Changescripts", "{B3F72D6C-35EF-4D82-ACB9-5DCAE8F0BCA1}"
    ProjectSection(SolutionItems) = preProject
        30042013-DescriptionNotNull.sql = 30042013-DescriptionNotNull.sql
        AlterContentTextsAddAllowHtml.txt = AlterContentTextsAddAllowHtml.txt
        AlterInvoiceAccountsAddVismaSupplierId.sql = AlterInvoiceAccountsAddVismaSupplierId.sql
        AlterProjectsAddCategorySelfPublisher.sql = AlterProjectsAddCategorySelfPublisher.sql
    EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOMENAME", "SOMENAME", "{903F385F-C309-4189-BE1C-1598BEF9FBE6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOMENAME", "SOMENAME", "{797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOMENAME", "SOMENAME", "{BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOMENAME", "SOMENAME", "{EA172A15-6AE4-4358-8DB9-B75F6CC20458}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5E4C1C3C-AB57-49E6-8C7B-1E69CD3FBF67}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SOMENAME", "SOMENAME", "{97B74D41-8B99-4782-9B64-60BA180ED667}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Debug|Mixed Platforms = Debug|Mixed Platforms
        Debug|x86 = Debug|x86
        Release|Any CPU = Release|Any CPU
        Release|Mixed Platforms = Release|Mixed Platforms
        Release|x86 = Release|x86
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Debug|x86.ActiveCfg = Debug|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Release|Any CPU.Build.0 = Release|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {903F385F-C309-4189-BE1C-1598BEF9FBE6}.Release|x86.ActiveCfg = Release|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Debug|x86.ActiveCfg = Debug|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Release|Any CPU.Build.0 = Release|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85}.Release|x86.ActiveCfg = Release|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Debug|x86.ActiveCfg = Debug|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Release|Any CPU.Build.0 = Release|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8}.Release|x86.ActiveCfg = Release|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Debug|x86.ActiveCfg = Debug|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Release|Any CPU.Build.0 = Release|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458}.Release|x86.ActiveCfg = Release|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Debug|x86.ActiveCfg = Debug|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Release|Any CPU.Build.0 = Release|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Release|Mixed Platforms.Build.0 = Release|Any CPU
        {97B74D41-8B99-4782-9B64-60BA180ED667}.Release|x86.ActiveCfg = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(NestedProjects) = preSolution
        {BA8847A7-5EFB-4E1B-A689-4BBC4B6183D8} = {C337490A-F7A8-4800-9BD3-668F5231AE2D}
        {903F385F-C309-4189-BE1C-1598BEF9FBE6} = {58E3725E-75D2-4AB0-A693-D482152A28E5}
        {797DCD60-C9C4-4AB4-98FE-2CBB02AA4A85} = {8999D8ED-77FD-42F4-A11A-F6F3B4224A41}
        {EA172A15-6AE4-4358-8DB9-B75F6CC20458} = {8999D8ED-77FD-42F4-A11A-F6F3B4224A41}
        {B3F72D6C-35EF-4D82-ACB9-5DCAE8F0BCA1} = {8F63871C-600E-49E5-9858-D3023485CD06}
        {97B74D41-8B99-4782-9B64-60BA180ED667} = {5E4C1C3C-AB57-49E6-8C7B-1E69CD3FBF67}
    EndGlobalSection
EndGlobal

过程监控

我已经运行过程监控,只能看着 cnc.exe 。这是我的结果是:

I've run the process monitor, only looking at cnc.exe . This is my result:

这似乎以下记录奔跑一遍,一遍又一遍。

It seems the following records runs again, again and again.

推荐答案

一个可能的原因是你的编译时间很长,你必须有< MvcBuildViews> 集为真,这将编译你的意见,并提醒您在您的视图中的任何语法错误。因为你可以有大量的意见,这个过程可以延长你的编译时间显著(分VS秒)。 这里是一个网站这将解释如何打开/关闭MvcBuildViews属性的链接。如果网站出现故障,你基本上下面的行添加到您的解决方案文件:

One possible reason that your compile time is so long is that you have have <MvcBuildViews> set to true, which will compile your views and alert you to any syntax errors in your view. Because you can have a large number of views, this process can lengthen your build time significantly (minutes vs seconds). Here is a link to a site which will explain how to turn off/on the MvcBuildViews attribute. In case the site goes down, you basically add the following line to your solution file:

启用

<MvcBuildViews>true</MvcBuildViews>

禁用

<MvcBuildViews>false</MvcBuildViews>

但是(自以为是的谩骂来)我不同意他的时候,你应该使用此功能。他说,你应该启用该属性只针对发布/生产,而我认为,你应该只把它启用调试配置。大多数开发人员将充分测试在调试自己的Web应用程序,然后,然后才切换到释放和推动。为什么一个不希望在调试模式下编译时检查时,这是你在做...调试和检查错误/缺陷是什么?

However (opinionated diatribe coming) I disagree with him on when you should use this feature. He states you should have this attribute enabled only for Release/Production while I think that you should only have it enabled for Debug configurations. Most developers will fully test their web apps in Debug and then and only then switch to Release and push. Why would one not want to have a compile time check in Debug mode when that is what you are doing...debugging and checking for errors/bugs?

这篇关于MVC应用程序是建立非常缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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