Configuring MSDeploy 3.5 WS2008 R2 - msdeploy

I try to configure msdeploy configuration between two WS2008 R2 servers.
I don't have any domain controller
I Installed MSDeploy 3.5 using Web PI on both servers.
I created a user on both servers, and added them to the "Administrators" group
I use this user for syncrhonization :
SET USERNAME=WebDeploy
SET PASSWORD=blah
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy" -verb:sync -source:webServer -dest:auto,computername=x.x.x;X,username=%USERNAME%,password=%PASSWORD% -skip:objectName=contentPath,absolutePath="\\temp"
I get ERROR_USER_NOT_ADMIN error.
I went to http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_NOT_ADMIN
I created the group, added my user to it, stil the samme error.
I saw that MSDeploy created users WDeployAdmin and WDeployConfigWriter, I also tried with those.
I launch my synchronization script with elevated privileges.
Any clue ?
Thanks !

I solved it by adding the following registry key : https://serverfault.com/questions/38999/cant-connect-to-default-admin-share-on-windows-2008
It solved my administrative share problem as well as my WSDeploy problem.

Related

You do not have permission to access the IIS configuration file - Web app error

I am trying to load existing c# web applications and getting below errors while loading any web project:
Creation of the virtual directory http://localhost:/ failed with the
error: You do not have permission to access the IIS configuration
file. Opening and creating web sites on IIS requires running Visual
Studio under an Administrator account.. You will need to manually
create this virtual directory in IIS before you can open this
project.
The following error occurred when trying to configure IIS Express for
project xxx.WebApi. You do not have permission to access the IIS
configuration file. Opening and creating web sites on IIS requires
running Visual Studio under an Administrator account.
I tried following, but in vain:
Running VS 2017 pro as an administrator.
I ensured that I have access to %systemroot%\System32\inetsrv\ and C:\Windows\System32\inetsrv\Config folders.
I have installed all IIS compatibility windows features through control panel.
Restarted IIS manager.
Created virtual directories.
Changed registry path of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal from u:\ to C:\Users\MyUser\Documents.
Uninstalled IIS Express 10.0 from control panel and reinstalled it through VS2017 installer by clicking – Individual components – cloud, database server – IIS Express.
Repaired VS 2017.
Got admin access on machine.
Created new empty web project but getting same error while new console app runs without errors.
Restarted machine after every installation related change.
All the solutions tried are mentioned on stackoverflow but are not working for me. Is there something trivial that I am missing? Please guide me to crack these IIS errors.
I was able to solve this issue doing the following:
1- Go to C:\Windows\System32\inetsrv and double click on directory config and accept the warning message.
2- Go to C:\Windows\System32\inetsrv\config directory and double click on directory Export and accept the warning message.
Then you will be able to run the app in your local IIS without being an administrator. You can follow the path in the given Image.
This solved the problem for me with Visual Studio 2017, .Net Core 2.2 and IIS Express 10.
You need to ensure devenv.exe has sufficient permissions. You can find it at:
C:\Program Files OR Program Files (x86)\Microsoft Visual Studio nn.n\Common7\IDE
Right click on the exe, select Properties, Security. I gave Administrators full control as I'm running VS under admin.
My Simple solution was to right click on Visual Studio and click Run as Administrator. But a solution above tells you how to have Visual Studio always run without having to run as an administrator.
All these solutions could not work for me. The issue was, I have accidently uninstall IIS from control panel even it was install and showing me. but was removed from control panel. I reinstall IIS latest version and able to fixed the problem. This might help for others.
This link help me
VS2017 RC - The following error occurred when trying to configure IIS Express
The issue for me was caused when I modified my project to override application root URL. After a push/merge and new branch my project would not load any longer. reverted the changes and all is well again.
Open an elevated command prompt and enter the following command to substitute a drive path for U drive.
c:\windows:\system32> Subst u: C:\Users\MyUser\Documents
I had replaced ‘U:’ path in registry with ‘C:\Users\MyUser\Documents’ previously. I think that was not sufficient. Some references of u:\ might have been hindering IIS.
The total substitute command must have replaced all references and the IIS config error got resolved. Hopefully, now I’ll be able to load my web apps.
I had the same issue, but instead of the workarounds (such as first double-clicking certain directories each time or running the security risk of always having to always run my VS as administrator), was able to permanently resolve the issue by deleting the "ProjectName.csproj.user" file and that fixed it. I guess there was some incompatible setting in the user file that VS couldn't deal with.
For older versions, change the option from IIS to your solution name, before clicking on the green play like run button, to build and run the application.
We resolved this by removing the project and adding it back.
If you're used to run your Visual Studio via shortcut with 'Run as administrator' checkbox marked, double check it is indeed still selected. For some reason mine had unchecked itself resulting in inability to load an IIS project. I was 100% sure my VS had these administrative privileges as usual, which made me try all the Internet proposed solutions except for the most obvious one.
Restarting Visual Studio worked for me.

Permissions needed to WebDeploy from TFS

I am using TFS to Build and Deploy using MSBuild Arguments. I have the following arguments
/P:AllowUntrustedCertificate=True
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:CreatePackageOnPublish=True
/p:MSDeployPublishMethod=WMSVC
/p:MSDeployServiceUrl=https://myserver.com
/p:DeployIisAppPath="Site1"
/p:UserName=domain\username
/p:Password=password
This works fine when I use my domain account (which is an Admin on the Destination Server), but I want to use a Service Account that has the barebones permissions to get this to work.
I have already setup IIS Manager Permissions for the site, gave Full Control to the folder that the application sits in, and created setAcl, createApp, and contentPath and iisApp Delegation rules for the user.
I have granted read rights to the inetsrv/config folder, and full control to the applicationHost.config file.
I am able to publish my site using the Visual Studio publish process with that user, but am unable to get the deployment to occur using a TFS Build. When I run the build, I get the following error.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets (4193): Web deployment task failed. (Connected to the remote computer ("myservercom") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED.)
I have looked online and followed all the steps I have seen, but still have the issue. Please let me know if you have any questions.
Thank you in advance
Try changing your MsDeployServiceUrl to:
https://myserver.com:8172/msdeploy.axd
Failing that, take a look at the Microsoft Web Deploy event log (in Applications and Services Logs)

Unable to access the IIS metabase

An ASP.NET web project loads with up the solution, but I get this error
The Web Application Project is configured to use IIS. Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
How can this be solved?
This may have nothing to do with registering ASP/IIS. The reason is exactly what the error message says: Visual Studio devenv.exe is not running with sufficient privileges to access the IIS process, and it needs to do this if your solution contains a web project whose Web settings say to use IIS rather than the VS dev server.
There are two solutions to your problem:
Run VS as an Administrator and reopen the solution/project.
Edit the web application's project file with a text editor and change this line
from True to False:
<UseIIS>True</UseIIS>
That will stop it using IIS and demanding higher privileges.
The reason VS demands Admin privileges is, I believe, because it will try and create the IIS web site for you on demand if it doesn't exist.
An answer that worked for me can be found here:
https://stackoverflow.com/a/17460774/3005965
Basically, go to %systemroot%/inetsrv/config. When prompt appears saying you need admin privileges, click Continue.
This should clear up your issue.
Just try to access Visual studio as Admin right click and choose run as administrator.
may fixes this problem.
and take a look at this link for instructions on creating a shortcut.
I ran into this problem when I had copied a project to a new project. I opened the project file (.csproj) and removed the value from the IISUrl element:
from: <IISUrl>http://localhost:21222</IISUrl>
to: <IISUrl></IISUrl>
Have you registered the .NET framework with IIS? You need to run the aspnet_regiis.exe utility found at %WindowsDir%\Microsoft.NET\Framework\vx.y.zzzz\. Run it as administrator as follows:
aspnet_regiis.exe -i
-i : Installs the version of ASP.NET that is associated with Aspnet_regiis.exe and updates the script maps at the IIS metabase root and below. Only the script maps for applications that use an earlier version of ASP.NET are updated. Applications that use a later version are not affected.
Find out more about the utitlity here.
This error also occurs if you modified your Machine.config and added some "invalid lines":
For example, I added some appSettings, to the configuration section (which IIS didn't like).
Just register your Web-project in your local IIS. All the settings you will find in *.csproj file. That works for me.
first uncheck internet information service from turn windows features on or off.
then uninstall iis from your system and restart it. after restarting it install iis again from https://www.microsoft.com/en-us/download/confirmation.aspx?id=34679 and try to open again.
Step 1: Close Visual Studio
Step 2: Go to Project Folder and find ".vs" folder Note: It may be hidden
Step 3: Delete ".vs" folder
Step 4: Open Project Again

IIS 6.0 and ASP.NET - Could not write to output file ... The directory name is invalid

I'm running IIS 6.0 on Windows 2003 and started getting this error:
Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\7382c13f\ea9b3ff7\App_global.asax.zodyof_q.dll' -- 'The directory name is invalid. '
I've checked all the permissions, and everything is as it needs to be - plus, the error message doesn't mention permissions. I've tried the following already:
Following the instructions from this [outdated] KB article: http://support.microsoft.com/kb/825791/en-us
Repairing the .NET Framework v3.5 installation, then rebooting
Deleting the contents of c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root, then running iisreset
Resetting the permissions on c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root, then running iisreset
Resetting the permissions on c:\WINDOWS\TEMP, then running iisreset.
Any suggestions?
Other notes/responses:
The Indexing service is disabled.
I've found an answer that is applicable if you've installed ANTS profiler and it crashed while profiling. This KB Article describes one of the solutions:
http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Profiler&c=knowledgebase\ANTS_Profiler\KB200903000362.htm
Create a temporary folder under %SystemRoot%, and then name it Temp.
Grant full permissions on the Temp folder to the aspnet user account in .NET Framework 1.0 or to the NETWORK SERVICE user account in .NET Framework 1.1.
Right-click My Computer, and then click Properties.
On the Advanced tab, click Environment Variables.
Select the TEMP variable under System variables, and then click Edit.
Type %SystemRoot%\TEMP in the Variable Value box, and then click OK.
Repeat steps 5 and 6 to edit the TMP variable. Click OK two times.
Click Start, and then click Run.
To reset Internet Information Services (IIS), type iisreset on the command prompt.
Use SysInternals FileMon (or ProcMon if you like) to see the real file it is bitching about. You can restrict it to just monitoring IIS if you have a busy server, although I'd start with all processes and just capture a couple of seconds of output.
Before running, ensure IIS has been reset using iisreset /restart so that the error is not cached from before.
Ryan
To every body who still has the problem!
Mine is solved by the followings
http://support.microsoft.com/kb/825791
I had the same error running IIS 7.0 / Vista Ultimate / .NET 2.0 Web App. I tried setting "Full Control" permissions on temporary folder for NETWORK SERVICE user (right-click on folder c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727, Properties, Security tab) and turning off antivirus and UAC, but it didn't help.
But this worked as magic: Open IIS Manager -> Select "View Application Pools" from right menu -> Select "Advanced Settings" -> Set your username (and password) in "Identity" property -> Restart IIS
If this doesn't work, check additionally that you're an owner of c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727 folder (right-click, Properties, Security tab, Advanced, Owner tab)
OK, when you repaired the installation do you mean ASPNET_REGIIS -u / ASPNET_REGIIS -i ? that would fix disk permissions.
It might be your virusscanner; exclude your .net temporary folders / inetpub if you can and if its safe.
Have to tried disabling windows Indexing Service for the temporary asp.net files folder
I received the same error. The anti-virus/security software (McAffee Viruscan Enterprise) was preventing visual studio tool csc.exe to dynamically compile code and create the entity data model dll in the directory folder above which falls under the windows directory folder. There is a section in McAffee called access protection that has a rule called Maximum Protection that prohibits creating executable files in the windows directory folder. Simply temporary disable the rule or access protection to compile the website successfully.
Here is the final solution :)
First give all the permission to ASPNET account , NETWORK SERVICE account to "ASP.NET Temporary files" folder under whichever the framework it is using.
like C:\windows\microsoft.net\framework\v2.xxx\ASP.NET Temporary files.
Check the temporary folder configured for your machine under environment variables for TEMP and TEMP.
For that folder also give all the permission to ASPNET account , NETWORK SERVICE accout. Reset the IIS
It should be working fine.
From windows server 2003 x64 , IIS6 , net 4.0 , asp application I was presented with the error:
Compiler Error Message: CS0016: Could not write to output file 'c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\7382c13f\ea9b3ff7\App_global.asax.zodyof_q.dll' -- 'The directory name is invalid. '
It was resolved when I created the DIR
d:\temp
No idea why D:\temp was important but I will update this answer with a reason as soon as I know.
Permissions on the DIR were:
admin full
creator owner special
system full
users read&execute / list / read
No IIS specific user permission was defined.
Working to migrate to IIS7 host but thought this answer maybe helpful for someone.

Access denied when creating a virtual directory via Web Deployment Project

I’m trying to use a (VS 2008) Web Deployment project in a TFS solution to deploy the web site to the (TFS 2008) build server to run web based unit tests.
For some reason, that I can't yet figure out, it is failing to create the virtual directory:
Using "CreateVirtualDirectory" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
Task "CreateVirtualDirectory"
Initializing IIS Web Server...
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5): error : Access is denied.
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(667,5): error :
Failed to create virtual directory 'abc'.
Done executing task "CreateVirtualDirectory" -- FAILED.
The TFSService user certainly is in the Administrators group on the TFS Build machine (which is running Windows Server 2008). I don’t know what else could be wrong. I’ve checked the event log an there’s no clues there. I am able to manually create the virtual directory on that machine through the IIS console with no problem.
Any ideas what could be the problem or suggestions for how to diagnose this further?
it has got to be permissions...did you try putting the TFSService in the same Groups you are in?
Is the TFS account running under the same privileges as the account that you use to connect to IIS? Do as Craig suggested and move the TFS account into the groups that you participate in.
You're sure that the build is running under the TFSService id and not under another id set up just for builds, and which may not be in the administrator's group? I haven't done more than just play with automated builds since I do mostly solo development, but I recall setting up a separate build id when I was looking at this.
I have seen this occur when the IIS server wasn't running on the default port. I'd recommend checking IIS to see if it's running on port 80 as a step to diagnose your issue further.
I eventually managed to get deployment working by calling the _CopyWebApplication build target of the web application from my TFS build script (after manually creating the IIS virtual directory).
I had to add an additional target though to get linked files in the project to be copied also as the built in _CopyWebApplication target doesn't include those.

Resources