dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.98k stars 4.66k forks source link

Bug: WinFX.targets was not found #11712

Closed HamedMasafi closed 4 years ago

HamedMasafi commented 5 years ago

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
jkotas commented 5 years ago

This issue was moved to dotnet/cli#10508