C++/CLI V.S error " ClassLibrary.dll isn't a valid win32 application" . Changing startup item .

Wami007 296 Reputation points
2021-04-10T21:50:05.687+00:00

Click to see Error Image.png

Hello Everyone...
I am trying to creat "UserControl" then add it to "MainForm" in C++/CLI. But i found only one solution to add "UserControl" to "MainForm" via creating project as a Class Library.dll ...
But in this case I can't Target Startup Item to Main form to Build .exe and V.S gives an error normally when trying to build "ClassLibrary" . Any Solution for it? ....

Developer technologies | .NET | .NET Runtime
Developer technologies | C++
Developer technologies | .NET | Other
Developer technologies | C#
{count} votes

2 answers

Sort by: Most helpful
  1. Petrus 【KIM】 546 Reputation points
    2021-04-12T09:12:02.05+00:00

    Class Library is not an Executable Program.
    So, You need another Executable .Net Program to execute and test your library.

    86865-image.png

    The red box is user control from c++/cli.

    1 person found this answer helpful.

  2. Wami007 296 Reputation points
    2021-04-13T09:33:51.097+00:00

    If anyone can add UserControl in MainForm (.exe) project Or No way to make it without Seperate (ClassLibrary) tell me please ...

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.