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

15.8 Internal MSBuild Error #5504

Closed
asik opened this Issue Aug 14, 2018 · 13 comments

Comments

Projects
None yet
7 participants
@asik

asik commented Aug 14, 2018

Upgrade from 15.7.6 to 15.8
Open solution
Build (Rebuild, Clean/Rebuild, whatever)

1>------ Rebuild All started: Project: ****************, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: ********************, Configuration: Debug Any CPU ------
2>Unhandled Exception:MSB0001: Internal MSBuild Error: Already registered for build-time.
2>Error: MSB0001: Internal MSBuild Error: Already registered for build-time..

I emptied all VS cache folders and ran a repair install, no luck.
I could repro with a dummy solution with just an empty console app and 2 empty libraries, all on .NET Framework (not .NET Core or Standard). However after closing and reopening VS on that solution, I could no longer repro.
ConsoleApplication2.zip

I can always repro on our solution with 90+ projects (mix F#/C#, all .NET Framework).

Tools->Options->Projects and Solutions->Build and Run->
Reducing the number of parallel projects to 1 was a workaround.

Another weird thing I noticed is that in the Project Properties->Application, the Target Framework dropdown is empty:

image

Since this version seems completely broken and I need to work, I'm going to downgrade to the previous release using these instructions https://docs.microsoft.com/en-us/visualstudio/productinfo/installing-an-earlier-release-of-vs2017

EDIT: The problem is gone after reverting back to 15.7.6.

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 14, 2018

Collaborator

This is currently being looked into, though when I open the repro solution and build on my machine, it succeeds:

(big log elided)
3>Target "PrepareForRun" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "CoreBuild" depends on it):
3>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "IncrementalClean" depends on it):
3>Target "IncrementalClean" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "CoreBuild" depends on it):
3>Target "CoreBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "Build" depends on it):
3>Target "AfterBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "Build" depends on it):
3>Target "Build" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (entry point):
3>Done building project "ConsoleApplication2.fsproj".
3>
3>Build succeeded.
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Collaborator

cartermp commented Aug 14, 2018

This is currently being looked into, though when I open the repro solution and build on my machine, it succeeds:

(big log elided)
3>Target "PrepareForRun" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "CoreBuild" depends on it):
3>Target "_CleanGetCurrentAndPriorFileWrites" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "IncrementalClean" depends on it):
3>Target "IncrementalClean" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "CoreBuild" depends on it):
3>Target "CoreBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "Build" depends on it):
3>Target "AfterBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (target "Build" depends on it):
3>Target "Build" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets" from project "C:\Users\phcart\Downloads\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.fsproj" (entry point):
3>Done building project "ConsoleApplication2.fsproj".
3>
3>Build succeeded.
========== Build: 3 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 14, 2018

Collaborator

I can reproduce the target framework dropdown being empty, though.

Collaborator

cartermp commented Aug 14, 2018

I can reproduce the target framework dropdown being empty, though.

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 15, 2018

Collaborator

For posterity

MSBuild issue: Microsoft/msbuild#3610
Devcom issue: https://developercommunity.visualstudio.com/content/problem/311575/exceptionmsb0001-internal-msbuild-error-already-re.html

Labeling this as external unless we get confirmation that is an issue on our side. If it's determined that this is not in our own code, we'll close this as an external bug.

Collaborator

cartermp commented Aug 15, 2018

For posterity

MSBuild issue: Microsoft/msbuild#3610
Devcom issue: https://developercommunity.visualstudio.com/content/problem/311575/exceptionmsb0001-internal-msbuild-error-already-re.html

Labeling this as external unless we get confirmation that is an issue on our side. If it's determined that this is not in our own code, we'll close this as an external bug.

@cartermp cartermp added this to the 15.9 milestone Aug 15, 2018

@BentTranberg

This comment has been minimized.

Show comment
Hide comment
@BentTranberg

BentTranberg Aug 16, 2018

I'm having this issue after upgrading to VS 15.8.0, and I have a feeling many developers will report this in the next few days. Although it looks like an external issue, I also suspect it is strongly related to F#. I found one issue on SO, and there was a mix of F# and C#. Also found another older issue (probably other cause then) on developercommunity.visualstudio.com where a mix of F# and C# is mentioned. Haven't googled thoroughly. Then I follow the first link above, and there too a mix of F# and C# is mentioned. So I hope we (the F# community) push for a quick solution to this. The workaround works, but it slows down builds considerably. (edit: My second machine was updated to 15.8.1, and don't have the problem. My first machine was updated from 15.8.0 to 15.8.1 and still has the problem.) (edit2: Both machines have the problem.)

BentTranberg commented Aug 16, 2018

I'm having this issue after upgrading to VS 15.8.0, and I have a feeling many developers will report this in the next few days. Although it looks like an external issue, I also suspect it is strongly related to F#. I found one issue on SO, and there was a mix of F# and C#. Also found another older issue (probably other cause then) on developercommunity.visualstudio.com where a mix of F# and C# is mentioned. Haven't googled thoroughly. Then I follow the first link above, and there too a mix of F# and C# is mentioned. So I hope we (the F# community) push for a quick solution to this. The workaround works, but it slows down builds considerably. (edit: My second machine was updated to 15.8.1, and don't have the problem. My first machine was updated from 15.8.0 to 15.8.1 and still has the problem.) (edit2: Both machines have the problem.)

@Savelenko

This comment has been minimized.

Show comment
Hide comment
@Savelenko

Savelenko Aug 17, 2018

I also came across this issue, on two different machines after upgrade to VS 15.8 on .NET Framework.

Savelenko commented Aug 17, 2018

I also came across this issue, on two different machines after upgrade to VS 15.8 on .NET Framework.

@hejoco

This comment has been minimized.

Show comment
Hide comment
@hejoco

hejoco Aug 20, 2018

Experiencing same issue after upgrading to 15.8. My solution has one C# project and three F# projects.
The error message always complains about the same F# project.
All F# projects have empty Target Framework.

hejoco commented Aug 20, 2018

Experiencing same issue after upgrading to 15.8. My solution has one C# project and three F# projects.
The error message always complains about the same F# project.
All F# projects have empty Target Framework.

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Aug 23, 2018

Collaborator

After a thorough investigation with the MSBuild and Project System teams, we've identified the sources of the problem and a few possible fixes. The cheapest one we arrived at would involve changing the F# classic project system, so we'll be doing that (hence the label change). The issue arises when this condition is met.

We're currently working on a fix, but we'll need to assess the impact of that fix before pushing anything.

Collaborator

cartermp commented Aug 23, 2018

After a thorough investigation with the MSBuild and Project System teams, we've identified the sources of the problem and a few possible fixes. The cheapest one we arrived at would involve changing the F# classic project system, so we'll be doing that (hence the label change). The issue arises when this condition is met.

We're currently working on a fix, but we'll need to assess the impact of that fix before pushing anything.

@BentTranberg

This comment has been minimized.

Show comment
Hide comment
@BentTranberg

BentTranberg Aug 23, 2018

I doubt the following is useful information, but just in case it is. Not a practical problem for me - just an observation.

I have set the number of concurrent builds to 1, as a workaround for this issue, which affects all my solutions on all machines. Mix of C#/F#/Framework/Standard/Core. It has worked flawlessly until now. When I tried to add a package with NuGet (not Paket), I got one set of these errors (they come in pairs as shown in the top post here) in spite of the workaround. Retrying solved it there and then.

BentTranberg commented Aug 23, 2018

I doubt the following is useful information, but just in case it is. Not a practical problem for me - just an observation.

I have set the number of concurrent builds to 1, as a workaround for this issue, which affects all my solutions on all machines. Mix of C#/F#/Framework/Standard/Core. It has worked flawlessly until now. When I tried to add a package with NuGet (not Paket), I got one set of these errors (they come in pairs as shown in the top post here) in spite of the workaround. Retrying solved it there and then.

KevinRansom added a commit to KevinRansom/visualfsharp that referenced this issue Aug 26, 2018

KevinRansom added a commit to KevinRansom/visualfsharp that referenced this issue Aug 27, 2018

@curdincaspar

This comment has been minimized.

Show comment
Hide comment
@curdincaspar

curdincaspar Sep 3, 2018

@cartermp What is the status of this?

curdincaspar commented Sep 3, 2018

@cartermp What is the status of this?

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Sep 3, 2018

Collaborator

@curdincaspar There is a fix out at #5557, but @KevinRansom is currently fixing CI before that can be merged.

Collaborator

cartermp commented Sep 3, 2018

@curdincaspar There is a fix out at #5557, but @KevinRansom is currently fixing CI before that can be merged.

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Sep 6, 2018

Collaborator

Now that the fix is merged, users with the nightly builds can see it. We'll be striving for a servicing fix for 15.8 and also merging this into the 15.9 branch. We'll report back when we have more detailed information.

Collaborator

cartermp commented Sep 6, 2018

Now that the fix is merged, users with the nightly builds can see it. We'll be striving for a servicing fix for 15.8 and also merging this into the 15.9 branch. We'll report back when we have more detailed information.

KevinRansom added a commit to KevinRansom/visualfsharp that referenced this issue Sep 6, 2018

KevinRansom added a commit to KevinRansom/visualfsharp that referenced this issue Sep 6, 2018

@KevinRansom KevinRansom reopened this Sep 6, 2018

@KevinRansom

This comment has been minimized.

Show comment
Hide comment
@KevinRansom

KevinRansom Sep 6, 2018

Contributor

Let's close when it's inserted into a shipping branch.

Contributor

KevinRansom commented Sep 6, 2018

Let's close when it's inserted into a shipping branch.

brettfo added a commit that referenced this issue Sep 11, 2018

Merge pull request #5597 from KevinRansom/cp5504
CherryPick into dev15.8 (Fixes #5504 - 15.8 Internal MSBuild Error (#5557))

@cartermp cartermp modified the milestones: 15.9, 15.8 Sep 15, 2018

@cartermp

This comment has been minimized.

Show comment
Hide comment
@cartermp

cartermp Sep 20, 2018

Collaborator

This has been inserted and shipped in 15.8.5.

Collaborator

cartermp commented Sep 20, 2018

This has been inserted and shipped in 15.8.5.

@cartermp cartermp closed this Sep 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment