Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Bug running HelloWorld #2482

Closed
Sandman83 opened this issue Aug 14, 2015 · 8 comments
Closed

Bug running HelloWorld #2482

Sandman83 opened this issue Aug 14, 2015 · 8 comments

Comments

@Sandman83
Copy link

Trying the HelloWorld starting example from
http://dotnet.github.io/core/getting-started/
An error occurs running the last command dnx . run
The output is

System.InvalidOperationException: Unable to load application or execute command '.'. Available commands: me.
   at Microsoft.Dnx.ApplicationHost.Program.ThrowEntryPointNotfoundException(DefaultHost host, String applicationName, Exception innerException)
   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, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)
Trace/BPT trap: 5

The used configuration is

Active Version              Runtime Arch OperatingSystem Alias
------ -------              ------- ---- --------------- -----
       1.0.0-beta6          mono         linux/darwin    default
  *    1.0.0-beta7-12356    coreclr x64  darwin          
       1.0.0-beta7-12356    mono         linux/darwin    

However, using the beta6 mono runtime seems to give right results.

@per-samuelsson
Copy link

dnx . run

Think the sugar syntax has changed. Try dnx run, or expand it to the full (type dnx for help).

@Sandman83
Copy link
Author

dnx run

gives

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at Microsoft.Cci.MetadataWriter.GetRowCounts()
   at Microsoft.Cci.MetadataWriter.PopulateTables(Int32[] methodBodyRvas, BlobBuilder mappedFieldDataWriter, BlobBuilder resourceWriter)
   at Microsoft.Cci.MetadataWriter.SerializeMetadataAndIL(BlobBuilder metadataWriter, BlobBuilder debugMetadataWriterOpt, PdbWriter nativePdbWriterOpt, BlobBuilder ilWriter, BlobBuilder mappedFieldDataWriter, BlobBuilder managedResourceDataWriter, Int32 methodBodyStreamRva, Func`2 calculateMappedFieldDataStreamRva, Int32& moduleVersionIdOffsetInMetadataStream, Int32& entryPointToken, MetadataSizes& metadataSizes)
   at Microsoft.Cci.PeWriter.WritePeToStream(MetadataWriter mdWriter, Func`1 getPeStream, Func`1 getPortablePdbStreamOpt, PdbWriter nativePdbWriterOpt)
   at Microsoft.CodeAnalysis.Compilation.SerializeToPeStream(CommonPEModuleBuilder moduleBeingBuilt, EmitStreamProvider peStreamProvider, EmitStreamProvider pdbStreamProvider, Func`1 testSymWriterFactory, DiagnosticBag diagnostics, Boolean metadataOnly, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Compilation.Emit(EmitStreamProvider peStreamProvider, EmitStreamProvider pdbStreamProvider, EmitStreamProvider xmlDocumentationStreamProvider, EmitStreamProvider win32ResourcesStreamProvider, IEnumerable`1 manifestResources, EmitOptions options, CompilationTestData testData, Func`1 getHostDiagnostics, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.Compilation.Emit(Stream peStream, Stream pdbStream, Stream xmlDocumentationStream, Stream win32Resources, IEnumerable`1 manifestResources, EmitOptions options, CancellationToken cancellationToken)
   at Microsoft.Dnx.Compilation.CSharp.RoslynProjectReference.Load(IAssemblyLoadContext loadContext)
   at Microsoft.Dnx.Compilation.CompilationEngine.LoadProject(Project project, String aspect, IAssemblyLoadContext loadContext)
   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.Runtime.AssemblyLoadContextExtensions.Load(IAssemblyLoadContext loadContext, String name)
   at Microsoft.Dnx.Runtime.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, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.ExecuteAsync(String[] args, FrameworkName targetFramework)
   at Microsoft.Dnx.Host.RuntimeBootstrapper.Execute(String[] args, FrameworkName targetFramework)

@per-samuelsson
Copy link

dnx run gives System.IndexOutOfRangeException

Yeah, thats another story. The latest bits are obv shaky from day to day, but with dnx run you are at least past the initial, reported problem (which was caused by the errornous command-line).

Sorry I can't help you with this next one too.

@moozzyk
Copy link
Contributor

moozzyk commented Aug 14, 2015

@Sandman83 - looks like you hit this #2442.
/cc @BrennanConroy

@BrennanConroy
Copy link
Member

Ya, latest X-Plat CoreCLR bits are not usable, sorry.

@trotyl
Copy link

trotyl commented Aug 19, 2015

The same System.IndexOutOfRangeException: Index was outside the bounds of the array. problem as above with the exact procedure in https://github.com/dotnet/coreclr/blob/master/Documentation/install/get-dotnetcore-dnx-osx.md
With dnvm 1.0.0-beta7-10410, dnx coreclr 1.0.0-beta7-12364.

@BrennanConroy
Copy link
Member

This should be fixed with the latest dnx's

@BrennanConroy
Copy link
Member

beta8-15138 or beta7-15131

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants