-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
c++/cli compile error 3611 if System::IntPtr is used #94723
Comments
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsDescriptionI'm using the latest .NET8 and VS 17.8 It's a compile error for c++/cli:
It happens as long as
These code can compile with .NET8 preview versions (preview, rc1, rc2), but fails with today's .NET8 official version 8.0.100 This problem is pretty urgent for us because our product is very close to the release date (we were waiting for .NET8 official release). Could you please take a look right now? Is there any workaround that we can use to make build pass? I have encountered this problem in one .NET8 daily build months ago (#88840 (comment)), then it was gone. I don't understand why it comes back in today's official version. Just FYI, I also reported a similar bug dotnet/winforms#9644, it's not urgent. Reproduction Stepscreate c++/cli project in VS. add function:
build fails Expected behaviorbuild should pass Actual behaviorbuild fails Regression?Yes, it's good in .NET8 preview versions. Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
Could you clarify what version of the C++/CLI build tools you have installed? I am not able to repro this using the following in VS 17.9 Preview 1:
This was also validated to be resolved in the last preview of VS 17.8. I am currently installing VS 17.8 RTM to see if something broke between the last preview and actual release. |
@tannergooding Thanks for your reply! I just found it can build with VC toolset 14.38. But the code can compile with 14.36 in previous net8 preview versions. What is changed? Could I go back to the old compiler behavior? I ask this question because it's almost impossible for us to use 17.8 immediately because time is very limited. |
Visual Studio 2022 17.8 is the minimum version required to work with .NET 8 C++/CLI had to update to support a particular feature of This lack of support in C++/CLI was found back around .NET 8 Preview 4-5, at which point we temporarily removed the neded API. This was added back for RTM once the C++/CLI fix landed (which was only in the last preview of VS 2022 17.8). |
Is there any workaround that I can use? Is it possible for me to "temporarily removed the needed API" like you did? We have no enough time. |
There is not. If you are targeting .NET 8 and using C++/CLI, then you need C++/CLI 14.38. This necessitates using VS 2022 17.8. |
I see. Thanks for your help! |
Description
I'm using the latest .NET8 and VS 17.8
It's a compile error for c++/cli:
It happens as long as
System::IntPtr
is used. For example, add a function in c++/cli project:These code can compile with .NET8 preview versions (preview, rc1, rc2), but fails with today's .NET8 official version 8.0.100
This problem is pretty urgent for us because our product is very close to the release date (we were waiting for .NET8 official release). Could you please take a look right now? Is there any workaround that we can use to make build pass?
I have encountered this problem in one .NET8 daily build months ago (#88840 (comment)), then it was gone. I don't understand why it comes back in today's official version.
Just FYI, I also reported a similar bug dotnet/winforms#9644, it's not urgent.
Reproduction Steps
create c++/cli project in VS.
add function:
build fails
Expected behavior
build should pass
Actual behavior
build fails
Regression?
Yes, it's good in .NET8 preview versions.
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: