Invalid Command Line Switch for link.exe when building - by Doug Porter In Athens

Status : 

  External<br /><br />
		This item may be valid but belongs to an external system out of the direct control of this product team.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


5
0
Sign in
to vote
ID 635940 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/13/2011 8:53:30 AM
Access Restriction Public

Description

When building a solution I get:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(268,5): error MSB6001: Invalid command line switch for "link.exe". Not a valid Win32 FileTime.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(268,5): error MSB6001: Parameter name: fileTime

It's not consistent and often if I do a full rebuild it will build correctly.    I would guess it fails 80-90% of the time I try to build.

This happens in every solution I have, regardless of size.  If I keep trying to build eventually it will work.

Here's a forum thread on the issue:
http://social.msdn.microsoft.com/Forums/eu/msbuild/thread/02005f01-cca3-4add-a97e-e7c1e953c38d

The problem started for me in mid December.
Sign in to post a comment.
Posted by Remus MP on 2/18/2014 at 12:40 AM
I have the same problem in VS 2013 and I confirm Citrix is responsible for it. However, including
<ItemGroup>
<ClNoDependencies Include="\\.\CTXSBX;CTXSBX"/>
</ItemGroup>
to the top of my project file did not solve the issue. The only workaround so far is to kill Citrix but this is not a good solution for me because I am developing on one workstation and testing on another one to which I connect through Citrix.

Are there any other workarounds that do not involve killing Citrix? Many thanks!
Posted by Microsoft on 1/28/2011 at 7:32 PM
Doug, we intercept file system accesses made by tools like Link, CL and so forth in order to know which files to timestamp check for incremental builds. This must mean that somehow Citrix is intercepting above the level of the Createfile Win32 call in order to open this \\.\CTXSBX -- which to my knowledge means it's operating within the tool process somehow - perhaps using binary rewriting on the fly as we do ourselves? Why this happens is something I'm afraid you'll have to ask Citrix about.

I don't have Citrix so I can't repro this and test but it's just posisble the following might help. Add this to the top of your project:
<ItemGroup>
<ClNoDependencies Include="\\.\CTXSBX;CTXSBX"/>
</ItemGroup>

that is supposed to exclude it from the list of files we record. See if it causes this stuff to vanish from the .tlog files in your obj directory -- which is where the list is stored.

At this time I'm going ot have to resolve the bug external - it sounds like you can disable your XenApp clients as another workaround.

Sorry about the bug.
Dan
Posted by Doug Porter In Athens on 1/27/2011 at 11:09 AM
I have not had a failed build since I uninstalled the citrix clients. I'm very relieved, but also a bit confused. Any idea why citrix is sticking its fingers into my build process? I don't understand the connection.

Posted by Doug Porter In Athens on 1/26/2011 at 3:20 PM
I uninstalled both citrix online and offline clients and, so far, it seems to be working. I've built about 5 times and so far so good.
Posted by Doug Porter In Athens on 1/26/2011 at 2:38 PM
I'm not, but I do have XenApp clients installed for testing our app under citrix.
Posted by Microsoft on 1/26/2011 at 2:29 PM
Hello Doug,
Thanks for the project files. From looking at your last build output I'm seeing the following string in several of your .tlog files:
\\.\CTXSBX

The best that I can figure out is that ctxsbx is a driver associated with Citrix's XenApp (previously known as Citrix Presenation Server). Are you by chance using this product or a similar product?

James Johansen
Visual C++ Project/Build Team
Posted by Doug Porter In Athens on 1/19/2011 at 8:55 AM
I attached a project. I included the entire build state as I think it's more likely you'll find the problem from the current state than from the raw project. It took about a half dozen builds to get the error to show on this project. On my main app it happens effectively every time, often taking a dozen tries to get it to build correctly.
Posted by Doug Porter In Athens on 1/19/2011 at 8:46 AM
I'm trying to get a small sample w/ code I can send to reproduce it. In doing so I've seen several warnings or errors that seem similar:


1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(608,5): warning MSB6008: Forcing a rebuild of all sources due to an error with the tracking logs. Not a valid Win32 FileTime.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(608,5): warning MSB6008: Parameter name: fileTime


-------------------------
And these from a different project:
-------------------------

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018: The "CL" task failed unexpectedly.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018: System.AggregateException: One or more errors occurred. ---> System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018: Parameter name: fileTime
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.DateTime.FromFileTimeUtc(Int64 fileTime)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.NativeMethods.GetLastWriteTimeUtc(String fullPath)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.IsUpToDate(ITaskItem sourceFile)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.CheckIfSourceNeedsCompilation(ConcurrentQueue`1 sourcesNeedingCompilationList, Boolean allOutputFilesExist, ITaskItem source)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.<>c__DisplayClass1.<ComputeSourcesNeedingCompilationFromPrimaryFiles>b__0(Int32 index)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.InnerInvoke()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object )
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    --- End of inner exception stack trace ---
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, Action`1 body)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.ComputeSourcesNeedingCompilationFromPrimaryFiles()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.ComputeSourcesNeedingCompilation(Boolean searchForSubRootsInCompositeRootingMarkers)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.CPPTasks.CL.ComputeOutOfDateSources()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.SkipTaskExecution()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.ToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.CPPTasks.TrackedVCToolTask.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018: ---> (Inner Exception #0) System.ArgumentOutOfRangeException: Not a valid Win32 FileTime.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018: Parameter name: fileTime
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.DateTime.FromFileTimeUtc(Int64 fileTime)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.NativeMethods.GetLastWriteTimeUtc(String fullPath)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.IsUpToDate(ITaskItem sourceFile)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.CheckIfSourceNeedsCompilation(ConcurrentQueue`1 sourcesNeedingCompilationList, Boolean allOutputFilesExist, ITaskItem source)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at Microsoft.Build.Utilities.CanonicalTrackedInputFiles.<>c__DisplayClass1.<ComputeSourcesNeedingCompilationFromPrimaryFiles>b__0(Int32 index)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Parallel.<>c__DisplayClassf`1.<ForWorker>b__c()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.InnerInvoke()
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:    at System.Threading.Tasks.Task.<>c__DisplayClass7.<ExecuteSelfReplicating>b__6(Object )<---
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(58,5): error MSB4018:
1>
1>Build FAILED.


---------------------------------

When I get a small project with code I can share to display the error I will attach it. In every case, "Not a valid Win32 FileTime" has been mentioned.
Posted by Microsoft on 1/13/2011 at 9:22 PM
Thanks for reporting this issue. In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Please give us a demo project to demonstrate this issue so that we can conduct further research.

It would be greatly appreciated if you could provide us with that information as quickly as possible. If we do not hear back from you within 5 days, we will close this issue.

Thanks again for your efforts and we look forward to hearing from you.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 1/13/2011 at 9:14 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)