msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

MSBUILD : error : System.NullReferenceException: Object reference not set to an instance of an object

Open liuqinghongl opened this issue 1 year ago • 2 comments

Issue Description

[builder 4/4] RUN dotnet publish Jellyfin.Server --disable-parallel --configuration Release --output="/jellyfin" --self-contained --runtime linux-x64 -p:DebugSymbols=false -p:DebugType=none:
13.43 MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : System.NullReferenceException: Object reference not set to an instance of an object. [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at Regex1_Scan(RegexRunner, ReadOnlySpan1) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.ScanInternal(RegexRunnerMode mode, Boolean reuseMatchObject, String input, Int32 beginning, RegexRunner runner, ReadOnlySpan1 span, Boolean returnNullIfReuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String inputString, ReadOnlySpan1 inputSpan, Int32 startat, TState& state, MatchCallback1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String input, Int32 startat, TState& state, MatchCallback1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Expander2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.EvaluateItemDefinitionElement(ProjectItemDefinitionElement itemDefinitionElement) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.EvaluateItemDefinitionGroupElement(ProjectItemDefinitionGroupElement itemDefinitionGroupElement) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.Evaluate() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, IDirectoryCacheFactory directoryCacheFactory, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable1 projectLoadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable1 projectLoadSettings) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass61_0.<LoadProjectIntoConfiguration>b__0() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]

Steps to Reproduce

This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled [/repo/Jellyfin.Server/Jellyfin.Server.csproj]

Actual Behavior

This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled [/repo/Jellyfin.Server/Jellyfin.Server.csproj]

Analysis

no

Versions & Configurations

10.9.x

liuqinghongl avatar Aug 27 '24 02:08 liuqinghongl

13.43 MSBUILD : error : This is an unhandled exception in MSBuild -- PLEASE UPVOTE AN EXISTING ISSUE OR FILE A NEW ONE AT https://aka.ms/msbuild/unhandled [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : System.NullReferenceException: Object reference not set to an instance of an object. [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at Regex1_Scan(RegexRunner, ReadOnlySpan1) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.ScanInternal(RegexRunnerMode mode, Boolean reuseMatchObject, String input, Int32 beginning, RegexRunner runner, ReadOnlySpan1 span, Boolean returnNullIfReuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String inputString, ReadOnlySpan1 inputSpan, Int32 startat, TState& state, MatchCallback1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]
13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.RunAllMatchesWithCallback[TState](String input, Int32 startat, TState& state, MatchCallback1 callback, RegexRunnerMode mode, Boolean reuseMatchObject) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at System.Text.RegularExpressions.Regex.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Expander2.MetadataExpander.ExpandMetadataLeaveEscaped(String expression, IMetadataTable metadata, ExpanderOptions options, IElementLocation elementLocation, LoggingContext loggingContext) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Expander2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.EvaluateItemDefinitionElement(ProjectItemDefinitionElement itemDefinitionElement) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.EvaluateItemDefinitionGroupElement(ProjectItemDefinitionGroupElement itemDefinitionGroupElement) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.Evaluate() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Evaluation.Evaluator4.Evaluate(IEvaluatorData4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary1 environmentProperties, ILoggingService loggingService, IItemFactory2 itemFactory, IToolsetProvider toolsetProvider, IDirectoryCacheFactory directoryCacheFactory, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Execution.ProjectInstance.Initialize(ProjectRootElement xml, IDictionary2 globalProperties, String explicitToolsVersion, String explicitSubToolsetVersion, Int32 visualStudioVersionFromSolution, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable1 projectLoadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.Execution.ProjectInstance..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, BuildParameters buildParameters, ILoggingService loggingService, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, Nullable1 projectLoadSettings) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.BuildRequestConfiguration.<>c__DisplayClass61_0.<LoadProjectIntoConfiguration>b__0() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.BuildRequestConfiguration.InitializeProject(BuildParameters buildParameters, Func`1 loadProjectFromFile) [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.RequestBuilder.BuildProject() [/repo/Jellyfin.Server/Jellyfin.Server.csproj] 13.43 MSBUILD : error : at Microsoft.Build.BackEnd.RequestBuilder.RequestThreadProc(Boolean setThreadParameters) [/repo/Jellyfin.Server/Jellyfin.Server.csproj]

liuqinghongl avatar Aug 27 '24 02:08 liuqinghongl

RUN dotnet publish Jellyfin.Server --configuration Release --output="/jellyfin" --self-contained --runtime linux-arm64 -p:DebugSymbols=false -p:DebugType=none

liuqinghongl avatar Aug 27 '24 08:08 liuqinghongl

@liuqinghongl from the provided info I guess Jellyfin.Server is in Jellyfin that guides how to build from source. The build happened on linux. I tried to reproduce this issue on linux using both non-container image and container image following the guide. Build succeeded. I couldn't reproduce this issue. The used dotnet version was 8.0.401.

If my guess is wrong, can you provide detailed info to help reproducing the issue including the following?

  • The source code or an example project to produce.
  • Steps to reproduce.
  • dotnet info - run the command dotnet --info to get
  • OS: Linux, Windows or macOS.

GangWang01 avatar Sep 02 '24 09:09 GangWang01

This issue is marked as stale because feedback has been requested for 30 days with no response. Please respond within 14 days or this issue will be closed due to inactivity.

This issue was closed due to inactivity. If you can still reproduce this bug, please comment with the requested information, detailed steps to reproduce the problem, or any other notes that might help in the investigation.