Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
When my project and sources are located on a network drive, F7 always rebuilds. I'm talking about Visual Studio 2010, C#, form applications. The network drive is provided by a samba share. smb.conf is as follows:
Quote:
[global]
protocol = SMB2

[root]
comment = the whole file system
read only = false
locking = no
path = /
hosts allow = all
writeable = yes
browsable = yes
create mode = 0644
directory mode = 0755
guest ok = yes
public = yes
This is while when on a local drive (C:), there's not such problem. It seems that there's an issue with modification times of files. The machine in which Windows is installed is a virtual machine provided by VirtualBox, although I don't see it as a cause. Any idea?

What I have tried:

I've no clue what the cause may be.
Posted
Updated 19-May-18 1:10am

I have seen this in the past where such shares do not sync the dates and times correctly, so Visual Studio always thinks that some sources are out of date.
 
Share this answer
 
v2
Comments
ilostmyid2 21-May-18 5:31am    
the question is exactly this, what causes the date-time not to be synced?
Richard MacCutchan 21-May-18 5:41am    
It's an issue with Samba.
You can try to set the
dos filetime resolution = yes
fake directory create times = yes
options. This was necessary with older VS versions but I don't know if recent VS versions still behave as described at smb.conf[^]:
dos filetime resolution (S)
Under the DOS and Windows FAT filesystem, the finest granularity on time resolution is two seconds. Setting this parameter for a share causes Samba to round the reported time down to the nearest two second boundary when a query call that requires one second resolution is made to smbd(8).

This option is mainly used as a compatibility option for Visual C++ when used against Samba shares. If oplocks are enabled on a share, Visual C++ uses two different time reading calls to check if a file has changed since it was last read. One of these calls uses a one-second granularity, the other uses a two second granularity. As the two second call rounds any odd second down, then if the file has a timestamp of an odd number of seconds then the two timestamps will not match and Visual C++ will keep reporting the file has changed. Setting this option causes the two timestamps to match, and Visual C++ is happy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900