❔ What does this exception mean?

(Sorry for reposting as I already put it in the help chat and don't want it to get buried) System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.' Basically I am passing a File Path as a string to another classfile and this classfile uses a dll and reads the File provided to a array. as soon as it gets to the code that do a value change onto the file, this exception is thrown. The File in question is not accessed or being used by any other method and the path is correctly seen in the class file too.
I would guess the string isn't null terminated your dll reads beyond the string memory because it doesn't rely on the length strings in c# are wide, there might be a weird problem with that
probably an issue with the dll/libraryimport, yeah you can (should) either specify the string marshalling, or straight up pass the correct type (sbyte* or ushort*)
how do I do this ?
i don't exactly know what your native signature looks like. can't help that much
nvm. I am not gonna use this library in the end. gonna fallback to the old one
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
❔ Pictures Folder in android MauiI found out how to fetch the path of the Pictures Folder in the Files app of my devices (here an AnHi I’m building in C sharp a very very rock paper scissors game using classesI want the result to look cooler please help me if you can if very much appreciate it❔ Session VariablesStoring what a user selects from a dropdown to a session variable but it gives a null error which sh✅ editorconfig with visual studioIs there a way to setup rules for the comments in editorconfig file. For example that the comments s❔ Transform foreach to LINQ for optimizationis there a way to transform this logic from foreach to LINQ? I'm talking about the two foreaches. Th✅ Multiple level try-catch statementI have a multiple try-catch statement and they behavior differently in different machine.❔ What is the recommended way to read excel(*.xlsx) files?in .NET Framework 4.8. I don't need any info of fonts, colors, styles, or anything else; i only need❔ Editing .CSV with visual studio, with highlight String?I have a project, to translation old game, so i unpack text from the game with my tools and output t❔ Text fileSo I am wondering how this works, so I am calling a textfile and then splitting it into multiple and❔ Encapsulate an enum from legacy code.Hi everyone, I'd like to encapsulate (?) an enum which had a lot of implements in legacy code. I wa❔ How do I look a bool method every 5 minutes?So I have a bool method called WindowWatch(), and it works and returns true and false when I need it❔ Implementing shifts for 256 bit integer classI'm writing a custom 256 bit int class for Godot. Internally it is stored as 4 `ulong` types. I've t❔ Nullability issueI have this code ```cs public bool Equals(Money money) { if (money is nu❔ Using the Visual Studio "Properties" folder for custom settings?Is it appropriate to place files in the built-in Visual Studio project's Properties folder for custo❔ Mixing EF Core and another SQL libraryHello, I need to write some raw SQL queries outside the ORM but EF Core doesn't support that, how go❔ How can I do this?So you can add "tasks" to the listbox and when you press "verwijderen" it removes the items but when❔ Git - how to undo dumb stuffim using visual studio 2022 and it gone like this : 1- i made a commit with wrong staged files (allBasic Visual Studio DebuggingHi, I am having problems with the debugging process, It wants me to attach the program before starti❔ basic c# how to inherits toolkit ObservableRecipient when you are already inherit something else ?❔ SQL Timeout Error Deployed ASP.NET Core appi just deployed my web app with react and .net core and it runs locally but when i run it on the ser