I need to compile simple WPF application, which I have written using Visual Studio, with the command line C# compiler (i.e csc.exe
).
Problem is the error CS0103
— the compiler says that there is no InitializeComponent()
method in my program. But that's wrong, because I add System.Xaml.dll. Does anybody know how to solve this?
Commanding is an input mechanism in Windows Presentation Foundation (WPF) which provides input handling at a more semantic level than device input. Examples of commands are the Copy, Cut, and Paste operations found on many applications.
Right click on your WPF project in Solution Explorer and select properties. It will display the Window given below. Select Debug option and write the file path in the command line argument.
Option 1: . NET Core 3.0's support for WPF, a WPF application can run on Linux under Wine. Wine is a compatibility layer which allows Windows applications on Linux and other OSes, including . NET Core Windows applications.
Building with MSBuild will be the easier path than with csc.exe. Get the path to the correct MSBuild (Path to MSBuild), since you can have multiple MSBuild versions on your computer, most of the time one per Visual Studio installation.
Then, simply build your project file:
msbuild YourProject.csproj /p:Configuration=Release
and the output will be in the bin/Release folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With