Compiling VS 2005 Beta2 to a mounted network share
Compiling VS 2005 Beta2 to a mounted network share
Hi,
I tried to do the following. Create a simple c++ hello world app over on a mounted network share (lives on a netapp box). Created the project just fine, but when doing a compile, it fails. Here is the build log file. Any idea what is wrong Clearly I have write permissions to the files.
Ok, in writing this query, I decided to try it to a network share on another windows box (our server). Again mounted as a drive. It works fine there.
So, this sounds like some kind of weirdness on the netapp box with permissions or something.
If anyone has any insight, please let me know.
Thanks.
Bob.
| | | Build started: Project: testconsole2, Configuration: Debug|Win32
|
| | | Creating temporary file "u:\testconsole2\testconsole2\Debug\RSP0000032203220.rsp" with contents [ /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Yu"stdafx.h" /Fp"Debug\testconsole2.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP .\testconsole2.cpp ] Creating command line "cl.exe @u:\testconsole2\testconsole2\Debug\RSP0000032203220.rsp /nologo /errorReport:prompt" Creating temporary file "u:\testconsole2\testconsole2\Debug\RSP0000042203220.rsp" with contents [ /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /GS- /Yc"stdafx.h" /Fp"Debug\testconsole2.pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /c /Wp64 /ZI /TP .\stdafx.cpp ] Creating command line "cl.exe @u:\testconsole2\testconsole2\Debug\RSP0000042203220.rsp /nologo /errorReport:prompt" |
| | | Compiling... cl : Command line error D8022 : cannot open 'u:\testconsole2\testconsole2\Debug\RSP0000042203220.rsp' |
| | | Build log was saved at "file://u:\testconsole2\testconsole2\Debug\BuildLog.htm" testconsole2 - 1 error(s), 0 warning(s) |
Compiling VS 2005 Beta2 to a mounted network share
Ragin Cajun
also, in case anyone cares, I located the change that caused this issue. it is a fix for a potential security issue and crash.
TANSTAAFL
cheers,
josh
Pieter M
[I entered the info below into the bug report, but I thought I'd also paste it here so more ppl might see it]:
here is the analysis of the problem, for those interested, and some possible work-arounds. it is based on the only repro case that we have, so it may or may not apply to all instances of this problem. thanks go to the folks who helped with this (Zak Kramer et al)
the situation appears to be:
1. DEVENV - running as <local machine>\<user>
2. Mapped Drive - Writing/Reading from the server using <domain>\<user>
You have access to the file share since you have set up the mapped drive and your domain account has rights to write to the folder on the server.
Now, when you start a build DEVENV will write the RSP file to the share. You have permission to do this because of the domain credentials for the mapped drive. When DEVENV does that CreateFile API call (<http://msdn.microsoft.com/library/default.asp url=/library/en-us/fileio/base/createfile.asp>) they pass an lpSecurityAttributes parameter. This specifies what users have access to this file. In this case they grant the local administrator (in this case the server’s admin group) and the current user that dev env is running as. Now, the problem is that the domain machine has no knowledge of the local user. Each user has a unique SID. This SID is what is used when we set the security.
After that the compiler comes along and attempts to read the file. The file is one the mapped drive so your domain credentials are used. However your domain user’s SID does not equal the local user SID and is not in the server’s admin group so the access is denied.
This whole issue grows out of the fact that the C++ build does not support network builds as disucussed in:
255252 INFO: Accessing and Building Projects Over a Network Through Visual C++
<http://support.microsoft.com/ id=255252>
possible work-arounds:
1. Build local - Obvious, but is an option in some cases
2. Log on as the domain user
3. Move your domain users into the Admin Group on the server - This will mean that they are in the Access Control list for these temp files since we also allow the server Admin’s to have rights to the files.
4. Launch Visual Studio as the Domain User - This is a pretty neat trick. It basically extends what you are doing with the mapped drive to the Visual Studio process. There are a couple of ways that you can set this up:
a. RunAs from the shortcut - Basically this is done by right clicking on the VS.NET shortcut and selecting RunAs
b. Create or alter a shortcut to always RunAs the Domain User - With this you can alter the current or create a new one. Here is an article that discusses this:
294676 How To Enable and Use the "Run As" Command When Running Programs in
<http://support.microsoft.com/ id=294676>
c. Create or alter a batch file to launch devenv as a domain user - This can be done with RunAs.Exe:
Runas.exe
<http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/runas.mspx>
Now, the one drawback that we first noticed when using the RunAs is that you do not have the Mapped Drive at this point. This is because when Windows does RunAs it loads up the profile of that user. This article talks a bit about this:
303308 Cannot Use Runas.exe to Run Remote Programs on Mapped Drives
<http://support.microsoft.com/ id=303308>
There is a simple workaround for this and that is to simply map that drive under that profile or you can use the UNC path. Finally, once you launch VS.NET you can map the drive from the Open Menu. Just navigate to the server. Right click on the folder and select “Map Drive” and then reconnect at logon.
I hope that information is useful. we are continuing to look for ways to address this problem.
josh
VC++ project system developer
bigshop
We are quite happy developing with our projects and source on our server and have no wish to change (projects are only accessed by one person at a time and ALL files are on the server so time stamps problems should be irrelevant).
Why should time stamps be more of a problem with VS2005 than previous versions anyway
PLEASE come up with a solution.
CoolDeep
Rayven
Definite Reaction
We use network shares because that is where our students store their files. If we used local directories, then they have to spend time copying files back and forth from the lab machines. If there is a better solution than using a network share, I'd certainly love to hear about it.
Bob.
MaxMan1
I've been experimenting with a system created using Virtual PC (we are contemplating offering a VPC system to the students with their stuff preloaded and ready to rock and roll). I haven't tried the roaming profile idea (I assume that you mean that the students would just leave their files on their desktop).
I did try mounting the drive and then setting up the solution directory under "work offline". This didn't change what VS.Net did It still fails with the same error saying that it can't find the file that it just tried to write. Assuming that when you say shadowed folders, synchronized directories is the same thing, then that doesn't work.
I'll muck around with a roaming profile next.
Thanks again.
Bob.
maypo
A followup - is that it doesn't fail when using VS 2003 The only thing that I noticed in the build log is that the name of the temporary files is now longer Attached is a version that works using VS 2003.
Thanks.
Bob.
Vikas1111
Apparently this is not *fixed*.
As for me doing things and compiling from mouted drives makes some sense right now.
Devo
Ronald Laeremans
Visual C++ team
cnuk
Thanks,
Anuj Purwar
On a project that is build locally, I get the Rebuild error:
My environment is fully patched XP Pro and VS 2005 (SP 050727-7600). I do not get the error when I Build, only with a Rebuild. The error goes away when I change project Properties, Configuration Properties, General, and then change Intermediate Directory from $(ConfigurationName) to $(temp)\$(ProjectName)\$(ConfigurationName).
Thanks,
-Brian
fudata
I'm running into this same problem. My scenario is as follows:
I have a desktop machine and a laptop machine. I frequently develop on the laptop at remote locations, so I choose to keep all of my code files on that machine and access them through my network when I'm at home and working on the desktop. That way I always have the latest versions of all of my code, and I don't have to worry about copying files between machines and synchronizing file changes since I'm always working from the same set of files.
With VS 2005 I'm able to compile a C++ project on the laptop, but I'm unable to compile the exact same code on the desktop due to the fact that I'm accessing it through a mapped drive.
Is there an environment variable or something that needs to be set This works perfectly for other VS projects (C#, VB, VB6, etc) and I've worked this way for 6 years with no problems. We've done very few C++ projects so this problem may have existed in previous VS editions but I've just recently run into the problem with a C++ project I'm working on.
JohnCBisys
http://lab.msdn.microsoft.com/ProductFeedback/viewFeedback.aspx feedbackid=8fb28ec3-897a-4467-a2ca-6e11d7c324ac
Thanks,