Skip to content

unavailable component's customizations are removed from the .Designer.cs file #14414

@AdmiralSnyder

Description

@AdmiralSnyder

Environment

VS 18.4.1 pro/ent

.NET version

net10

Did this work in a previous version of Visual Studio and/or previous .NET release?

this was not an issue before we moved to .net 9/10, from Framework 4.8

Issue description

Hello,
when a usercontrol that is defined in another assembly that hasn't been built (i.e. the bin directory is empty) is used in a form, the designer removes the instance of that usercontrol without telling the developer, rendering nothing for that usercontrol into the Designer.cs file, apart from the declaration - this leads to nullreferenceexceptions at runtime, when the usercontrol is referenced in the form's source code, and ... well, that usercontrol is missing

Steps to reproduce

  • create two projects in the solution, A and B, where B references A
  • create a usercontrol in project A
  • create a Form in project B, putting the usercontrol from project A onto it
  • build, run, confirm the usercontrol is there.
  • close VS, delete bin and obj folders to simulate a clear
  • open VS, DO NOT REBUILD THE SOLUTION
  • open the projectB.Form in the designer
  • observe the usercontrol is missing

Diagnostics

there is no diagnostic, the missing usercontrol is just ignored. this is a huge problem, since it's not obvious when something is missing, within more complex forms for example. and there's no good way to track when this happened, either. the designer should at least create a (formerly golden) error bar, making it super obvious to the developer that something was missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    💥 regression-frameworkRegression from .NET Frameworkarea-VSDesignerWindows Forms out-of-proc designer related issuesuntriagedThe team needs to look at this issue in the next triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions