Results 1 to 3 of 3

Thread: while upgrading my project i am getting mentioned error.

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2024
    Posts
    2

    while upgrading my project i am getting mentioned error.

    git\Schematics and Interfaces\AVEVA PID\ACAD2025-Fix2\Main\AVEVA.GUI\Explorer\SymbolExplorer.Designer.cs(580,38,580,49): error CS0234: The type or namespace name 'ContextMenu' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?)

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,665

    Re: while upgrading my project i am getting mentioned error.

    First things first, please do better with your questions in future. You should write the question first, providing a FULL and CLEAR explanation of the issue, and only then write a tile that is a summary of what's in the post. No one should actually have to read the title to understand the problem. It's a way to know whether a problem is relevant when looking at a list of threads. When I say "FULL", I mean "FULL". You need to provide ALL the relevant details. Upgrading your project how exactly? i think I can guess in this case but I shouldn't have to guess and I might be wrong. If you'd like us to volunteer our time and effort to help you, the least you can do is spend your time and effort to help us do so.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,665

    Re: while upgrading my project i am getting mentioned error.

    As for the issue, I'm assuming that you're changing the target framework of your app from some version of .NET Framework to .NET Core (including .NET 5 and later). There were a number of controls and components in Windows Forms that were essentially replaced and deprecated in .NET 2, all the way back in 2005. These include:

    DataGrid => DataGridView
    ToolBar => ToolStrip
    MainMenu => MenuStrip
    ContextMenu => ContextMenuStrip

    The old options should not have been used in any new work and should have been replaced by the new options before now. Windows Forms was originally not going to be part of .NET Core but, when it became apparent that a large number of developers were still going to use it anyway, they relented and migrated it starting with .NET Core 3. Those old WinForms controls were not included in the migration though, so if you want to target a recent version of .NET, you have no choice but to use the newer controls. I would suggest that upgrade to .NET Framework 4.8.1 if you haven't already, then replace any of the old controls you're using one by one, then upgrade to .NET 8.

    Note that all WinForms controls originally had a ContextMenu property to which you could assign a ContextMenu object that would be displayed when you right-clicked that control. .NET Framework 2.0 added the ContextMenuStrip class and the corresponding ContextMenuStrip property that did the same thing.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width