Repository: IronLanguages/ironpython3

Issue #1227: Installing via Nuget leads to compile error on .NET 5 or .NET 6
Created: 2021-05-18T08:21:46Z
Prerequisites

 Are you running the latest version?
 Are you reporting to the correct repository?
 Did you perform a cursory search?

Description
(Warning; new IronPython user).
After adding IronPython 3.4.0-alpha1 and IronPython.StdLib 3.4.0-alpha1 to my WPF project, the project refuses to compile, stating it cannot find the assembly.
Removing the 3.4.0-alpha1 version and instead installing 2.7.11, makes it possible to compile the project again.
This only happens when TargetFramework is set to net5.0-windows or net6.0-windows. .NET Core 3.1 allows the project to compile.

Build started...
1>------ Build started: Project: WpfApp2, Configuration: Debug Any CPU ------
1>Build started 18-5-2021 10:08:06.
1>Target _CheckForNETCoreSdkIsPreview:
1>  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
1>Target MarkupCompilePass1:
1>  C:\Program Files\dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets(222,9): error MC1000: Unknown build error, 'Could not find assembly 'IronPython, Version=3.4.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.'
1>Done building target "MarkupCompilePass1" in project "WpfApp2.csproj" -- FAILED.
1>
1>Done building project "WpfApp2.csproj" -- FAILED.
1>
1>Build FAILED.
1>
1>C:\Program Files\dotnet\sdk\6.0.100-preview.2.21155.3\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets(222,9): error MC1000: Unknown build error, 'Could not find assembly 'IronPython, Version=3.4.0.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.'
1>    0 Warning(s)
1>    1 Error(s)
1>
1>Time Elapsed 00:00:00.96
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Steps to Reproduce

Open VS2019
Create a new WPF App
Add IronPython as a Nuget reference
Try to compile and run

Expected behavior: [What you expected to happen]
Actual behavior: [What actually happened]
Versions
You can get this information from executing ipy -V.

Duplicate issue #1243: IronPython doesn't run on net5.0-windows
Created: 2021-06-23T01:33:48Z
Prerequisites
The issue tracker is used to report bugs and request new features, NOT to ask questions.
Questions should be posted to the users mailing list which can be accessed at
https://ironpython.groups.io/g/users.

[x ] Are you running the latest version?
[x ] Are you reporting to the correct repository?
[x ] Did you perform a cursory search?

Description
Application does not run with net5-windows framework target.
The problem lies in the nuget package target for net5-windows only contains IronPython.WPF.dll. It should also include IronPython.dll, IronPython.Modules.dll, etc. Deleting the net5-windows target from the nuget package, adding it to your local feed, and updating to the local version will fix the problem stated above.
Steps to Reproduce

Create a new csproj with TargetFramework net5.0-windows or net5.0-windows10.0.17763.0.
Add a PackageReference to IronPython 3.4.0-alpha1
Add print('hello world') example code in Program.cs
Run application

Expected behavior: Application prints hello world and completes successfully
Actual behavior: Runtime error: Cannot find IronPython version 3.4.0.
Versions
You can get this information from executing ipy -V.
IronPython 3.4.0-alpha1

Closing comment (2021-06-23T14:10:35Z): Thanks for the report, this is a duplicate of #1227