Skip to content
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

Closed
ulrichb opened this issue Dec 26, 2016 · 1 comment
Closed

Do not crash when a TaskFactory returns a null TaskType #1508

ulrichb opened this issue Dec 26, 2016 · 1 comment
Labels
Milestone

Comments

@ulrichb
Copy link

ulrichb commented Dec 26, 2016

When inspecting the MSBuild error reported in this issue, the most exhausting part was to identify which value in TaskExecutionHost.FindTaskInRegistry was actually null.

It was TaskFactory.TaskType, and the .FullName-access threw the NullReferenceException (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 a TaskFactory behaves wrong.

@danmoseley
Copy link
Member

The title should be "Do not crash when a TaskFactory returns a null TaskType"

@ulrichb 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
@rainersigwald rainersigwald added this to the MSBuild 15 Update milestone Feb 10, 2017
@Sarabeth-Jaffe-Microsoft Sarabeth-Jaffe-Microsoft modified the milestones: MSBuild 15 Update, MSBuild 15 - "2.0" Mar 3, 2017
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
jeffkl added a commit that referenced this issue Jul 31, 2017
…y. (#2363)

* Display an error if an ITaskFactory does not set the TaskType property.

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 #1508
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants