Added support for .NET embedded resources

This commit is contained in:
Yoshi Askharoun
2022-07-05 15:14:28 -05:00
parent 62e3a05189
commit c09f29e92c
3 changed files with 3 additions and 1 deletions
@@ -37,7 +37,7 @@ namespace Microsoft.Iris.Markup
{ {
_loadResultTarget = loadResultTarget; _loadResultTarget = loadResultTarget;
_reader = new ByteCodeReader(resource.Buffer, resource.Length, false); _reader = new ByteCodeReader(resource.Buffer, resource.Length, false);
if (resource is DllResource) if (resource is DllResource || resource is ClrDllResource)
_reader.MarkAsInFixedMemory(); _reader.MarkAsInFixedMemory();
uint num1 = _reader.ReadUInt32(); uint num1 = _reader.ReadUInt32();
uint num2 = _reader.ReadUInt32(); uint num2 = _reader.ReadUInt32();
@@ -56,6 +56,7 @@ namespace Microsoft.Iris.Markup
AssemblyLoadResult.Startup(); AssemblyLoadResult.Startup();
DllLoadResult.Startup(); DllLoadResult.Startup();
ResourceManager.Instance.RegisterSource("res", DllResources.Instance); ResourceManager.Instance.RegisterSource("res", DllResources.Instance);
ResourceManager.Instance.RegisterSource(ClrDllResources.Scheme, ClrDllResources.Instance);
HttpResources.Startup(); HttpResources.Startup();
ResourceManager.Instance.RegisterSource("file", FileResources.Instance); ResourceManager.Instance.RegisterSource("file", FileResources.Instance);
} }
+1
View File
@@ -44,6 +44,7 @@
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'"> <ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Security.Permissions" Version="6.0.0" /> <PackageReference Include="System.Security.Permissions" Version="6.0.0" />
<PackageReference Include="Vanara.PInvoke.Accessibility" Version="3.4.2" /> <PackageReference Include="Vanara.PInvoke.Accessibility" Version="3.4.2" />
<PackageReference Include="System.Resources.ResourceManager" Version="4.3.0" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition=" '$(UseOpenZune)' == 'true' "> <PropertyGroup Condition=" '$(UseOpenZune)' == 'true' ">