You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/msbuild/updating-an-existing-application.md
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,33 @@ Do not specify `ExcludeAssets=runtime` for the Microsoft.Build.Locator package.
79
79
80
80
### Register instance before calling MSBuild
81
81
82
-
Add a call to the Locator API before calling any method that uses MSBuild.
82
+
> [!IMPORTANT]
83
+
> You cannot reference any MSBuild types (from the `Microsoft.Build` namespace) in the method that calls MSBuildLocator. For example, you cannot do this:
84
+
>
85
+
> ```csharp
86
+
>voidThisWillFail()
87
+
> {
88
+
>MSBuildLocator.RegisterDefaults();
89
+
>Projectp=newProject(SomePath); // Could be any MSBuild type
0 commit comments