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

[DllImportGenerator] ignore DLLIMPORTGEN003 #64811

Closed
SupinePandora43 opened this issue Feb 4, 2022 · 3 comments
Closed

[DllImportGenerator] ignore DLLIMPORTGEN003 #64811

SupinePandora43 opened this issue Feb 4, 2022 · 3 comments
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner

Comments

@SupinePandora43
Copy link

DllImportGenerator produces following error when targeting <net5 frameworks

CSC : error DLLIMPORTGEN003: 'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on the current target framework. Source-generated P/Invokes require .NET 5.0 or above. [/home/supine/UltralightNet/UltralightNet/UltralightNet.csproj]

but if i simply copy-paste generated code to source with netstandard2/net45 targets it will work.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner labels Feb 4, 2022
@ghost
Copy link

ghost commented Feb 4, 2022

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

DllImportGenerator produces following error when targeting <net5 frameworks

CSC : error DLLIMPORTGEN003: 'GeneratedDllImportAttribute' cannot be used for source-generated P/Invokes on the current target framework. Source-generated P/Invokes require .NET 5.0 or above. [/home/supine/UltralightNet/UltralightNet/UltralightNet.csproj]

but if i simply copy-paste generated code to source with netstandard2/net45 targets it will work.

Author: SupinePandora43
Assignees: -
Labels:

area-System.Runtime.InteropServices, untriaged

Milestone: -

@jkoritzinsky
Copy link
Member

The generator has already been updated in main to only warn on an unknown tfm and have well-specified downlevel behavior. We just haven't shipped a new package in a while.

@AaronRobinsonMSFT
Copy link
Member

@SupinePandora43 The prototype is no longer being updated. This has been addressed in the official version that will eventually supersede the prototype in the feed.

See #60595

@ghost ghost locked as resolved and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime.InteropServices untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants