-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not crash when a TaskFactory returns a null TaskType #1508
Labels
Milestone
Comments
The title should be "Do not crash when a TaskFactory returns a null TaskType" |
ulrichb
changed the title
Improve debugging diagnostic when a TaskFactory returns a null TaskType
Do not crash when a TaskFactory returns a null TaskType
Dec 30, 2016
jeffkl
added a commit
to jeffkl/msbuild
that referenced
this issue
Jul 28, 2017
If TaskType is null it can cause a NullReferenceException in our code. This change ensures that ITaskFactory implementations return a value for this property. Fixes dotnet#1508
jeffkl
added a commit
to jeffkl/msbuild
that referenced
this issue
Jul 28, 2017
If TaskType is null it can cause a NullReferenceException in our code. This change ensures that ITaskFactory implementations return a value for this property. Fixes dotnet#1508
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When inspecting the MSBuild error reported in this issue, the most exhausting part was to identify which value in
TaskExecutionHost.FindTaskInRegistry
was actuallynull
.It was
TaskFactory.TaskType
, and the.FullName
-access threw theNullReferenceException
(see TaskExecutionHost.cs, line 987), which crashed MSBuild with "error MSB1025: An internal failure occurred while running MSBuild".Please add a null-check before the
.FullName
-access to improve debuggging when aTaskFactory
behaves wrong.The text was updated successfully, but these errors were encountered: