Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

here's the set up I'm trying to go work.

  1. Windows 7, with files for an "ASP.NET Web Application" (a new one created by wizard for this test) installed in c:\tfsprojects\test\test this project opens and builds in Visual Studio 2010 just fine.

  2. Windows Server 2003, running inside of VMWare Workstation 8.

  3. VMWare has a mapping so that the native filesystem c:\tfsprojects appears as \vmware-host\Shared Folders\tfsprojects inside the VM

  4. IIS inside of the VM, set up to run a default website on 80 from \vmware-host\Shared Folders\tfsprojects\test

Problem is, when I access http://localhost/test (inside the VM) I get the following error:

[HttpException (0x80070001): Failed to start monitoring changes to '\\vmware-host\Shared Folders\tfsprojects\test\'.]
   System.Web.DirMonCompletion..ctor(DirectoryMonitor dirMon, String dir, Boolean watchSubtree, UInt32 notifyFilter) +139
   System.Web.DirectoryMonitor.StartMonitoring() +42
   System.Web.DirectoryMonitor.StartMonitoringFile(String file, FileChangeEventHandler <snip>

[HttpException (0x80004005): ASP.NET Initialization Error] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +982 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128

--

I've set up the c:\tfsprojects directory to have full permissions for 'everyone' as well as explictly adding permissions for a domain anonymous user (and setting IIS to use that username for anonymous permissions under directory security tab).

--

Any ideas? This one has me completely stumped. For various reasons I can't seem to do this any other way. Hugely appreciative on any help.

share|improve this question

2 Answers 2

Looks like whatever this setup uses (SMB? Not a WS8 user...) for mapping the drive into vmware is implementing some filesystem APIs too incompletely for IIS to be able to work with it. Suggest you keep the live filesystem in the VM and SMB mount it on the host instead.

share|improve this answer
    
Or just share it out on the host system and use proper SMB to access it from the VM. –  Massimo May 6 '12 at 17:08
    
i tried using 'proper smb' also - but had the same problem.. need to investigate all this further ... thanks for all your comments. for now I've just moved all the dev stuff into the inside of the VM as trying to get this working was going to take too long –  utunga May 11 '12 at 2:32
    
What I initially suggested was "FS in VM, smb server IN VM, host mounts it" –  rackandboneman May 11 '12 at 4:57

One trick may be to disable the file-monitoring features of the development web server. Normally ASP.NET monitors for changes and restarts the application pool if something changes. There is a registry setting to disable this though. That may result in a more descriptive error further into the startup process.

You can set the registry key FCNMode to 1 to disable monitoring:

http://support.microsoft.com/kb/911272

HKLM\Software\Microsoft\ASP.NET\FCNMode

or here if running a 32-bit application pool on 64-bit Windows:

HKLM\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\FCNMode

You may want to run SysInternal's Process Monitor to determine what files/folders are being accessed that are resulting in the error. For example, it may be attempting to access C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files, and your application identity would need permissions to that folder.

If it isn't file system permissions, it may be due to the code access security (CAS) features of .NET. It probably doesn't know what to make of the VMWare mapped resources. You may want to try entering an exception for the locations. If that doesn't work, you may want to try using an SMB mapped drive to the network address of the host instead of using the VMWare networking.

CD /D C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727  
caspol.exe -m -ag 1 -url "file://\\vmware-host\*" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "file://L:/TFSProjects" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "http://localhost/*" FullTrust -exclusive on  

CD /D C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 
caspol.exe -m -ag 1 -url "file://\\vmware-host\*" FullTrust -exclusive on 
caspol.exe -m -ag 1 -url "file://L:/TFSProjects" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "http://localhost/*" FullTrust -exclusive on  

CD /D C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319   
caspol.exe -m -ag 1 -url "file://\\vmware-host\*" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "file://L:/TFSProjects" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "http://localhost/*" FullTrust -exclusive on  

CD /D C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319   
caspol.exe -m -ag 1 -url "file://\\vmware-host\*" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "file://L:/TFSProjects" FullTrust -exclusive on
caspol.exe -m -ag 1 -url "http://localhost/*" FullTrust -exclusive on  


REM display the exceptions
caspol -lf 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.