aspnet_compiler Failed to map the path '/' - iis-7.5

.NET 4.5.2, IIS 8.5 on Windows 8.1 x64. I have a single ASP.NET web site at /localhost/. The DEFAULT website is disabled, a new site with was created with the right bindings. I am trying to pre-compile it in place:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_compiler -c -v /
error ASPRUNTIME: Failed to map the path '/'.
I tried the metabase-path route:
aspnet_compiler -c -m lm/w3svc/2/root
error ASPRUNTIME: Failed to map the path '/'.
I Can get it to compile by specifying the physical path but I don't want to do that because this same application exists on different servers with different physical paths (devs, QA, production). Not even the metabase paths are all the same. "/" is the same everywhere.
For grins I added this to a page in the site to make sure i wasn't losing my mind:
Response.Write(Server.MapPath("/"));
and got what I expected.
What am I doing wrong?

This is a rights issue; apparently you need to be administrator to access the IIS metabase.
I see two possible solutions:
Use -p to specify the physical path; that way aspnet_compiler does not need to access the IIS metabase. (OP already explained this may not be a practical solution in a server cluster.)
Run aspnet_compiler from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.

Related

IIS Map Network Drive to Virtual Directory

I'm working on setting up a Drupal 8 Site on IIS. On Linux, we commonly have a network share that all Load Balanced Nodes can access, and then a symlink to connect the directory /sites/default/files to that share. I need the same for IIS.
Things that didn't work:
1) Virtual Directory in IIS: We authenticated with a user on the AD, and we were able to load all files (i.e. the images on the site appear). However for some reason, Drupal couldn't see it and also created a folder "files" in the same directory, through the front end and IMCE I can only write to that folder and not the Virtual Directory. If someone knows a resolution here that would be helpful.
2) Regular Shortcut: Same problem as above. Drupal doesn't see the shortcut since it's actually named files.lnk when created through the file browser. It creates another folder ./files and refers to that instead of the shortcut.
3) Hard Links: I tried running this command `cmd /c mklink /J D:\inetpub\wwwroot\\web\sites\default\files "\\Public Files\files" and it simply stated "Local Volumes are required to complete this operation"
4) Soft Links: Changing up the switch on the previous command to cmd /c mklink /d D:\inetpub\wwwroot\<site_dir>\web\sites\default\files "\\<share>\Public Files\files" works, but I'm only getting HTTP 401 errors in Chrome, even though I've allowed the Local Group IIS_IUSRS to have full control, plus opening it up to almost every user.

CF 11. 'ColdFusion is not defined' error using ColdFusion.Ajax.submitForm

Just re-installed everything on new laptop after old one crashed. Upgraded from CF9 to CF11 in the process. Running IIS on Windows 10. Local site is working fine, except when it comes to submitting a form with ajax.
ColdFusion.Ajax.submitForm('registerForm', '/register_action.cfm', callback,errorHandler);
I have <cfajaximport> at the top.
I have an IIS virtual CFIDE directory
pointing to C:\ColdFusion2016\cfusion\wwwroot\CFIDE
Mapping in CFAdmin is correct
There was not issue with CF9. But I notice CF11 has its scripts directory OUTSIDE the CFIDE directory on the same level (directory named "cf_scripts"), whereas CF9 has the scripts INSIDE the CFIDE directory.
Before I stuff things up, has anyone any pointers in the right direction?
SOLUTION
For the benefit of others, I did the following:
CFAdministrator Default ScriptSrc directory: /CF_SCRIPTS
IIS Virtual Directory: CF_SCRIPTS pointing to C:\ColdFusion2016\cfusion\wwwroot\cf_scripts\scripts\
Create a virtual directory in IIS that points to that scripts folder.
In the ColdFusion administrator, under the Server > Settings tab, make sure the Default ScriptSrc Directory name matches the IIS virtual directory name you created.

How to handle files in case-sensitive way in Vagrant on Windows host

On My Windows 8 I've installed VirtualBox + Vagrant. I used Laravel Homestead (with Ubuntu) as box. When running site on this VM or running command line I would expect it is being run on Linux and not on Windows. But I found some strange issue:
First my folder mappings:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
sites:
- map: learn.app
to: /home/vagrant/code/my-first-app/public
When I run in my browser http://learn.app:8000 I got correct output - page from /home/vagrant/code/my-first-app/public what is the same as code from D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony\my-first-app/public just to be clear.
Now the problem:
In my public folder I've created 2 simple files:
File with name test (it's empty) and file index.php with content:
<?php
if (file_exists('TEST')) {
echo "file exists";
}
else {
echo "file NOT exists";
}
So now I run http://learn.app:8000 in browser and I get output file exists. This is the result I wouldn't expect. As far as I know in Linux (my box is Ubuntu) you may have files with different case in names (in opposite to Windows) so I would expect I got file NOT exists.
I've tested it in my VM running php index.php and I get exact same result file exists what is again unexpected.
Now what I did I copied those 2 files to other directory on my VM /home/vagrant/TESTS - this directory is not mapped using Vagrant. Now when I run php index.php I get file NOT exists what is expected result.
To be honest I completely doesn't understand it. Question - does PHP when using Vagrant mapping operating on VM filesystem (in this case Ubuntu) or on Virtual BOX host filesystem (in my case Windows). Is there any way to make it work to get desired result? I know this question might be a bit software related but it's really connected to PHP and Laravel and maybe I miss something here.
I think this issue can be solved not using Samba or too much work.
In Windows cmd I run:
vagrant plugin install vagrant-winnfsd
It installed a plugin for NFS for Windows although at http://docs.vagrantup.com/v2/synced-folders/nfs.html you have clear info that NFS doesn't work for Windows:
Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.
I modified my Homestead.yaml file mapping from:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
to:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
type: "nfs"
(probably if not using Homestead.yaml you can add type: nfs, something like that: config.vm.synced_folder ".", "/vagrant", type: "nfs" in your Vagrantfile)
Now when I run
vagrant up
I got 2 or 3 notices for admin password (probably some Windows configuration of NFS - it will appear only when I run vagrant up first after adding NFS type) but now both for using url http://learn.app:8000 I got for the case from question file NOT exists and the same when I run php index.php in box commandline.
Note: this solution doesn't make you can create test and TEST files in the same directory and you will have them in your file system. It seems to handle file in case sensitive way, so if you create a file in wrong case in your app (and later in your code you want to load it/require) you will notice that it doesn't work on your Vagrant Linux box (and it would work on Windows WAMP and you would be suprised when moving on production).
With the default vagrant share that you use the mounted folder still provided by the underlying file system. It won't handle linux ACLs properly either.
One solution we found for this is instead of sharing the host's folder with the client, we set up samba on the guest and shared it back to the host. It's more cumbersome and you have to do more configuration but at least you app runs in an environment as it should be
Interesting. I use Windows 7 with Homestead - and I also assumed that the case sensitivity file issue would be handled by Vagrant. But I ran some similar tests - and you are correct - it is actually case insensitive.
I can confirm the issue is not to do with PHP at all - the issue actually occurs inside Vagrant on the command line itself:
touch EXAMPLE
rm example
That passes on the Vagrant box when I am SSH into it. But on a real Ubuntu box (I tested it on my server) - that command fails.
The reason is that Vagrant is calling to Windows to check if the file exists for the mapped folders. But if you make a virtual non-mapped folder inside of Vagrant - then the 'call' to see if the file exists remains inside of Vagrant and thus handled only by Ubuntu - and that is why your other test passed.
I tried turning on Case Sensitivity for Windows 7 as documented here - but it didnt solve the problem

Coldfusion 10, IIS 7.5 - Getting a 404 even though file exists

I'm getting a 404 even though the page exists on disk.
I've ran the Web Server Configuration Tool and rebooted several times.
Handler mapping for .cfm files (configuration tool seems to have worked):
C:\ColdFusion10\config\wsconfig\1\isapi_redirect.dll
Virtual Paths:
root/index.cfm <- works
root/dan.cfm <- doesn't work
Server:
Windows 2008 R2, IIS 7.5 and Coldfusion 10
Rest of my configuration:
Update 1
NTFS Security Information on /wsconfig/1 folder:
Answer - TLDR
Map a virtual directory named "jakarta" to CFUSION INSTALL\config\wsconfig{instance id}
No need to add APPPool permissions to folder...
Right click on the website and add a mapped virtual directory named "jakarta" to C:\Coldfusion10\config\wsconfig{instance id} (in my case, it was \1 )

How to start IIS Express Manually

Is there a command line program or service that I can use to start IIS Express manually?
iisexpress program is responsible for that.
http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
Once you have IIS Express installed (the easiest way is through Microsoft Web Platform Installer), you will find the executable file in %PROGRAMFILES%\IIS Express (%PROGRAMFILES(x86)%\IIS Express on x64 architectures) and its called iisexpress.exe.
To see all the possible command-line options, just run:
iisexpress /?
and the program detailed help will show up.
If executed without parameters, all the sites defined in the configuration file and marked to run at startup will be launched. An icon in the system tray will show which sites are running.
There are a couple of useful options once you have some sites created in the configuration file (found in %USERPROFILE%\Documents\IISExpress\config\applicationhost.config): the /site and /siteId.
With the first one, you can launch a specific site by name:
iisexpress /site:SiteName
And with the latter, you can launch by specifying the ID:
iisexpress /siteId:SiteId
With this, if IISExpress is launched from the command-line, a list of all the requests made to the server will be shown, which can be quite useful when debugging.
Finally, a site can be launched by specifying the full directory path. IIS Express will create a virtual configuration file and launch the site (remember to quote the path if it contains spaces):
iisexpress /path:FullSitePath
This covers the basic IISExpress usage from the command line.
From the links the others have posted, I'm not seeing an option. -- I just use powershell to kill it -- you can save this to a Stop-IisExpress.ps1 file:
get-process | where { $_.ProcessName -like "IISExpress" } | stop-process
There's no harm in it -- Visual Studio will just pop a new one up when it wants one.
Or you simply manage it like full IIS by using Jexus Manager for IIS Express, an open source project I work on
https://jexusmanager.com
Start a site and the process will be launched for you.
There is not a program but you can make a batch file and run a command like that :
powershell "start-process 'C:\Program Files (x86)\IIS Express\iisexpress.exe' -workingdirectory 'C:\Program Files (x86)\IIS Express\' -windowstyle Hidden"

Resources