'System.Web.UI.WebControls.GridView' does not contain a definition for 'ItemType'

Anonymous
2024-06-18T07:32:43+00:00

We're using asp.net framework 4.8 and when publishing it, the aspnet_compiler.exe outputs this error multiple times:

'System.Web.UI.WebControls.GridView' does not contain a definition for 'ItemType' and no extension method 'ItemType' accepting a first argument of type 'System.Web.UI.WebControls.GridView' could be found (are you missing a using directive or an assembly reference?)

It doesn't show these compile errors when we build each project in the solution where it is updatable. But when running aspnet_compiler.exe to make it non-updatable, that is where it shows the compile errors.

Here's an example of when aspnet_compiler.exe is run:

C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -p obj\Release\AspnetCompileMerge\Source -c -d obj\Release\AspnetCompileMerge\TempBuildDir

Here is the version info for aspnet_compiler.exe:

aspnet_compiler.exe /? 

Microsoft (R) ASP.NET Compilation Tool version 4.8.9037.0 

Utility to precompile an ASP.NET application 

Copyright (C) Microsoft Corporation. All rights reserved. 

Usage: 

aspnet_compiler [-?] [-m metabasePath | -v virtualPath [-p physicalDir]] 

                [[-u] [-f] [-d] [-fixednames] targetDir] [-c] 

                [-x excludeVirtualPath [...]] 

                [[-keyfile file | -keycontainer container] 

                     [-aptca] [-delaySign]] 

                [-errorstack] 

-?            Prints this help text. 

-m            The full IIS metabase path of the application. This switch cannot be combined with the -v or -p switches. 

-v            The virtual path of the application to be compiled (e.g. "/MyApp"). If -p is specified, the physical path 

              is used to locate the application. Otherwise, the IIS metabase is used, and the application is assumed to 

              be in the default site (under "/LM/W3SVC/1/Root"). This switch cannot be combined with the -m switch. 

-p            The physical path of the application to be compiled. If -p is missing, the IIS metabase is used to locate 

              the app. This switch must be combined with -v. 

-u            If specified, the precompiled application is updatable. 

-f            Overwrites the target directory if it already exists. Existing contents are lost. 

-d            If specified, the debug information is emitted during compilation. 

targetDir     The physical path to which the application is compiled. If not specified, the application is precompiled 

              in-place. 

-c            If specified, the precompiled application is fully rebuilt. Any previously compiled components will be 

              re-compiled. This option is always enabled when targetDir is specified. 

-x            The virtual path of a directory that should be excluded from precompilation. This switch can be used 

              multiple times. 

-keyfile      The physical path to the strong name key file. 

-keycontainer Specifies a strong name key container. 

-aptca        If specified, the strong-name assembly will allow partially trusted callers. 

-delaysign    If specified, the assembly is not fully signed when created. 

-fixednames   If specified, the compiled assemblies will be given fixed names. 

-nologo       Suppress compiler copyright message. 

-errorstack   Shows extra debugging information that can help debug certain conditions. 

Examples: 

The following two commands are equivalent, and rely on the IIS metabase. The compiled application is deployed to 

c:\MyTarget: 

    aspnet_compiler -m /LM/W3SVC/1/Root/MyApp c:\MyTarget 

    aspnet_compiler -v /MyApp c:\MyTarget 

The following command compiles the application /MyApp in-place. The effect is that no more compilations will be needed 

when HTTP requests are sent to it: 

    aspnet_compiler -v /MyApp 

The following command does *not* rely on the IIS metabase, as it explicitly specifies the physical source directory of 

the application: 

    aspnet_compiler -v /MyApp -p c:\myapp c:\MyTarget
Windows for business Windows Server Devices and deployment Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes
Accepted answer
  1. Anonymous
    2024-06-19T00:56:40+00:00

    Hello

    Thank you for posting in Microsoft Community forum.

    Based on the description, I understand your question is related to asp.net framework 4.8.

    Since there are no engineers dedicated to asp.net framework 4.8 in this forum. in order to be able to get a quick and effective handling of your issue, I recommend that you repost your question in the Q&A forum, where there will be a dedicated engineer to give you a professional and effective reply.

    Here is the link for Q&A forum.

    Questions - Microsoft Q&A

    Click the "Ask a Question" button in the upper right corner to post your question and select any tags related to your productions.

    Thank you for your understanding and support. If you have any question or concern, please feel free to let us know.

    Have a nice day.

    Best Regards,

    Molly

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful