IISExpress crash upon debug start - c#

When i try to start my ASP.NET application from VS (2015 or 2017) it just crash with no error in output window.
The program '[8464] iisexpress.exe' has exited with code 0 (0x0).
But Windows Event log says this:
The Module name ManagedEngineV4.0_32bit path C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\webengine4.dll returned an error from registration. The data is the error.
I have no more ideas about how to fix this.
I've tried to reinstall VS, IIS, even tried to remove .net framework, change IIS settings from 32 to 64bit but no luck so far.
Any chance someone experienced similar error and found the solution? :)
P.S.
Extended error log:
System
Provider
[ Name] IIS Express
EventID 2293
[ Qualifiers] 49152
Level 2
Task 0
Keywords 0x80000000000000
TimeCreated
[ SystemTime] 2017-06-06T20:47:56.693031400Z
EventRecordID 7271
Channel Application
Computer PC
Security
EventData
ManagedEngineV4.0_32bit
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\webengine4.dll
2BEE0CC0
Binary data:
In Words
0000: C00CEE2B
In Bytes
0000: 2B EE 0C C0 +î.À

I know this is an old thread, but this has been killing me today. And since this is pretty much teh top thread on any search for the error, i decided to add this.
taken from here
"Unable to launch the IIS Express Web server" error
Delete folder IISExpress from "My Documents"
Load your project again, it will create IISExpress folder again with updated configuration
Check IISExpress folder has sufficient permissions to read-write the configuration file
Load project again and Run IISExpress. It should work.
I didn't need to check any permissions or anything, just deleting and reloading the project was enough for IIS to behave itself and i could get back to some debugging fun.
Cheers

After couple of days spent trying to solve the problem, i didn't succeed, so here is quick workaround:
Uninstall of IISExpress v10
Install IISExpress v8
And everything works just fine

We encountered this same problem and event viewer error using IIS. For us the problem was we were modifying C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Aspnet.config to apply some garbage collection improvements, and ended up with a typo in the XML.
So not related to IIS Express, but thought I'd mention it for others who find this post when searching for the error message:
The Module name ManagedEngineV4.0_64bit path
C:\windows\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll
returned an error from registration. The data is the error.

Related

Unable to start program, Access is denied C# net6.0

I have this issue where some of the projects I created for.Net6 throws the error shown in the image attached
In this instance the project was running fine, suddenly, the error started to pop up. I have tried to find a solution by myself and on the internet.
I have used different IDEs VS 2022, ReSharper, VS Code, and the error persists.
This started when I installed VS 2022 and .Net6 SDK. Was formally using VS 2019.
Any help?
So, what I have done so far was to do a system reset. Everything was working well until a couple of hours now. I tried to use CMD as admin to run. I would like to point out that I have a couple of projects on the solution, but one keeps throwing this error.
System.ComponentModel.Win32Exception (5): An error occurred trying to start process 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin\bin\Debug\net6.0\Skoruba.Duende.IdentityServer.Admin.exe' with working directory 'C:\Users\xxxxxxxxxxxxx\source\repos\ProjectTemplate2022v3\src\Skoruba.Duende.IdentityServer.Admin'. Access is denied.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Microsoft.DotNet.Cli.Utils.Command.Execute(Action`1 processStarted)
at Microsoft.DotNet.Cli.Utils.Command.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Execute()
at Microsoft.DotNet.Tools.Run.RunCommand.Run(String[] args)
at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, TimeSpan startupTime, ITelemetry telemetryClient)
at Microsoft.DotNet.Cli.Program.Main(String[] args)
I had the same problem and later figured out that Windows Security (Defender) was blocking the executable.
Go to Windows Security -> Virus and Threat protection settings -> Exclusions and add your exe to the exclusion list.
I just had the same problem. Quick fix for me to get it to run is to run using "IISExpress".. See below picture.

Access Denied when running Windows Service

I have created a Windows Service using ASP.Net Core 3.x and C#. I started with the new Windows Service template when I built the project. When I run it from my development environment or from a console window it runs fine. When I install it as a Windows Service and attempt to start the service I get an
"Error 5: Access is denied." error.
I tried numerous things which I will outline below to eliminate the error but nothing seemed to work so I downloaded the sample app provided by Microsoft, at sample
Same result...when I run the sample app from within Visual Studio it runs fine, when running as a service I get the Access Denied error.
I am running all of this on my local machine, which I am an admin on.
I originally tried to run it using the default Local System account; got the Access Denied error.
I changed the Log On As to my domain account, the same one I use to log into my local machine which is an admin on this machine; got the same Access Denied error.
My account has the privilege set to run as a service.
The Event Viewer just shows the one message which says "Access Denied", no other messages are created.
I believe the Access Denied error is occurring before the C# code is even executed. What makes me believe this is that I added one line to the very top of the Program.Main.... File.WriteAllText("C:\\temp\\ws.log", $"Test of Worker Service # {DateTime.Now}. Content Root Path: {AppContext.BaseDirectory}");. My account has full access to the temp folder. This file gets created when I run the app from Visual Studio but it does not get created when I run the app as a service.
I have read numerous web sites, include this one and this one. No luck, everything I tried from these sites still produce the Access Denied error.
I have run out of ideas and am hoping someone here can provide me the answer. Thanks!
I found the solution and believe me I feel really stupid!!!
When I installed it as a service I only put the path in "binPath".
sc create WindowsService1 binPath="C:\temp".
Once I actually added the executable to the binPath parameter everything worked.
Changed it to sc create WindowsService1 binPath="C:\temp\WindowsService.exe" and it worked.
I know it is an Id10t error but Microsoft should really provide better messaging for the "sc" command. A message like "Cannot find file specified in the binPath parameter" would have been really helpful. Would have saved me about 6 hours of work.
Thanks everyone for reviewing and replying to this question.

WCF calls 3rd party DLL only works in VS2015 but not without

I am using 64bit Windows7 home premium SP1 and VS2015.
I wrote a WCF application which calls a 3rd party dll (from vendor) written in C#. When i "view in browser" by right clicking ProductREADService.svc in VS2015 solution explorer, I can call the svc(localhost:17476/ProductRESTService.svc) and method(this calls the 3rd party dll localhost:17476/ProductRESTService.svc/getproductlist/1) and the WCF works without any problem on the browser (chrome and IE), returning xml result correctly.
Now I want this WCF to running without VS2015 since I need it to run in production env.
Problem:
1)
However, when I publish this WCF to IIS7.5, I was able to call the svc (localhost:8123/ProductRESTService.svc) without problem, but when I called the method (localhost:8123/ProductRESTService.svc/getproductlist/1) I encountered request error "The server encountered an error processing the request. See server logs for more details."
When I checked the logs I found this:
2016-09-07 12:46:44 ::1 GET /favicon.ico - 8123 - ::1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36 404 0 2 3
2016-09-07 12:48:26 ::1 GET /ProductRESTService.svc/getproductlist/1 - 8123 - ::1 Mozilla/5.0+(Windows+NT+6.1;+WOW64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/52.0.2743.116+Safari/537.36 400 0 0 4
I tried changing the DefaultAppPool identity to LocalService and my windows login ID, nothing works.
In order to confirm the problem lies with the 3rd party DLL, I changed the method getproductlist not to load/call the 3rd party DLL but instead return fixed dummy value, and now both works perfectly. So I am sure the problem is caused by the DLL when running without VS2015.
2) I reverted back the code and stopped IIS and tried running IISExpress (using the IISexpress used by vs2015). I started it using the same config file as VS2015 inside /config:path-to-code.vs\config\applicationhost.config... I encountered the exactly same issue, while accessing localhost:17476/ProductRESTService.svc there is not problem.. BUT encountered error when accessing the method localhost:17476/ProductRESTService.svc/getproductlist/1.
Question:
q1) how come the WCF calling 3rd party DLL only works when launched using VS2015 and not when launched via IIS7.5 or IISexpress independently?
q2) how to copy the IISexpress settings/config from VS2015 into IIS7.5 and to the c:\program files\IIE Express\IISexpress.exe?
Any help will be appreciated. Thanks!
Update:
2) I found the problem for IISExpress.. I changed to "C:\Program Files (x86)\IIS Express\iisexpress.exe" instead of "C:\Program Files\" and both svc and method work! Why not "C:\Program Files" since my OS is 64bit?
I still cant get IIS to work for both, any help would be appreciated!
Thanks!
Update Solved!
I managed to fix the problem. In IIS 7.5.76 I set the DefaultAppPool advanced settings to
1) .NET Framework Version v4.0
2) Enable 32-bit application = true
3) Identity = LocalSystem
Now, my WCF service and method(calling 3rd party DLL) works with IIS and I can run it as a production service!

Getting error '80070002' from COM .dll

I am moving a Classic ASP site from a Windows 2000 server to a Windows 2008 (both dev and prod). I have a .dll that was created in .NET 1.1. The error is occurring when function created in JScript located in this securityUtility.asp creates an ActiveXobject using the dll. The line looks as follows:
function getProfileFromLdap(user, pw){
var aClass, aProfile
aClass = new ActiveXObject("com.co.comp.security.ldap.LDAPLogin");
...
}
The error that is occurring is:
error '80070002'
E:\SITES\WWW-COMPANYSITE-COM\SITE\BINS../../siteInc/securityUtility.asp, line 850
I had run the following command to register the dll in the registry:
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" coSecurity.dll /tlb:coSecurity.tlb
I don't know if it's worth mentioning but at one point the site worked perfectly in dev and erring when I attempted to move the site to production. I had moved the site to the new dev server (Windows 2008) so long ago. I had made notes so when I moved it up to production I knew what steps I had taken. I thought perhaps I forgot to record a step so in attempt to retrace what I did, I uninstalled the .dll and went through the steps I had recorded. It is now broken in dev but at one point it was working.
Another thing I'm not sure is worth mentioning is this site was the first site on the new dev server. .NET 1.1 was installed prior to any other framework. 4.0 and 2.0 were installed after the fact. On the prod server 4.0 was installed first and then 1.1. Not sure if that's signficant or not.
When the dev site was working I had confirmed the items were in the
registry comparing them to the old production and the new dev
servers and the new production
On the old production server there was nothing in the GAC
The coSecurity.dll is in the same file as the securityUtility.asp
(the page that the code belongs to).
The Application pool for the has "enable 32-bit applications" as true
for both of the new environments
"Everyone" is granted full rights on the .dll
I'm not sure what I'm missing!
This is what I ended up doing for those that have been beating their heads against the wall like I was:
opened a command prompt as administrator
navigated to where the dll was stored
unregistered the dll using
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" /u
coSecurity.dll
re-registered the dll by using
"C:\Windows\Microsoft.NET\Framework\v1.1.4322\RegAsm" coSecurity.dll
/codebase
you'll get a regasm warning but should also get the message "Types
registered successfully"
After that I no longer recieved the error!
In general HRESULT 80070002 means "File Not Found".
My guess is you are missing a dependency. Try using Dependency Walker to see if there are any dependencies which should be included.
Also see this thread for some tips about registering COM servers manually.

Error starting ASP.NET State Service

I get the following error when trying to start the ASP.NET State Service:
Windows could not start the ASP.NET State Service service on Local Computer.
Error 2: The system cannot find the file specified.
Everything I found on google told me to go to the %windir%\Microsoft.NET\Framework\v1.1.4322 folder at the command prompt, and then type the following command: aspnet_regiis.exe -ir
which I did and didn't solve the problem. The path to the executable in my case is 2.0: C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe.
So I tried the same comand on the v2 folder and I get the error:
"An attempt was made to load a program with an incorrect format".
thanks in advace for any help
As stated here, it's trying to load the 32-bit version while you need the 64-bit. If this is applicable, open RegEdit (own risk and so on) and change HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\ImagePath
from %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_state.exe to %SystemRoot%\Microsoft.NET\Framework64\v2.0.50727\aspnet_state.exe.
You not need reinstall this service.
Just find in services "ASP.NET State Server" and start it.
Also you can set up to start this service automaticaly in preferences.

Categories

Resources