Closed adammarks closed 4 years ago
How strange. I can't seem to repro this. When I use the exact same runtimeconfig.json, the app works for me!
All I can figure is maybe some .NET SDK component is out of date. Can you run dotnet --info
and share the results? Also, if you can use a debugger like WinDbg to capture a stack trace of the failure, that will help.
@mjrousos I kept looking at this and I noticed that I had a dependency problem similar to the other example where when I did a rebuild I was getting a linker error about a missing cpp_cli_interop.lib Once I added the output directory and setup a project reference to the cpp_cli_interop project the linker error went away and that also seemed to fix the error I was getting above, so it this project all works now.
Likely the dependency issue I was having was keeping a dll from being created and/or dropped into the right directory, which would cause the error above, but it seems to be working find now.
Access violation when running C++/CLI code https://www.screencast.com/t/v8Gz4hfl4YN
NOTE: I am also created a CPP_CLI_Interop.runtimeconfig.json file in the output directory that contains the following