Can't delete anything in the Backoffice - umbraco5

I've been developing complex websites with Sitecore for the past 4 years, but Umbraco is completely new to me.
I've setup Umbraco 5 (multiple releases of it, including the very latest) on my machine. I've created a Document Type called Test. When I right-click it and choose Delete nothing happens. This is the case for anything that I try to delete in the Backoffice.
I then tried setting up Umbraco 4.7.2 and tried creating something in the Backoffice and deleting. That worked! It's only in Umbraco 5 that I can't delete anything.
Any suggestions will be greatly appreciated!

Can you save, move or rename your templates?
It sounds like a permissions problem.
Try both of these approaches:
Set correct permissions for IUSR on the root folder.
Make sure your application in ISS is running on the defaul appPool
Use the command prompt and navigate to the root folder and run the following code or paste the code to a .bat file in the root directory and run it.
icacls App_Data /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M icacls App_Plugins /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls Areas /grant "IIS AppPool\DefaultAppPool":(OI)(CI)R
icacls bin /grant "IIS AppPool\DefaultAppPool":(OI)(CI)R
icacls Content /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls Scripts /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls Views /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls web.config /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls web.config /grant "IIS AppPool\DefaultAppPool":M
icacls packages.config /grant "IIS AppPool\DefaultAppPool":(OI)(CI)M
icacls packages.config /grant "IIS AppPool\DefaultAppPool":M

Related

msdeploy contentPathLib provider replaces wwwroot by approot

I am trying to remotely deploy a vNext webapp to iis 7.5 using webdeploy 3.6 and msbuild with the contentPathLib provider as described here.
Here is the msbuild task I use (the source "wwwroot" and "approot" folders are stored in the $(PackageDir), other variables names are selfspeaking)
<Exec Command=""$(MSDeployExe)" -allowUntrusted -verbose -verb:sync -source:contentPathLib="$(PackageDir)wwwroot" -dest:contentPathLib=$(SiteName)/$(ApplicationName),computerName=$(ServerName)/msdeploy.axd?Site=$(SiteName),userName=$(WebDeployUserName),password=$(WebDeployPassword),authtype=basic -enableLink:contentLibExtension" />
The webapp configured in SiteName maps to an empty wwwroot folder.
After msbuild execution, the "wwwroot" folder of the application on the distant server has been renamed to "approot", instead of filling the "wwwroot" and creating a new "approot" folder.
The documentation is still quite poor on the subject (2016-01-14). Has anyone been able to perform a successful webdeploy of a vNext webapp?
I just solved this, I think. The trick seems to be to not define source and dest as contentPathLib, but as iisApp, then enable contentLinkExtension. I'm guessing most of the examples floating around out there involve deploying to IIS on the same server. So your task would be like so:
<Exec Command=""$(MSDeployExe)" -allowUntrusted -verbose -verb:sync -source:iisApp="$(PackageDir)wwwroot" -dest:iisApp=$(SiteName)/$(ApplicationName),computerName=$(ServerName)/msdeploy.axd?Site=$(SiteName),userName=$(WebDeployUserName),password=$(WebDeployPassword),authtype=basic -enableLink:contentLibExtension" />
Full disclosure - I tried this on a Site, not an application within a site.

Skip and include files during deploy

I'm using this MSBuild command to deploy my web app.
/P:Configuration=Staging
/P:DeployOnBuild=True
/P:DeployTarget=MSDeployPublish
/P:MsDeployServiceUrl=192.168.1.5:8172/MsDeploy.axd
/P:AllowUntrustedCertificate=True
/P:DeployIisAppPath="Default Web Site/test"
/P:username=Administrator
/P:password=*****
/P:MSDeployPublishMethod=WMSVC
I need to somehow change this configuration to do this:
Exclude some folders from deploy
Deploy a folder which is not part of the project. This folder is created on the build server right before the deploy. It does not exist in the source control.
BTW I'm using Teamcity
You should create a publish profile (via the Publish dialog) that contains all the publish properties, except password, and then execute it via:
/P:Configuration=Staging
/P:DeployOnBuild=True
/P:PublishProfile=Test
/P:Password=*****
Exclude some folders from deploy
Add this to your newly created pubxml as a direct child of the root element:
<ItemGroup>
<MsDeploySkipRules Include="Uploads Folder">
<ObjectName>dirPath</ObjectName>
<AbsolutePath>Uploads$</AbsolutePath> <!-- Regex -->
</MsDeploySkipRules>
</ItemGroup>
Deploy a folder which is not part of the project. This folder is created on the build server right before the deploy. It does not exist in the source control
See this answer

MsBuild and MsDeploy problems

When I publish web project by gui(VS2010) (right click in project and choose Publish menu item, publish Method - Web Deploy) - everything works fine.
Problems appear when I am trying to publish via command line: MSBUILD or MsDeploy.
With MSBuild a package is created with no publishing (only creating package):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSbuild.exe" Project.sln /p:DeployOnBuild=true /p:DeployTraget=MSDeployPublish /p:MSDeployPublishMethod=WMSVC /p:MSDeployServiceUrl=https://[ip]/msdeploy.axd /p:AllowUntrustedCertificate=true /p:DeployIisAppPath=NlbTestSite /p:UserName=M\DeployUser /p:Password=qwerty
With MsDeploy i get an error: ERROR_USER_UNAUTHORIZED
E:\Work\OutDir\MSDeploy\Package.deploy.cmd" /Y /M:"https://[ip]:8172/msdeploy.axd" /U:"M\DeployUser" /P:"qwerty" -allowUntrusted /A:Basic
My goal is to automate the deployment process using one of those methods.
I want to find out how Visual Studio publishes my project (what command with what arguments)?
UPDATE 19.10.2012 14:52
When I add /p:UseMsDeployExe=true, msdeploy.exe is executed, but nothing is copied.
The execution command:
C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe -source:manifest='E:\[Path]\obj\Debug\Package\[Project].SourceManifest.xml' -dest:package='E:\[Path]\[Project]\obj\Debug\Package\[Project].zip',IncludeAcls='False' -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -declareParam:name='IIS Web Application Name',kind='ProviderPath',scope='IisApp',match='^E:\\[Path]\\obj\\Debug\\Package\\PackageTmp$',defaultvalue='[SiteName]',tags='IisApp' -declareParam:name='IIS Web Application Name',kind='ProviderPath',scope='setAcl',match='^E:\\[Path]\\obj\\Debug\\Package\\PackageTmp$' -declareParam:name='Add write permission to App_Data Folder',kind='ProviderPath',scope='setAcl',match='^E:\\[Path]\\obj\\Debug\\Package\\PackageTmp\\App_Data$',description='Add write permission to App_Data folder',defaultvalue='{IIS Web Application Name}/App_Data',tags='Hidden' -declareParam:name='MainModelContainer-Web.config Connection String',kind='XmlFile',scope='E:\\[Path]\\OutDir\\temp\\Web\.config$',match="/configuration/connectionStrings/add[#name='MainModelContainer']/#connectionString",description='MainModelContainer Connection String used in web.config by the application to access the database.',defaultvalue='metadata=[ConnectionString]"',tags='SqlConnectionString' -declareParam:name='SimpleConnection-Web.config Connection String',kind='XmlFile',scope='E:\\[Path]\\OutDir\\temp\\Web\.config$',match="/configuration/connectionStrings/add[#name='SimpleConnection']/#connectionString",description='SimpleConnection Connection String used in web.config by the application to access the database.',defaultvalue='[ConnectionString]',tags='SqlConnectionString' -declareParam:name='ElmahDB-Web.config Connection String',kind='XmlFile',scope='E:\\[Path]\\OutDir\\temp\\Web\.config$',match="/configuration/connectionStrings/add[#name='ElmahDB']/#connectionString",description='ElmahDB Connection String used in web.config by the application to access the database.',defaultvalue='[ConnectionString]',tags='SqlConnectionString' -retryAttempts=2
No parameters, such as ComputerName, User or password are passed.
Any ideas about the cause?
Problem solved.
Got some ideas from http://root-project.org/work/net/automated-web-deployment-with-msbuild-and-msdeploy
I separated msbuild and msdeploy, and executed msdeploy explicitly.
Here is the template:
msdeploy.exe
-source:package=’C:\SomeWebProject\obj\Release\Package\SomeWebProject.zip‘
-dest:auto,ComputerName=’https://TargetServer:8172/MsDeploy.axd?site=TargetWebSite‘,UserName=’Username‘,Password=’Password‘,IncludeAcls=’False’,AuthType=’Basic’
-verb:sync
-disableLink:AppPoolExtension
-disableLink:ContentExtension
-disableLink:CertificateExtension
-allowUntrusted
-retryAttempts=2
-setParam:’IIS Web Application Name’=’TargetWebSite/TargetWebApp‘
But problem with msbuild still remains.
In your pubxml file, declare the following:
<PropertyGroup>
<UseMsDeployExe>true</UseMsDeployExe>
</PropertyGroup>
Now when you deploy, you should see the call to msdeploy.exe in the publih log.
Make note, though, that it will actually be calling msdeploy.exe directly, and not via the generated deploy.cmd file.

MsBuild Deploy with PackageLocation drop file permissions

I have an MsBuild Build in TFS that is publishing a web zip package.
This is the command line I am using:
/t:Build;Package
/p:DeployOnBuild=true;Configuration=Release;
DeployTarget=Package;PackageLocation=\\xxx\MyApp.zip
It is working properly and it is also replacing in the web.config the parameters as expected.
The only issue I am facing is the permissions applied to the package file.
Right now the file is deployed into:
* \myshare\myapp\ *
And the folder is set with the permission:
Everyone: full control
The package inside the folder has the permission:
TFSAdmin: full control
and nothing else, so I can't open it or copy it ... Is there any way I can avoid that?
So far it seems that the problem can't be fix if not with a workaround.
I have found an easy and simple workaround by executing in the workflow a batch file at the end of the build process.
In the batch file I use the very old ICACLS to re-set the permissions:
ICACLS \\xxx\MyPackage.zip /GRANT Everyone:F
ICACLS \\xxx\MyPackage.zip /GRANT Users:F
Add in MSBuild .proj file:
<Exec Command="icacls "\\xxx\MyApp.zip" /grant User:F" ContinueOnError="true" />
a sequence of simple rights:
F - full access
M - modify access
RX - read and execute access
R - read-only access
W - write-only access
In case you want to make a folder accessible by your website you can place the following snippet in your "PostBuild" events at the very bottom of your .csproj (you need to edit the .csproj file manually via a text editor):
<Target Name="AfterBuild">
<!-- grant everyone the modify right recursively even for files and folders created dynamically in the future -->
<!-- note the use of (OI) and (CI) flags which stand for object inherit & container inherit these flags -->
<!-- indicate that subordinate containers will inherit the same access control element or ace this means that -->
<!-- files and folders created in the future within the targeted folder will get the same permissions -->
<Exec Command=" icacls ".\Logs" /grant Users:(CI)(OI)M /T " ContinueOnError="true" />σ
<Exec Command=" icacls ".\Logs" /grant IIS_IUSRS:(CI)(OI)M /T " ContinueOnError="true" />
</Target>
Sidenote: If you use publish/deploy-on-remote-server functionality of visual studio to deploy your website, then it goes without saying that the folder permissions will probably NOT be preserved and that you will have to use some sort of post-installation script to re-apply them (probably using the 'icacls' approach again show here). This sort of post-installation script should probably be part of WebDeploy - haven't used WebDeploy myself though so your mileage may vary on this particular aspect.

MSBuild 4 and MSDeploy command line

I'm trying to automate deployment of a site. I started with this article
and everything works great from VS 2010. However, I'm having problems with the command line
I use this
c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe "d:\Projects\test.csproj" /T:Package /P:PackageLocation="d:\Package\packageTest.zip"
to create the package
and
d:\Projects\packageTest.deploy.cmd "-setParam:name='IIS Web Application Name',value=MSBuild/Test2" /y
to get to at least deploy correctly.
However, it doesn't take any of the IIS options (the app pool is MSBuild instead of ASP.NET v2.0) and, as I said before, the IIS Web Application Name is wrong.
Shouldn't this information be taken from .csproj file?
All these settings are done for debug configuration and platform any cpu
You typically setup your application on the IIS first, with correct path, application pool and so forth. When setup you can use MSBuild to deploy into that application name like this:
msbuild <your_web_project_name>.csproj /p:Configuration=Release /p:OutputPath=bin /p:DeployOnBuild=True /p:DeployTarget=MSDeployPublish /p:MsDeployServiceUrl=https://<url_to_your_server>:8080/msdeploy.axd /p:username=<username> /p:password=<password> /p:AllowUntrustedCertificate=True /p:DeployIisAppPath=<your_site_name> /p:MSDeployPublishMethod=WMSVC /p:VisualStudioVersion=11.0
If you don't want to setup the site manually, you could run a power shell looking something like this:
Import-Module WebAdministration
New-Item iis:\Sites\<your_site_name> -bindings #{protocol="http";bindingInformation=":80:<your_site_name>} -physicalPath c:\inetpub\wwwroot\<your_site_name>
Set-ItemProperty 'IIS:\Sites\<your_site_name>' ApplicationPool "ASP.NET v4.0"