Closed sunilshahi closed 6 years ago
Sorry but it looks like your issue is that the IIS-Manager UI did not refresh, rather than the application wasn't created by Cake.IIS which is out of scope for this project.
The issue is not about IIS UI not being refreshed. I don't see the application even when I refresh iis my self. I can run the appcmd like above and after refreshing I see the application. However running the task does not produce the same result. Shouldn't these two be equivalent?
@SharpeRAD , I have the same issue.
Task("Create-
.Description("Adds Test Application to Test Website")
.Does(() =>
{
AddSiteApplication(new ApplicationSettings()
{
SiteName = "Test",
ApplicationPool = "Test",
ApplicationPath = "/Test2",
VirtualDirectory = "/Test2",
PhysicalDirectory = @"C:\Temp"
});
});
End-result of running Cake:
While on the left-side context menu Application is not visible, if I click "View Applications" on Right-side menu after selecting "Test" Site, I see it on the list, but without Physical Path filled. After filling Physical path with i.e. C:\Temp
everything works as intended, and I can see this Application as a child of "Test" site. C:\Temp
is a proper, existing path in my system. I'm using IIS 10.0.17134.1.
I'll look into it, and if I find any fix I'll propose PR with fix.
Found a solution:
After changing from VirtualDirectory = "/Test2",
to VirtualDirectory = "/",
proper Physical Path in IIS has been saved.
I have created a Pull Request #55 - as this is the only place where VirtualDirectory is used for ApplicationSettings, I have removed this parameter from the code.
This is my task.
When I run
.\build.ps1 --target=create-application
I see no error.
When I look in IIS there is no application created there. Refresh did not help.
If I re-run I get error saying application already exists.
Running appcmd list reveals that its indeed there.
What am I missing? I can run appcmd and create the application.
appcmd add app /site.name:"Default Web Site" /path:/myapp /physicalPath:"C:\inetpub\myapp"
However "AddSiteApplication" alias is not working for me. Am I missing anything?