Fix symbol file & exceptions on startup in CLI
This commit is contained in:
parent
a8e4ee02f6
commit
e587075ea8
|
@ -6,8 +6,8 @@
|
||||||
<ProjectGuid>{6EF47B64-1920-4827-BEEF-B262D5A2D214}</ProjectGuid>
|
<ProjectGuid>{6EF47B64-1920-4827-BEEF-B262D5A2D214}</ProjectGuid>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>SpritePacker</RootNamespace>
|
<RootNamespace>SpritePacker</RootNamespace>
|
||||||
<AssemblyName>SpritePacker</AssemblyName>
|
<AssemblyName>SpritePackerCLI</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<RootNamespace>SpritePacker.GUI</RootNamespace>
|
<RootNamespace>SpritePacker.GUI</RootNamespace>
|
||||||
<AssemblyName>SpritePacker-GUI</AssemblyName>
|
<AssemblyName>SpritePacker-GUI</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
|
@ -7,7 +7,7 @@
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RootNamespace>SpritePacker</RootNamespace>
|
<RootNamespace>SpritePacker</RootNamespace>
|
||||||
<AssemblyName>SpritePacker</AssemblyName>
|
<AssemblyName>SpritePacker</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
|
|
@ -21,8 +21,10 @@ namespace SpritePacker
|
||||||
|
|
||||||
public static string GetEmbeddedResourceContent(string resourceName)
|
public static string GetEmbeddedResourceContent(string resourceName)
|
||||||
{
|
{
|
||||||
Assembly asm = Assembly.GetExecutingAssembly();
|
Assembly asm = Assembly.GetCallingAssembly();
|
||||||
Stream stream = asm.GetManifestResourceStream(resourceName);
|
Stream stream = asm.GetManifestResourceStream(resourceName);
|
||||||
|
if(stream == null)
|
||||||
|
throw new FileNotFoundException($"Error: The embedded resource with the name {resourceName} does not appear to exist.");
|
||||||
StreamReader source = new StreamReader(stream);
|
StreamReader source = new StreamReader(stream);
|
||||||
string fileContent = source.ReadToEnd();
|
string fileContent = source.ReadToEnd();
|
||||||
source.Dispose();
|
source.Dispose();
|
||||||
|
|
Loading…
Reference in New Issue