Skip to content

IISEXPRESS SLOW #4913

Closed
Closed

Description

@itg-assistant

Angelo Bordonaro asked 2025-12-02 15:48:42 UTC

Hi,

For a few weeks now, I've been developing with the following environments:
VS 2022;
Wisej 3.5
NET framework 4.8
I have datagridviews with columns that I add manually and with the autogeneratecolun option. The grid is bound to the datasource.
I've noticed that in debug mode, opening the form sometimes takes up to 10 seconds. If the application is published on an IIS server, everything works smoothly.
From my tests, it seems to be due to the manual configuration of the columns.
From research, I've read that the problem could be caused by iisexpress, which is slower with newer versions of Wisej.
Any suggestions?

Tanks in advance

Activity

  1. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2025-12-03 15:19:41 UTC

    Hi Angelo,

    what does "open the form" actually mean? Open in the designer or running in debug mode inside Visual Studio?

    Best regards
    Frank

  2. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Angelo Bordonaro answered 2025-12-04 15:50:00 UTC

    Hi Frank,
    When Running in debug mode inside Visual Studio.
    If it helps, I'll briefly describe what the software does when the form opens.

    • The form contains a custom datagridview.
    • The form's MyBase.Load event calls the 'DGV_M_SetColumns' method which adds the columns to the grid:

    Typical code for adding a column

    txtC = New ASNetL.Wsj3.Forms.wDataGridViewTextBoxColumn
    FieldName = "prfvcl_targa"
    With txtC
    .Name = FieldName
    .DataPropertyName = FieldName
    .HeaderText = "PLATE"
    .Width = 150
    .DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft
    .DefaultCellStyle.Format = ""
    .ToolTipText = "Vehicle License Plate"
    .Visible = True
    .FilterEnable = True
    .EditModeOnGrid = ASNetL.Wsj.wEnum.EditModeOnGridEnum.NoEditable
    'I add the column to the grid
    DGV_M_GRD.Columns.Add(txtC)
    End With

    • The MyBase.Shown event of the form calls the 'FILL' method which essentially performs the binding of the grid:

    PgSQL_Conn = New NpgsqlConnection(ConnStr)
    PgSQL_Conn.Open()
    DgvData.Clear()
    PgSQL_Command.Connection = PgSQL_Conn
    PgSQL_Command.CommandText = qry + WhereFlt
    PgSQL_Adapter.SelectCommand = PgSQL_Command
    PgSQL_Adapter.Fill(DgvData)

    dgvBindingSource.DataSource = DgvView
    dgv.AutoGenerateColumns = False
    dgv.DataSource = dgvBindingSource

    In summary, I noticed that the 'DGV_M_SetColumns' method slows down the form display (up to 10 seconds). In fact, if it's commented out (and I don't call it), the form displays quickly. However, this only happens when running with Visual Studio (IISExpress). If the application is deployed on a server (IIS), everything works without any delays.

    Tanks

  3. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2025-12-04 17:52:12 UTC

    Hi Angelo,

    what is the performance when you run your project inside Visual Studio in Release Mode?

    Best regards
    Frank

  4. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Angelo Bordonaro answered 2025-12-05 06:51:59 UTC

    Hi Frank,

    In *Release Mode *I have the same performance.

    I notice that the problem is when then form create the columns on the grid for the first time.

    In fact, if instead of closing the form, I execute the 'Hide' method and subsequently 'Show' the problem does not occur.

    Best regards
    Angelo

  5. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Gabriele1 Del Giovine answered 2025-12-05 07:45:18 UTC

    You don’t have to load the datagridview in the Show event handler.
    Place (or call) the grid columns definition into the form constructor method or into the Load event handler. Also the call the data retrieval/databinding actions into the form Load event handler. So please check the autosize mode of you datagridview. If there are great number of rows into the datagridview datasource the automatic size require extra time to find the max widht of every column scanning every row….

  6. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Frank (ITG) answered 2025-12-09 14:33:00 UTC

    Thanks Gabriele, these are good points. Did you try to move your code from the Show Event handler, Angelo? Best regards, Frank

  7. itg-assistant commented on Jun 17, 2026

    @itg-assistant
    Author

    Angelo Bordonaro answered 2025-12-11 06:42:20 UTC

    I’ve tried all of Gabriele’s suggestions, but the problem persists. As mentioned, the slowdown only occurs when the application runs in VB.net debug, i.e., with IISExpress. If deployed on any server, i.e., IIS, everything runs smoothly. I don’t know if it’s a problem with my PC, Visual Studio, Wisej, or some setting in IIS Express. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions