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? ....

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,261 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,094 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,480 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,109 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Petrus 【KIM】 456 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