public static void CreateEnvironmentIL3001()
        {
            var sources = new List <(string name, string content)>();

            for (var i = 0; i < Constants.Number_Of_Code_Files; i++)
            {
                var name = "TypeName" + i;
                sources.Add((name, $@"Imports System
Imports System.Reflection

Class {name}
    Sub M()
        Dim a = Assembly.LoadFrom(""/some/path/not/in/bundle"")
        Dim b = a.GetFile(""/some/file/path"")
        Dim c = a.GetFiles()
    End Sub
End Class"));
            }

            var(compilation, options)        = VisualBasicCompilationHelper.CreateWithOptionsAsync(sources.ToArray(), new[] { ("build_property.PublishSingleFile", "true") }).GetAwaiter().GetResult();
Example #2
0
        public static void CreateEnvironmentIL3000()
        {
            var sources = new List <(string name, string content)>();

            for (var i = 0; i < Constants.Number_Of_Code_Files; i++)
            {
                var name = "TypeName" + i;
                sources.Add((name, @$ "
Imports System
Imports System.Reflection

Class {name}
    Sub M()
        Dim a = Assembly.GetExecutingAssembly()
        Dim b = a.Location
        Dim c = a.EscapedCodeBase
    End Sub
End Class"));
            }

            var(compilation, options)        = VisualBasicCompilationHelper.CreateWithOptionsAsync(sources.ToArray(), new[] { ("build_property.PublishSingleFile", "true") }).GetAwaiter().GetResult();