I have a .NET Core 3.1 console app I have deployed to server and setup as a windows service. I can open cmd window as admin and navigate to the exe and it runs the exe with no errors or issues.
However when I try to start the Windows Service it immediately fails with an error:
Windows could not start the service on the local computer. Error 1053: The Service did not respond to the start or control request in a timely fashion.
We have ServicesPipeTimeout set to 180000
and rebooted server but it still fails immediately. Shouldn't it take time before the timeout error comes up?
I have also ensured we have the Release version of the code as I found posting saying Debug versions of code will cause this issue.
The folder permissions are as follows:
Since the console app runs fine from the command prompt there should not be an issue with the code/framework on the system?
Is there anything else to check?
I have set up a Continuous Integration build with TeamCity and MSBuild. I am using the MSBuild Extension Pack, primarily for its IIS7AppPool Task. My goal is to stop an IIS app pool before the build script does a deployment step and start the app pool afterwards. The IIS app pool is on a different server from the build agent.
I have used the following MS Build code to stop IIS:
<MSBuild.ExtensionPack.Web.Iis7AppPool TaskAction="Stop" MachineName="$(DeploymentServerName)" Name="$(WebAppPoolName)" Username="$(DeploymentServerUsername)" UserPassword="$(DeploymentServerUserPassword)" />
I have set up a local admin user account on the web server, and used its username and password above as $(DeploymentServerUsername) and $(DeploymentServerPassword).
The error I am receiving is:
[MSBuild.ExtensionPack.Web.Iis7AppPool]
E:\TeamCity\BuildAgent\work\1a1dc058c29f0f12\BuildAndDeployment\Build_DevCI.proj(153,
5): UnauthorizedAccessException: Retrieving the COM class factory for
remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344}
from machine DEPLOYMENTSERVERMACHINENAME failed due to the following
error: 80070005 DEPLOYMENTSERVERMACHINENAME.
I have asked our network guys to take down any firewalls between the two machines, but I still get the same error.
Can anyone see anything wrong with my syntax or offer any advice on how to get this to work?
I can get the task to stop an IIS app pool on my local machine ok, so my syntax should be right.
I have looked at this post, but I don't think it's the same problem:
MSBuild remoting to server throws COMException error
I have created a web deployment package for a web application from VS 2010. I am trying to deploy it using msdeploy on a Win Serevr 2003 IIS 6 machine. The remote agent service is running. When I run the command (cmd file), I get the following warning:
Warning: Access to the path 'MsDepSvc.exe' is denied. Retrying operation 'Delete' on object dirPath (\\localhost\C$\WINDOWS\TEMP\MSDEPLOY\5e16dc0d-6bfc-4398-b773-bfd8c504c0bc). Attempt 1 of 5.
I am an administrator on the machine. IUSR, NETWORKSERVICE and ASPNET have full control over the folder - C:\WINDOWS\TEMP\MSDEPLOY. I am an administrator on the machine. How can I overcome this warning? The deployment is failing because of this.
Try using the msdeploy command line tool as follows
msdeploy -verb:sync source:package="***.zip location" dest:iisApp="iis 6 website"
iisApp provider can be used with both IIS 6 and 7. If your deployment works using the above command through command line, it may help you to pin point the issue.
I have built an ASP.NET web application with Visual Studio 2008 and target framework version 2.0. I have created a Web Setup project to deploy this at multiple target OSes.
For the setup project, I have written a custom action which gets executed on "OnCommitting" event. This custom action adds wildcard script mapping for routing all requests through ASP.NET engine.
FileMon suggests that an error occurs while creating a file in the following directory:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
The user account which was attempting this action was IWAM_<host name>.
The problem is after running this setup, if I try to access any url on the newly installed site, I received the error message:
Server Error in '/myapp' Application.
Failed to access IIS metabase.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.
The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
I have already tried these options after 2 days of googling:
Run aspnet_regiis -i
Run aspnet_regiis -ga \ASPNET
Run aspnet_regiis -u and then aspnet_regiis -i
Option 3 has worked for me as of now, but, I want avoid using this, since, my web app will be deployed on a machine which might already be hosting some other app on IIS and I do not want to disturb these apps.
Can anyone suggest me a workaround for this?
B.T.W. my current system has .Net framework 3.5 and VS2008 installed on Win XP SP3 and IIS 5.1.
Thanks,
Vamyip
Your best bet is a custom bit of script in the installer package that checks permissions and then runs the command based on that information.
On a server OS this shouldn't be necessary since the default user for the application group will be in the IIS_WPG and have permissions to the temp directories. Windows XP has a bugged up version of IIS that is non-standard and doesn't follow all the rules. If your expected deployment environment is Windows Server 2003 or better then your installer should work as-is.
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.