滚动/完成,复制/粘贴时,Visual Studio 2015正在冻结。 [英] Visual studio 2015 is freezing while scrolling up/done, copying/paste.

查看:66
本文介绍了滚动/完成,复制/粘贴时,Visual Studio 2015正在冻结。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了Visual Studio 2015的问题,在滚动/完成,复制/粘贴,右键单击.cs和项目文件时冻结2到5秒。它只发生在拥有超过10000行代码的大型控制器文件(ASP.NET MVC)上。



我尝试了什么:



我重新安装了VS 2015,但问题仍然存在。

解决方案

Vishal Wrote:

它只发生在拥有超过10000行代码的大型控制器文件(ASP.NET MVC)上。


这很正常,如果行数越多,页面的内存就越高,这会导致冻结/慢速,这取决于你的处理器和内存


您可以通过使用部分类部分类将10,000行代码拆分为多个文件来解决此问题 [ ^ ]



Home Controller Partial Class 1

 public partial class HomeController:Controller 
{
public ActionResult Method1()
{
//你的代码
返回View();
}
public ActionResult Method2()
{
//你的代码
返回View();
}
}



Home Controller Partial Class 2



 public partial class HomeController:Controller 
{


public ActionResult Method3()
{
//你的代码
返回View();
}
public ActionResult Method4()
{
//你的代码
返回View();
}


}





家庭控制器Partial Class 3

 public partial class HomeController:Controller 
{

public ActionResult Method5()
{
//您的代码
返回View();
}
public ActionResult Method6()
{
//你的代码
返回View();
}


}


I am getting issue with Visual Studio 2015, it is freezing 2 to 5 seconds while Scrolling up/done, Copying/Paste, right click in .cs and Project File also. Its is happening only with big Controller files (ASP.NET MVC) which has more than 10000 lines of code.

What I have tried:

I reinstalled the VS 2015, but that issue is still there.

解决方案

Vishal Wrote:

Its is happening only with big Controller files (ASP.NET MVC) which has more than 10000 lines of code.


Its quite normal, if the number of lines are more the memory of the page will high which in term results in freeze/slow, It depends on your processor and RAM

You can sort of this issue by splitting the 10,000 lines of code to multiple files using partial class [^]

Home Controller Partial Class 1

public partial class HomeController : Controller
   {
       public ActionResult Method1()
       {
           //  Your code
           return View();
       }
       public ActionResult Method2()
       {
           //  Your code
           return View();
       }
   }


Home Controller Partial Class 2

public partial class HomeController : Controller
   {


       public ActionResult Method3()
       {
           //  Your code
           return View();
       }
       public ActionResult Method4()
       {
           //  Your code
           return View();
       }


   }



Home Controller Partial Class 3

public partial class HomeController : Controller
    {

        public ActionResult Method5()
        {
            //  Your code
            return View();
        }
        public ActionResult Method6()
        {
            //  Your code 
            return View();
        }

      
    }


这篇关于滚动/完成,复制/粘贴时,Visual Studio 2015正在冻结。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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