sir loin
sir loin
CC#
Created by sir loin on 12/10/2023 in #help
✅ weird transparent areas when using GraphicsPath to draw a string
never mind, I found out that you need to change the GraphicsPath fill mode to winding
2 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
I don't see how something this simple could cause a memory violation when there's no unsafe code
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
sadly I haven't really fixed the issue, it seems like trying to do an alternative would be way too complicated
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
really really weird\
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
and also the issue comes from indexing faceVertices list (I narrowed it down) but I still have no idea why
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
the parent program is written in completely safe code, Object3d is using a 3D library which relies on System.Numerics
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
I literally do not see how it could cause an error, it should definitely be within bounds
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
so it's the indexing
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
so removing the code that indexed that list fixed it
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
yeah that's the part that stumped
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
it's either indexing or adding to it causes an error but idk why
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
it's the vertices list
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
actually I don't think it's the StreamReader
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
it's weird that this code, which seems completely safe, is causing something like this
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
no call stack or anything
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
it says The program '[33224] StorybrewEditor.exe' has exited with code 3221225477 (0xc0000005) 'Access violation'
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
the app just crashes in the debugger
26 replies
CC#
Created by sir loin on 12/2/2023 in #help
Weird Access violation (no exception) when using StreamReader
it literally does not do anything because it doesn't throw an access violdation exception
26 replies
CC#
Created by sir loin on 11/10/2023 in #help
❔ Migrate AppDomain (.net framework) to AssemblyLoadContext (.net core)
the main issue here is creating an isolated instance of ScriptProvider
var assemblyPath = $"{CompiledScriptsPath}/{HashHelper.GetMd5(Name + Environment.TickCount)}.dll";
ScriptCompiler.Compile(SourcePaths, assemblyPath, ReferencedAssemblies);

var scriptLoadContext = new AssemblyLoadContext($"{Name} {Id}", true);
Debug.Print($"{nameof(Scripting)}: Loading AssemblyLoadContext {scriptLoadContext.Name}");

ScriptProvider<TScript> scriptProvider;
try
{
var type = scriptLoadContext.LoadFromAssemblyPath(typeof(ScriptProvider<TScript>).Assembly.Location).GetType(typeof(ScriptProvider<TScript>).FullName);
scriptProvider = (ScriptProvider<TScript>)Activator.CreateInstance(type);
scriptProvider?.Initialize(assemblyPath, ScriptTypeName);
}
catch
{
scriptLoadContext.Unload();
throw;
}

if (assemblyLoadContext != null)
{
Debug.Print($"{nameof(Scripting)}: Unloading AssemblyLoadContext {assemblyLoadContext.Name}");
assemblyLoadContext?.Unload();
}
assemblyLoadContext = scriptLoadContext;

return scriptProvider;
var assemblyPath = $"{CompiledScriptsPath}/{HashHelper.GetMd5(Name + Environment.TickCount)}.dll";
ScriptCompiler.Compile(SourcePaths, assemblyPath, ReferencedAssemblies);

var scriptLoadContext = new AssemblyLoadContext($"{Name} {Id}", true);
Debug.Print($"{nameof(Scripting)}: Loading AssemblyLoadContext {scriptLoadContext.Name}");

ScriptProvider<TScript> scriptProvider;
try
{
var type = scriptLoadContext.LoadFromAssemblyPath(typeof(ScriptProvider<TScript>).Assembly.Location).GetType(typeof(ScriptProvider<TScript>).FullName);
scriptProvider = (ScriptProvider<TScript>)Activator.CreateInstance(type);
scriptProvider?.Initialize(assemblyPath, ScriptTypeName);
}
catch
{
scriptLoadContext.Unload();
throw;
}

if (assemblyLoadContext != null)
{
Debug.Print($"{nameof(Scripting)}: Unloading AssemblyLoadContext {assemblyLoadContext.Name}");
assemblyLoadContext?.Unload();
}
assemblyLoadContext = scriptLoadContext;

return scriptProvider;
casting ScriptProvider causes the weird ambiguity error, and it doesn't inherit from anything
12 replies