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

IOException: The file 'obj\Debug\net35\annotated\System.Core.xml' already exists. #74

Open
jnm2 opened this issue Jan 3, 2020 · 4 comments · Fixed by #75
Open

IOException: The file 'obj\Debug\net35\annotated\System.Core.xml' already exists. #74

jnm2 opened this issue Jan 3, 2020 · 4 comments · Fixed by #75
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@jnm2
Copy link
Contributor

jnm2 commented Jan 3, 2020

error MSB4018: The "AnnotatorBuildTask" task failed unexpectedly.
System.IO.IOException: The file 'obj\Debug\net35\annotated\System.Core.xml' already exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at System.IO.File.Copy(String sourceFileName, String destFileName)
at TunnelVisionLabs.ReferenceAssemblyAnnotator.AnnotatorBuildTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

@sharwell If the file exists, would there ever be a reason that it would need to be updated? Rather than passing overwrite: true, maybe the IOException could be swallowed based on the error code (probably ERROR_FILE_EXISTS).

@jnm2 jnm2 changed the title System.IO.IOException: The file 'obj\Debug\net35\annotated\System.Core.xml' already exists. IOException: The file 'obj\Debug\net35\annotated\System.Core.xml' already exists. Jan 3, 2020
@jnm2
Copy link
Contributor Author

jnm2 commented Jan 3, 2020

Not sure why this repros every single time when building NUnit in VS (no successful builds) but works from the command line. There might be something more here.

@jnm2
Copy link
Contributor Author

jnm2 commented Jan 3, 2020

Ah, just figured it out. Repeated /t:Rebuild always works. Repeated /t:Build always crashes. Maybe the targets have incremental build problems.

@sharwell sharwell added bug Something isn't working help wanted Extra attention is needed labels Jan 3, 2020
@jnm2
Copy link
Contributor Author

jnm2 commented Jan 3, 2020

@sharwell I can't reopen but I think there is more work here.

@sharwell sharwell removed the help wanted Extra attention is needed label Jan 3, 2020
@sharwell sharwell reopened this Jan 3, 2020
@sharwell sharwell added the help wanted Extra attention is needed label Jan 3, 2020
@jnm2
Copy link
Contributor Author

jnm2 commented Feb 18, 2020

I'm consistently reproing this in CI with alpha.154 which I thought had the fix:

%userprofile%.nuget\packages\tunnelvisionlabs.referenceassemblyannotator\1.0.0-alpha.154\build\TunnelVisionLabs.ReferenceAssemblyAnnotator.targets(120,5): error MSB4018: The "AnnotatorBuildTask" task failed unexpectedly.

System.IO.IOException: The file 'obj\Release\annotated\System.Core.xml' already exists.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost) 
at System.IO.File.Copy(String sourceFileName, String destFileName) 
at TunnelVisionLabs.ReferenceAssemblyAnnotator.AnnotatorBuildTask.Execute() 
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() 
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants