Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Small White Dragon
Nov 23, 2007

No relation.
Hi all! I'm in the midst of porting/integrating old code with C#. While I've used C# before, this is my first time I've done low-level integration with C#, although I've done it in Objective C and Java via JNI. I went back to some of the documentation I read, but it's unclear on some things.

0) fixed() is pretty snazzy for a single call to old code, but is there a way to create a memory block that is essentially fixed for life?

1) Are structs in C# laid out the same way they are in C?

2) BitConverter uses the endianness of the machine it's on. Is there a way to use network byte order?

3) Is there any way to do conditional thread locks, similar to NSConditionLock in Objective C?

Adbot
ADBOT LOVES YOU

Small White Dragon
Nov 23, 2007

No relation.
For those of us working in Xamarin etc, is this an okay place to ask VSCode questions? Coming from Xcode/IntelliJ, there's a number of things about this IDE that seem non-obvious to me and I assume there are probably simple answers.

For one, I have a directory with a bunch of resource files, and it seems like I have to right-click on each one, go to properties and select "Copy if Newer" or else they don't get automatically copied over to the target. But the option isn't there if I select multiple files and then right click -> properties. Is this the right way to go about this, or is there a better way? Or can I just have a folder that auto-updates as I put in/remove files, ala reference folders in Xcode?

Small White Dragon
Nov 23, 2007

No relation.

zokie posted:

Can anyone think of a good reason to target .net framework 4 in 2021? Or even 2017?

Do you mean just 4.0 or 4.x?

We're looking at .NET for various kinds of cross-platform projects and there are a number of places where .NET 5 has weird problems.

Example:
https://github.com/FNA-XNA/FNA/wiki/0:-FAQ#i-have-a-bug-when-running-on-net-core-and-

Small White Dragon
Nov 23, 2007

No relation.

mystes posted:

The "bug" being that .net 5 doesn't support a mono specific extension that was never supported by .net framework or .net core?

I don't know all the details but from talking to folks involved in cross platform projects, not just games, there are apparently a number of cases where the answer is "use 4.x."

I assume most folks here only care about Windows, in which case none of that may apply.

Small White Dragon
Nov 23, 2007

No relation.

mystes posted:

The way you're framing this is kind of weird.

Sorry if my terminology is wrong.

Small White Dragon
Nov 23, 2007

No relation.
Speaking of nullables, is it possible to enable them in a shared project (shproj)? I've been doing "#nullable enable" in every file, but that's kind of annoying for an on-going project.

Small White Dragon
Nov 23, 2007

No relation.
If anyone else is doing .NET on OS X -- is the JetBrains IDE really that much better than Visual Studio, and if so, why?

Adbot
ADBOT LOVES YOU

Small White Dragon
Nov 23, 2007

No relation.
Rider is great, although I can never seem to find keybindings I like.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply