Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildDotnetModule: error NETSDK1100: set the EnableWindowsTargeting property to true #63

Open
milahu opened this issue Jun 21, 2024 · 0 comments

Comments

@milahu
Copy link
Owner

milahu commented Jun 21, 2024

/nix/store/3p2v489xyw5kzbrc4mk1mya8sdbcpkyx-dotnet-sdk-6.0.421/
sdk/6.0.421/Sdks/Microsoft.NET.Sdk/targets/
Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5):
error NETSDK1100:
To build a project targeting Windows on this operating system,
set the EnableWindowsTargeting property to true.
[/tmp/deps-audioalign-RgzrB2/src/AudioAlign/AudioAlign.csproj]

AudioAlign.csproj

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0-windows</TargetFramework>
    <OutputType>WinExe</OutputType>
    <UseWPF>true</UseWPF>

looks like a "windows only" project

lets cross-compile and run with wine

buildDotnetModule {
  postPatch = ''
    substituteInPlace AudioAlign/AudioAlign.csproj \
      --replace \
        "<TargetFramework>net6.0-windows</TargetFramework>" \
        "<TargetFramework>net6.0-windows</TargetFramework><EnableWindowsTargeting>true</EnableWindowsTargeting>" \
  '';
$ ./result/bin/AudioAlign
You must install or update .NET to run this application.

App: /nix/store/52r8m784kq37b8vpgqd9x892w9975n9r-audioalign-1.7.0/lib/audioalign/AudioAlign
Architecture: x64
Framework: 'Microsoft.WindowsDesktop.App', version '6.0.0' (x64)
.NET location: /nix/store/l382qszrramhs6x8iqjkjl7fgizlyjy9-dotnet-runtime-6.0.29

No frameworks were found.

Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed

To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=6.0.0&arch=x64&rid=nixos.24.05-x64

hmm ... now how to run wine dotnet.exe AudioAlign

WineHQ - .NET Framework

Installing .NET 6.0 in wine?

winetricks -q dotnetdesktop6

Installing .NET 4.0 Framework on Wine using Winetricks

winetricks list-installed

How to actually use .NET Framework under Wine environemnt?

https://nixos.wiki/wiki/DotNET

https://learn.microsoft.com/en-us/dotnet/core/tools/sdk-errors/netsdk1100

https://stackoverflow.com/questions/77715442/how-to-solve-this-error-set-the-enablewindowstargeting-property-to-true-netsd

By default, .NET downloads all targeting packages but target and runtime packages are not automatically downloaded on unsupported platforms. These can be wrapped in cross-target downloads by setting the EnableWindowsTargeting property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant