Skip to content

K pack produces error: System.NullReferenceException #6

Closed

Description

@tugberkugurlu

I completed all the steps as described inside the readme of this project and now discovering other stuff such as Command Line usage. I ran K pack and I can see that it outputs into the bin/output directory but I'm getting the following exception at the end of the command:

System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at Microsoft.Net.Project.Packing.PackRuntime.Emit(PackRoot root)
at Microsoft.Net.Project.Packing.PackRoot.Emit()
at Microsoft.Net.Project.PackManager.Package()
at Microsoft.Net.Project.Program.Main(String[] args)

Here is the console output I got by running K pack > log.txt:

klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Project
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Tugberk.k\packages\ProjectK.0.1-alpha-353\tools\net45\Microsoft.Net.Project.dll)
klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Runtime
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Tugberk.k\packages\ProjectK.0.1-alpha-353\tools\net45\Microsoft.Net.Runtime.dll)
klr.exe Information: 0 : RootHost.Load name=Newtonsoft.Json
klr.exe Information: 0 : RootHost Assembly.LoadFile(C:\Users\Tugberk.k\packages\ProjectK.0.1-alpha-353\tools\net45\Newtonsoft.Json.dll)
klr.exe Information: 0 : Walking dependency graph for 'HelloWebFx .NETFramework,Version=v4.5.1'.
klr.exe Information: 0 : [ProjectReferenceDependencyProvider]: HelloWebFx 0.1-alpha-SNAPSHOT
klr.exe Information: 0 : [NuGetDependencyResolver]: Microsoft.AspNet.Abstractions 0.1-alpha-279, Microsoft.AspNet.Hosting 0.1-alpha-300, Microsoft.AspNet.Server.WebListener 0.1-alpha-245, Microsoft.AspNet.DependencyInjection 0.1-alpha-267, Microsoft.AspNet.RequestContainer 0.1-alpha-300, Microsoft.AspNet.Routing 0.1-alpha-281, Microsoft.ComponentModel.DataAnnotations 4.0.10.0, Microsoft.AspNet.Mvc.ModelBinding 0.1-alpha-699, Microsoft.AspNet.Mvc.Core 0.1-alpha-699, Microsoft.AspNet.Mvc 0.1-alpha-699, Microsoft.AspNet.Mvc.Razor 0.1-alpha-699, Microsoft.AspNet.ConfigurationModel 0.1-alpha-180, Microsoft.AspNet.Diagnostics 0.1-alpha-192, Microsoft.AspNet.FeatureModel 0.1-alpha-279, Microsoft.AspNet.PipelineCore 0.1-alpha-279, Microsoft.AspNet.Security.DataProtection 0.1-alpha-144, Microsoft.Net.Runtime.Interfaces 0.1-alpha-325, Microsoft.AspNet.HttpFeature 0.1-alpha-279, Microsoft.AspNet.Logging 0.1-alpha-159, Common 1.0.0, Newtonsoft.Json 5.0.8, Microsoft.AspNet.FileSystems 0.1-alpha-152, Microsoft.AspNet.Mvc.Razor.Host 0.1-alpha-699, Microsoft.AspNet.Razor 0.1-alpha-181, Microsoft.Bcl.Immutable 1.1.18-beta-097, Microsoft.CodeAnalysis.Common 0.7-beta-097, Microsoft.CodeAnalysis.CSharp 0.7-beta-097, System.Reflection.Metadata.Ecma335 0.7-beta-097
klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Runtime.resources
klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Runtime.resources
klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Runtime.resources
klr.exe Information: 0 : RootHost.Load name=Microsoft.Net.Runtime.resources
klr.exe Information: 0 : [ReferenceAssemblyDependencyResolver]: System.ComponentModel.DataAnnotations 4.0.0.0, mscorlib 4.0.0.0, System 4.0.0.0, System.Core 4.0.0.0, Microsoft.CSharp 4.0.0.0
klr.exe Information: 0 : Resolved dependencies for HelloWebFx in 1927ms
Copying to output path D:\Apps\nda\Preview\samples\HelloWebFx\bin\output
Packing nupkg dependency Microsoft.AspNet.Abstractions 0.1-alpha-279
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Abstractions.0.1-alpha-279 already exists.
Packing nupkg dependency Microsoft.AspNet.Hosting 0.1-alpha-300
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Hosting.0.1-alpha-300 already exists.
Packing nupkg dependency Microsoft.AspNet.Server.WebListener 0.1-alpha-245
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Server.WebListener.0.1-alpha-245 already exists.
Packing nupkg dependency Microsoft.AspNet.DependencyInjection 0.1-alpha-267
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.DependencyInjection.0.1-alpha-267 already exists.
Packing nupkg dependency Microsoft.AspNet.RequestContainer 0.1-alpha-300
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.RequestContainer.0.1-alpha-300 already exists.
Packing nupkg dependency Microsoft.AspNet.Routing 0.1-alpha-281
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Routing.0.1-alpha-281 already exists.
Packing nupkg dependency Microsoft.ComponentModel.DataAnnotations 4.0.10.0
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.ComponentModel.DataAnnotations.4.0.10.0 already exists.
Packing nupkg dependency Microsoft.AspNet.Mvc.ModelBinding 0.1-alpha-699
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Mvc.ModelBinding.0.1-alpha-699 already exists.
Packing nupkg dependency Microsoft.AspNet.Mvc.Core 0.1-alpha-699
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Mvc.Core.0.1-alpha-699 already exists.
Packing nupkg dependency Microsoft.AspNet.Mvc 0.1-alpha-699
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Mvc.0.1-alpha-699 already exists.
Packing nupkg dependency Microsoft.AspNet.Mvc.Razor 0.1-alpha-699
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Mvc.Razor.0.1-alpha-699 already exists.
Packing nupkg dependency Microsoft.AspNet.ConfigurationModel 0.1-alpha-180
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.ConfigurationModel.0.1-alpha-180 already exists.
Packing nupkg dependency Microsoft.AspNet.Diagnostics 0.1-alpha-192
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Diagnostics.0.1-alpha-192 already exists.
Packing nupkg dependency Microsoft.AspNet.FeatureModel 0.1-alpha-279
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.FeatureModel.0.1-alpha-279 already exists.
Packing nupkg dependency Microsoft.AspNet.PipelineCore 0.1-alpha-279
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.PipelineCore.0.1-alpha-279 already exists.
Packing nupkg dependency Microsoft.AspNet.Security.DataProtection 0.1-alpha-144
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Security.DataProtection.0.1-alpha-144 already exists.
Packing nupkg dependency Microsoft.Net.Runtime.Interfaces 0.1-alpha-325
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.Net.Runtime.Interfaces.0.1-alpha-325 already exists.
Packing nupkg dependency Microsoft.AspNet.HttpFeature 0.1-alpha-279
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.HttpFeature.0.1-alpha-279 already exists.
Packing nupkg dependency Microsoft.AspNet.Logging 0.1-alpha-159
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Logging.0.1-alpha-159 already exists.
Packing nupkg dependency Common 1.0.0
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Common.1.0.0 already exists.
Packing nupkg dependency Newtonsoft.Json 5.0.8
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Newtonsoft.Json.5.0.8 already exists.
Packing nupkg dependency Microsoft.AspNet.FileSystems 0.1-alpha-152
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.FileSystems.0.1-alpha-152 already exists.
Packing nupkg dependency Microsoft.AspNet.Mvc.Razor.Host 0.1-alpha-699
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Mvc.Razor.Host.0.1-alpha-699 already exists.
Packing nupkg dependency Microsoft.AspNet.Razor 0.1-alpha-181
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.AspNet.Razor.0.1-alpha-181 already exists.
Packing nupkg dependency Microsoft.Bcl.Immutable 1.1.18-beta-097
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.Bcl.Immutable.1.1.18-beta-097 already exists.
Packing nupkg dependency Microsoft.CodeAnalysis.Common 0.7-beta-097
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.CodeAnalysis.Common.0.7-beta-097 already exists.
Packing nupkg dependency Microsoft.CodeAnalysis.CSharp 0.7-beta-097
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\Microsoft.CodeAnalysis.CSharp.0.7-beta-097 already exists.
Packing nupkg dependency System.Reflection.Metadata.Ecma335 0.7-beta-097
D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\packages\System.Reflection.Metadata.Ecma335.0.7-beta-097 already exists.
Packing project dependency HelloWebFx
Source D:\Apps\nda\Preview\samples\HelloWebFx
Target D:\Apps\nda\Preview\samples\HelloWebFx\bin\output\HelloWebFx
Loaded Module: klr.net45.dll

Found DLL Export: CallApplicationMain

Activity

  1. Eilon commented on Apr 28, 2014

    @Eilon
    Contributor

    @lodejard any idea what's going on here?

  2. glennc commented on Apr 28, 2014

    @glennc
    Contributor

    There is a bug in k pack in that it assumes there is a kruntime package in the packages folder and throws if it isn't there.

    To work around this for now you can copy and paste the kruntime package from %USERPROFILE%.k\packages to the packages folder for the app.

  3. glennc commented on May 13, 2014

    @glennc
    Contributor

    This should be resolved with the new KPM pack

  4. added a commit that references this issue on Nov 21, 2018
  5. added a commit that references this issue on Jul 8, 2019
  6. ghost locked as resolved and limited conversation to collaborators on Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions