mirror of https://github.com/microsoft/schemy.git
Fixes issue Microsoft/schemy/issues/7
`Assembly.GetEntryAssembly()` and `Assembly.GetExecutingAssembly()` doesn't work properly when the user assembly is loaded by reflection or in another appdomain.pull/8/head
parent
1120fc6b2e
commit
e99a70fec2
|
@ -51,13 +51,13 @@ namespace Schemy
|
|||
|
||||
private IEnumerable<TextReader> GetInitializeFiles()
|
||||
{
|
||||
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("init.ss"))
|
||||
using (Stream stream = typeof(Interpreter).Assembly.GetManifestResourceStream("init.ss"))
|
||||
using (StreamReader reader = new StreamReader(stream))
|
||||
{
|
||||
yield return reader;
|
||||
}
|
||||
|
||||
string initFile = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), ".init.ss");
|
||||
string initFile = Path.Combine(Path.GetDirectoryName(typeof(Interpreter).Assembly.Location), ".init.ss");
|
||||
if (File.Exists(initFile))
|
||||
{
|
||||
using (var reader = new StreamReader(initFile))
|
||||
|
|
Loading…
Reference in New Issue