VB.NET SLOW Compilation time - no disk or processor activity

We have a project for a client written in VB.NET. In one of the projects, we have about 100 modules, which are all very simple. These are extension methods that convert between types of objects. Here is a small snippet:

Public Module ScheduleExtensions

<System.Runtime.CompilerServices.Extension()> _
Public Function ToServicesData(ByVal source As Schedule) As ScheduleServicesData
    If (source IsNot Nothing) Then
        Dim target As New ScheduleServicesData
        With target
            .CenterId = source.CenterId
            .EmployeeGuid = source.EmployeeGuid
            .EndDateTime = source.EndDateTime

The problem is that this project takes only 2 minutes. I ran diskmon and filemon, and it does not gain access to the file system while the assembly seems to be hanging. In most cases, CPU usage is also low. After about 2 minutes, the assembly is completed, and there is disk and processor activity. The problem can be reproduced on any machine (4 attempts so far).

I got to compiling the project using the vbc command line, and the problem also exists.

- VB.NET, ? , , , looping/get/setting ..

+3
2

, , , , , . , , , - , , VS, .

, , .

+1

, , . , . , , , .

,

, , .

0

Source: https://habr.com/ru/post/1714977/


All Articles