dotnet publish - NullReferenceException
See original GitHub issueSteps to reproduce
dotnet -v publish
Expected behavior
Create packages to deploy
Actual behavior
Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.DotNet.ProjectModel.ProjectModelPlatformExtensions.CollectDependencies(IDictionary
2 exports, IEnumerable
1 dependencies, HashSet1 exclusionList) at Microsoft.DotNet.ProjectModel.ProjectModelPlatformExtensions.CollectDependencies(IDictionary
2 exports, IEnumerable1 dependencies, HashSet
1 exclusionList) at Microsoft.DotNet.ProjectModel.ProjectModelPlatformExtensions.CollectDependencies(IDictionary2 exports, IEnumerable
1 dependencies, HashSet1 exclusionList) at Microsoft.DotNet.ProjectModel.ProjectModelPlatformExtensions.CollectDependencies(IDictionary
2 exports, IEnumerable1 dependencies, HashSet
1 exclusionList) at Microsoft.DotNet.ProjectModel.ProjectModelPlatformExtensions.GetPlatformExclusionList(ProjectContext context, IDictionary`2 exports) at Microsoft.DotNet.Tools.Publish.PublishCommand.PublishProjectContext(ProjectContext context, String buildBasePath, String outputPath, String configuration, Boolean nativeSubdirectories) at Microsoft.DotNet.Tools.Publish.PublishCommand.PublishAllProjects() at Microsoft.DotNet.Tools.Publish.PublishCommand.<>c__DisplayClass0_0.<Run>b__0() at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.DotNet.Tools.Publish.PublishCommand.Run(String[] args)
Environment data
dotnet --info
output:
.NET Command Line Tools (1.0.0-preview2-002900)
Product Information: Version: 1.0.0-preview2-002900 Commit SHA-1 hash: f4ceb1f213
Runtime Environment: OS Name: Windows OS Version: 10.0.14342 OS Platform: Windows RID: win10-x64
restore/build/run running without errors
Issue Analytics
- State:
- Created 7 years ago
- Comments:9
Top GitHub Comments
I think it could do with the fact that
Microsoft.NETCore.App
is put in the dependencies andproject.json
(at least the one posted above, thanks @Tazer) targetsnet461
. @Tazer diddotnet restore
run on thatproject.json
successfuly?This solution unfortunetly no, but new dotnet RTM resolved 😃