You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 18, 2017. It is now read-only.
C:\Users\vagrant\Documents\Visual Studio 2015\Projects\ConsoleApp1\src\ConsoleApp1> dnx ConsoleApp1 test
Microsoft.Dnx.Compilation.CSharp.RoslynCompilationException: C:\Users\vagrant\Documents\Visual Studio 2015\Projects\ConsoleApp1\src\ConsoleApp1\Program.cs(14,17): DNXCore,Version=v5.0 error CS0234: The type or namespace name 'Console' does not exist in the namespace 'System' (are you missing an assembly reference?)
at Microsoft.Dnx.Compilation.CSharp.RoslynProjectReference.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
at Microsoft.Dnx.Compilation.CompilationEngine.LoadProject(Project project, FrameworkName targetFramework, String aspect, IAssemblyLoadContext loadContext, AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.ProjectAssemblyLoader.Load(AssemblyName assemblyName, IAssemblyLoadContext loadContext)
at Microsoft.Dnx.Runtime.Loader.ProjectAssemblyLoader.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.LoaderContainer.Load(AssemblyName assemblyName)
at Microsoft.Dnx.Host.DefaultLoadContext.LoadAssembly(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.AssemblyLoaderCache.GetOrAdd(AssemblyName name, Func`2 factory)
at Microsoft.Dnx.Runtime.Loader.LoadContext.Load(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(AssemblyName assemblyName)
at Microsoft.Dnx.Runtime.Loader.LoadContext.Microsoft.Dnx.Runtime.IAssemblyLoadContext.Load(AssemblyName assemblyName)
at Microsoft.Dnx.ApplicationHost.DefaultHost.GetEntryPoint(String applicationName)
at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain(DefaultHost host, String applicationName, String[] args)
at Microsoft.Dnx.ApplicationHost.Program.Main(String[] args)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute(Assembly assembly, String[] args, IServiceProvider serviceProvider)
at Microsoft.Dnx.Host.Bootstrapper.RunAsync(List`1 args, IRuntimeEnvironment env, String appBase, FrameworkName targetFramework)
at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, BootstrapperContext bootstrapperContext)
at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, BootstrapperContext bootstrapperContext)
The issue is Microsoft.Dnx.ApplicationHost/Program.cs#L234 where we only suppress ICompilationExceptions if they are wrapped by FileLoadException or FileNotFoundException. In this case when the assembly was not found, the outer exception was the ICompilationExceptions.
What we need is something like
catch (Exception ex)
{
if (ex is ICompilationException)
{
throw SuppressStackTrace(ex);
}
if (ex.InnerException is ICompilationException)
{
throw SuppressStackTrace(ex.InnerException);
}
if (ex is FileLoadException || ex is FileNotFoundException)
{
ThrowEntryPointNotfoundException(
host,
applicationName,
ex.InnerException);
}
throw;
}
cc @JunTaoLuo
The text was updated successfully, but these errors were encountered: