Kiel
Kiel
CC#
Created by Fumetsu on 4/24/2025 in #help
✅ System.IO.IOException Being Thrown
in my experience at least
39 replies
CC#
Created by Fumetsu on 4/24/2025 in #help
✅ System.IO.IOException Being Thrown
reason? no, not really. it's about consistency and giving you an easy way to tell at a glance whether a variable name is a Property, _field, or localVariable.
39 replies
CC#
Created by Fumetsu on 4/24/2025 in #help
✅ System.IO.IOException Being Thrown
using var file = File.OpenWrite(FilePath);
await using var sw = new StreamWriter(file);
...
using var file = File.OpenWrite(FilePath);
await using var sw = new StreamWriter(file);
...
iirc
39 replies
CC#
Created by Fumetsu on 4/24/2025 in #help
✅ System.IO.IOException Being Thrown
you could try using File.OpenWrite instead of just creating an empty file
39 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
yeah that's why I was wondering if a change of network would improve the situation
93 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
really wouldn't hurt at this point
93 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
unironically try using a VPN or tethering to your phone to see if it's your network for some reason
93 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
I'm using linux mint on my laptop and have not had any issues with .net development so far
93 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
like try dotnet restore -v diag
93 replies
CC#
Created by The Unknown on 4/4/2025 in #help
✅ .NET not Working
a bit of an ignorant response but is it possible to run dotnet restore with some level of verbose-ness to see if there are specific endpoints that aren't being accessed? there's gotta be something more useful than "nothing"
93 replies
CC#
Created by Kiel on 1/24/2025 in #help
Enabling debug/trace logging only for certain parts of code as needed?
Looking at the link you set that might be helpful/useful to me. I'm having trouble finding an example on that page about setting it for a specific logging context. I've barely done advanced stuff with logging before, only an enricher once, so I'm a bit OOTL on terminology or what that would even look like
8 replies
CC#
Created by Kiel on 1/14/2025 in #help
Help me build a Godot project I cloned from GitHub? (NU1008)
I have a feeling that won't do it since it's referencing another project in the same solution, but I'll give it a try edit: yeah, didn't change anything. I think it didn't even get to that point in the csproj, as the error is still the same and is referencing something the csproj itself doesn't even reference:
error NU1008: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: GodotSharp;GodotSharpEditor.
error NU1008: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: GodotSharp;GodotSharpEditor.
Neither of these are referenced by the project 🤔 And the only references to them I can find are in .godot\mono\temp\obj
14 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
to answer your question bluntly, no C# does not have first class support for...whatever it is you're trying to express. We have try/finally, try/catch, and the various forms of using. But it seems like you're pretty much asking for a way to create an object, do work with it, and return it, and dispose it ONLY if an exception is thrown. If you're re-using this logic lots, you could probably use the above suggestion as a wrapper, but otherwise yeah the way you're doing it is probably about as clean as it's gonna get without re-throwing
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
what exactly are you trying to accomplish here then, if not what I'm suggesting?
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
your original example was a little weird re-assigning result to a new variable so it threw me off
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
otherwise, return it
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
if I'm reading your messages right you want result disposed ONLY if an exception is thrown
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
but keep in mind this approach would swallow exceptions, you should still probably log or whatever your system does to handle them
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
var result = new SomeDisposable();

try
{
var ret = result.PossiblyThrows();
return ret;
}
catch
{
result.Dispose();
return // whatever you want
}
var result = new SomeDisposable();

try
{
var ret = result.PossiblyThrows();
return ret;
}
catch
{
result.Dispose();
return // whatever you want
}
Is this closer to what you're looking for? You could use try/catch instead of try/finally
28 replies
CC#
Created by Olipro on 11/14/2024 in #help
IDisposable ownership semantics
So you only want result disposed if an exception is thrown?
28 replies