Cannot Place User Control on Form

前端 未结 8 1006
南笙
南笙 2020-12-06 03:48

I\'ve created a C# WinForms application using VS2010. I\'m new to creating user controls so I created a new user control (as part of the same project).

When I rebuil

相关标签:
8条回答
  • 2020-12-06 04:48

    I finally figured this one out.

    The project I'm working with uses two class-library assemblies. Although these have nothing to do with the control I'm discussing, I looked and saw both libraries have Platform Target in the Properties|Build tab set to "Any CPU".

    On the other hand, my application had this setting set to "x64". By changing my application's setting to "Any CPU", I can now place my user controls onto my forms.

    Go figure...

    0 讨论(0)
  • I had this problem too, but the answer couldn't fit for me. My project has some issues it can only target x86 and x64 separately. In other words, I can't use AnyCPU configuration (that's because I reference different libraries for each configuration, since those libraries are not fit to AnyCPU).

    The solution I came up with was: when I need to use the form designer, I change the setting to x86. Do the job, then set back to x64 and test. The problem occurs only with the designer, but the solution builds and runs fine.

    0 讨论(0)
提交回复
热议问题