建立库后,VS 2019每次冻结 [英] VS 2019 freezes every time after a library is built

查看:99
本文介绍了建立库后,VS 2019每次冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从切换到VS 2019后,我遇到了一种奇怪的行为。当我构建一个C#库时,看起来输出窗口中的构建过程已经完成(在构建批处理输出在输出窗口中可见),但是然后整个IDE冻结大约5-20
秒,在最后一行之前

I experience a strange behavior since switching to VS 2019. When I build a C# library, it looks like the build process in the output window went through (post build batch output is visible in the output window), but then the whole IDE freezes for about 5-20 seconds, before the last line

" =========构建:1成功,0失败, 0最新,0跳过=========="

"========= Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped =========="

出现。我在以前版本的VS中从未遇到过这个问题并且没有更改解决方案参数(虽然我安装了带VS 2019的IncediBuild,但还没有使用它)。这种行为是可重复的。

appears. I never had this problem in previous versions of VS and did not change the solution parameters (though I installed IncediBuild with VS 2019, but did not use it yet). The behavior is repeatable.

我在论坛中看到很多关于类似构建冻结问题的问题,但它们都很老了,并且引用了旧版本的VS.

I saw a lot of questions in the forum regarding similar build freezing problems, but they're all quite old and refer to older versions of VS.

欢迎任何提示:)

Any hint is welcome :)

推荐答案

朋友,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

>> 整个IDE冻结约5-20秒

在5-20秒内你可以' t单击vs中的任何菜单按钮,这意味着你必须杀死实例或等待?我在VS2017和VS2019都做了一些测试,但无法重现这个问题。

During the 5-20 seconds you can't click any menu button in vs, which means you have to kill the instance or wait? I've done some tests in both VS2017 and VS2019 but can't reproduce that issue.

请尝试以下建议检查扩展是否有所不同:

1。在Windows"开始"菜单中,打开开发人员命令提示符,输入  devenv / SafeMode 以在
中运行VS
安全模式
。通过这种方式,vs仅加载默认服务并禁用扩展名

1. In Windows Start menu, open developer command prompt, enter devenv /SafeMode to run VS in Safe Mode. In this way, the vs only load the default service with extensions disabled

2。创建一个简单的控制台项目(.net fx4.7.2),其Main函数使用以下代码:

2. Create a simple console project(.net fx4.7.2) in whose Main function uses code below:

static void Main(string[] args)
        {
            Console.WriteLine("start");
            Thread.Sleep(5000);
            Console.WriteLine("finish");
        }

然后在其构建后事件添加命令中创建一个新的ClassLibrary项目,如:

Then create a new ClassLibrary project, in its post-build event add command like:

call

call


(ProjectDir)Console.exe 
(ProjectDir)Console.exe 

构建类库项目以进行检查如果问题再次发生

Build the class library project to check if the issue occurs again

在我看来:

您可能在构建后事件中添加一些命令,这需要花费太多时间来执行,然后真正的构建过程被阻止,以其他方式挂起。如果你分享一些关于你在构建事件中做什么的细节可能会更好。

You maybe add some command in post-build event which takes too much time to execute, then the real build process is blocked, in other way hangs up. It could be better if you share some details about what you do in the build-event.

另外,我不确定你所说的冻结是否是这样的场景:

#1.Start Build,"Build started:Project:NetFreeze,Configuration:Debug Any CPU ------"显示

#1.Start Build, "Build started: Project: NetFreeze, Configuration: Debug Any CPU ------" displays

#2.等待5-20秒

#3。"====构建:1成功,0失败,0升到目前为止,0跳过===="显示

#3."==== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ====" displays

如果是这样,这是正常行为。由于构建输出不是实时输出。在构建过程完成之前,不会显示构建详细信息和结果日志。但是如果我们使用post-build来执行一些消耗时间的任务,这会使进程
挂起。在执行任务完成之前,日志无法显示。

If so, this is normal behavior. Since the build output is not real-time output. The build details and result log won't display until the build process is finished. But if we use the post-build to execute some consuming-time task, which makes the process hangs up. The log can't show until the execution task finishes.

希望以上所有有帮助,如果我的回复有帮助,请给我一个反馈:)

Hope all above helps, if my reply is helpful or not please give me a feedback :)

最好的问候

Lance


这篇关于建立库后,VS 2019每次冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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