_From @HamedMasafi on December 25, 2018 8:31_
I have installed dotnet core 3 preview on opensuse leap 15.0
The file that I downloaded is: https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.0.100-preview-009812-linux-x64-binaries
I've try to build an app:
hamed@linux-f1fa:~/tmp/> mkdir -p dwin && cd dwin
hamed@linux-f1fa:~/tmp/dwin> /opt/apps/dotnet/dotnet new winforms
Welcome to .NET Core!
---------------------
Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs
Telemetry
---------
The .NET Core tools collect usage data in order to help us improve your experience. The data is anonymous. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establishing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
Getting ready...
The template "Windows Forms Application" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/hamed/tmp/dwin/dwin.csproj...
Restoring packages for /home/hamed/tmp/dwin/dwin.csproj...
Installing Microsoft.NETCore.DotNetAppHost 3.0.0-preview-27122-01.
Installing Microsoft.NETCore.DotNetHostResolver 3.0.0-preview-27122-01.
Installing NETStandard.Library 2.0.3.
Installing Microsoft.NETCore.DotNetHostPolicy 3.0.0-preview-27122-01.
Installing Microsoft.NETCore.Platforms 3.0.0-preview.18571.3.
Installing Microsoft.NETCore.Platforms 2.0.0.
Installing Microsoft.NETCore.Targets 2.0.0.
Installing Microsoft.NETCore.App 3.0.0-preview-27122-01.
Installing Microsoft.WindowsDesktop.App 3.0.0-alpha-27128-4.
Installing runtime.linux-x64.Microsoft.NETCore.DotNetAppHost 3.0.0-preview-27122-01.
Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostResolver 3.0.0-preview-27122-01.
Installing runtime.linux-x64.Microsoft.NETCore.DotNetHostPolicy 3.0.0-preview-27122-01.
Installing runtime.linux-x64.Microsoft.NETCore.App 3.0.0-preview-27122-01.
Generating MSBuild file /home/hamed/tmp/dwin/obj/dwin.csproj.nuget.g.props.
Generating MSBuild file /home/hamed/tmp/dwin/obj/dwin.csproj.nuget.g.targets.
Restore completed in 4.87 min for /home/hamed/tmp/dwin/dwin.csproj.
Restore succeeded.
hamed@linux-f1fa:~/tmp/dwin> /opt/apps/dotnet/dotnet run
/opt/apps/dotnet/sdk/3.0.100-preview-009812/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.targets(14,2): error MSB4019: The imported project "/opt/apps/dotnet/sdk/3.0.100-preview-009812/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFX.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/home/hamed/tmp/dwin/dwin.csproj]
The build failed. Please fix the build errors and run again.
The file exists but in other case:
/opt/apps/dotnet/sdk/3.0.100-preview-009812/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinFx.targets
The 'x' on WinFx is lower but dotnet expect to it be upper.
I've created a copy with this command but I know is not good way for solving bugs
cp /opt/apps/dotnet/sdk/3.0.100-preview-009812/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.WinF{x,X}.targets
_Copied from original issue: dotnet/coreclr#21673_
We don't support compiling winforms and wpf outside of windows. This is by design.
Is it there in future scope of .Net core to support building Winforms outside Windows?
@vikashatri not at the moment.
@livarcocc you're not able to build them outside Windows but you should be able to run them on let's say a Raspberry Pi right?
No. I don't believe we currently have the WindowsDesktop runtime available for a Pi. I would ask the question at dotnet/winforms.
I got this error message when trying to build a Windows Forms Application on Windows using .NET 5.0 alpha. Is this a known issue?
@Logerfo I have the same issue with SDK 3.1.201...
I could reproduce this issue in Linux (monodevelop)
The main problem is, even or a Gtk# project, the WinFX.targets file is included, even if its targets are stubbed or ignored.
Linux has a strictly case-sensitive file system, and the real file name is WinFx.targets
, where the import directive expects WinFX.targets
. A workaround is to create a symlink in the same directory varying only that one capital letter, but the real fix is to be strict regarding the casing of MSBuild files includes even if we are used to work on Windows.
Bug confirmed on 3.1.201 building a pure netstandard target with no project or package imports. It's trying to include msbuild stubs but the name is wrong.
The causes problem on Mac OS X case-sensitive systems also. Making symlinks for both the target and the props file to the correct case is a workaround (not a fix).
e.g.
cd /usr/local/share/dotnet/sdk/3.1.200/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets
sudo ln -s Microsoft.WinFx.targets Microsoft.WinFX.targets
sudo ln -s Microsoft.WinFx.props Microsoft.WinFX.props
or
cd /usr/share/dotnet/sdk/3.1.404/Sdks/Microsoft.NET.Sdk.WindowsDesktop/targets/
Most helpful comment
I could reproduce this issue in Linux (monodevelop)
The main problem is, even or a Gtk# project, the WinFX.targets file is included, even if its targets are stubbed or ignored.
Linux has a strictly case-sensitive file system, and the real file name is
WinFx.targets
, where the import directive expectsWinFX.targets
. A workaround is to create a symlink in the same directory varying only that one capital letter, but the real fix is to be strict regarding the casing of MSBuild files includes even if we are used to work on Windows.