I have an error running a asmx WebService that uses asp.net 2.0 on IIS 7.5. The webservice calls a method from a dll using the Dllimport call. The point where the call is made is where the error happens. However I get no exceptions, just ERR_CONNECTIO_RESET from any explorer.
What i've tried:
The dll is located in the right place, the bin folder. I tried moving
it to system32 and other locations. However if I change the name of
the dll on the DLLIMPORT call i do get an error of not locating the
dll, which means it does finds the dll, just crashes on the method.
I also used GetLastWin32Error() and got the message 127
ERROR_PROC_NOT_FOUND. Not sure if it's relevant, however is something
I tried too.
If I run the Webservice on debug from VisualStudio, I get no error on
the call. So the error is when running on IIS.
I also tried on a older machine with IIS 6 on Windows XP and I get no
error. This make me think it has to do with a security issue, because
when I created the website on IIS I got this screen:
IIS 6
And i haven't configurated any security options on IIS 7.5. So i tried this
http://forums.iis.net/post/2119656.aspx
Which are steps to configure the user with enough permissions over the folder. However, still no luck.
What i believe now could be, is something asociated to GOP (Group Policy Object). The pc I'm running this service is on a company network. I have admin rights and no firewall restrictions, however I don't know if IIS 7.5 uses something from a different user or needs different permissions.
All the other threads i've found don't have the right answer for me. Any help i could get is appreciated.
Finally after a week of dealing with this, I found the problem. After finding out there are some Logs I could check on C:\Windows\System32\LogFiles\HTTPERR i found the error code Connection_Abandoned_By_ReqQueue.
After some long investigation, I found out that the message means the program is droping because of memorry corruption (As seen on this post Connection_Abandoned_By_ReqQueue Problems ). The dll I'm using is quite old and the people who generated didn't make a version who handles memory the correct way (At least for IIS 7.5), so I'm stuck with finding another library to do that work, or using a server with IIS 6.
Related
We have ASP.NET MVC application which is running on windows server machine. I have renamed classes to satisfy sonar scanning. The code deploys and runs without issue locally and in our SIT server. However, it is showing error in UAT server on windows server machine. It shows warning in event viewer that it could not find reference to previously renamed class. I have renamed a class from "CarDTO" to "CarDto", it is still trying to look for CarDTO which does not exists after the rename.
I have tried to do the following but none seems to solve the issue.
Restart IIS
Recycle application pools
Clear asp.net temporary folder
Increase the version in assembly info
I used the same files and dll in both SIT and UAT servers.
Anyone has similar issue and a way to solve this? Thank you.
Thanks for the suggestions. Apparently, there is an extra dll that accidentally being copied to the bin folder. Even though it is not being used, it gets compiled by IIS and complaining that class name mismatched.
I've been having this error happen on even the simplest "Hello world" ASP.NET Core web app in Visual Studio. (Win 10 Pro, IIS Express, VS 2019 CE.) Steps to reproduce:
Create a new ASP.NET Core or ASP.NET Core MVC solution in Visual Studio 2019. Select the options to generate the scaffolding code for the basic "hello world" app. It doesn't matter whether you target .NET Core 2.1, .NET Core 3.1, or .NET 5.0, the result is the same in the scenarios I attempted.
The project and solution loads and the source code is visible and looks correct. Press F5 to run it. App compiles but does not run.
Expected behavior: the "hello world" app loads.
Actual behavior: shows this error message in the web browser:
"HTTP Error 500.30 - ASP.NET Core app failed to start" (and some
troubleshooting steps, then) "For more information visit:
https://go.microsoft.com/fwlink/?LinkID=2028265".
Go ahead and follow that link, then use those resources to double-check that you have all the needed packages and your IIS is configured properly. Mine was all looking good on my machine, but still I was getting this error. I even tried reinstalling VS, the hosting bundle, IIS, etc. but to no avail.
NOTE: This issue is a little different than the "500.32 ANCM Failed To
Load DLL" or the "500.36 ANCM Out-Of-Process Handler Load Failure"
errors, but I also encountered those during my troubleshooting, so I'm
mentioning them here in case it helps someone else.
NOTE ALSO: you do not necessarily have a corrupted ASP.NET Core
Module as this documentation would have you believe.
Check the event logs, you'll find some errors in there, but those are not particularly helpful in diagnosing the issue in this case. In my case, it just says
"Application '/LM/W3SVC/2/ROOT' with physical root 'H:\Repo
(R;)\sandbox\AspNetCoreWebApp001\AspNetCoreWebApp001' failed to load
coreclr. Exception message: CLR worker thread exited prematurely"
and
"Application has exited from Program.Main with exit code =
'-2147450743'. Please check the stderr logs for more information."
They show IIS Express AspNetCore Module as the source. Vendor docs were not terribly helpful on this scenario.
Double check to be sure you've got your IIS configration correct, and that you have the right packages installed, including the .NET Core Hosting Bundle. If you don't, or if you're trying different configurations like I was during troubleshooting, then you might see the ANCM errors mentioned above. If you get those errors, here are two links that can help. I read those links and checked my machine carefully, multiple times. In my case, this was all correct and complete, and I still had the error.
Fight with the computer some more, call it some bad names, reinstall Visual Studio for the 3rd time, verify IIS settings for the 8th time, ask your friends for help, check SO and Google yet again. The simple hello world app still won't run, same error. It runs on another machine, so there's nothing wrong with the code itself.
This was the solution that eventually fixed it on my machine: I moved the solution to a different folder. HUH??? How could that possibly fix this issue, I asked. After more head-banging, I eventually arrived at the root cause: a semicolon in the path. Yup. In my case, I had been storing the solution in a directory called "H:\Repo (R;)". It turns out, even though the ; character is allowed by the Windows OS, the .NET CLR does not like it at all and doesn't know what to do with it. So it generates the unhelpful error message.
Try it out. Rename the folder of your "this should be working" solution to remove the semicolons, close and reopen the solution in VS, press F5 and watch it run. Or go to a working solution and rename the folder to contain a semicolon and watch it break the CLR.
I was curious whether any other special characters in a folder name would cause an issue, so I checked them all (on folders, not on filenames, but I'd expect a similar result for filenames too). Here's my exhaustive test:
Windows disallows these in folder names:
\/:*?"<>|
The solution will load and run when the path contains any of these special characters:
`~-_+=',.()[]{}!##$%&
However, having any of these characters in the path, while being allowed by Windows, will cause issues in the CLR or in Visual Studio:
; Causes "HTTP Error 500.30 - ASP.NET Core app failed to start"
^ VS fails to load the solution & shows error message as follows:
"The following files were specified on the command line: <the .sln file>
These files could not be found and will not be loaded."
A totally empty instance of VS loads instead.
I also tried creating a new "hello world" console app in VS under a folder containing a semicolon in the name, and guess what? That also fails to run. Though in that case, obviously there is no HTTP error from IIS. Instead, it says
"Failed to create CoreCLR, HRESULT: 0x80070057"
and throws a process exit code. Once again, it's the result of having a semicolon in the path, because removing that semicolon from the path and reloading the solution in VS allows it to run correctly. So the semicolon issue seems to be originating from the CLR and therefore is unrelated to IIS.
Here are some related posts regarding the root cause, which is not readily apparent for web apps running on IIS Express:
Failed to create CoreCLR, HRESULT: 0x80070057
https://github.com/dotnet/sdk/issues/13954
So, kudos to those authors for those posts which were very helpful in the RCA.
One would think that the special characters allowed by the OS would also be fair game to use in the path to your Visual Studio code. Oh well. Lesson learned.
We're trying to run R.net from an ASP.Net webpage in IIS, but encounter the problem that the R engine can't access external libraries. I know this is a common problem, but the typical solutions haven't worked when it comes to IIS (only IIS express from inside VS).
For example, when trying to use 'colorRampPalette' in R which relies on a DLL, the following error message appears:
"Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Program Files/R/R-3.4.2/library/stats/libs/x64/stats.dll': LoadLibrary failure: The specified module could not be found."
It is not the stats.dll that is the problem, but rather another DLL it references.
Now, using the function in R works fine. Using the function from R.net in VS debugging works fine. However, running it from IIS does not work. Normally, it's just a path variable missing to get it to work, but this doesn't seem to be the case here.
What we've tried:
Ensured that the PATH variable has the necessary folders (i.e. C:\Program Files\R\R-3.4.3\bin\x64 etc). If this was wrong then R.net wouldn't work locally, and I've also verified that IIS doesn't reset the PATH variables which has been pointed out in other sources. When I check the PATH variable from inside IIS the necessary folders are listed.
Checked that the library, home and bin path in R.net is correct when running under IIS.
Ensured that the IIS_IUSRS user has read/write access to the necessary folders and files.
Verified that the R code is correct.
It seems that this is a common problem, but most solutions refer to making sure the PATH variable is correct, which simply isn't enough in this case.
We're running (Amazon web service):
Windows Server 2016 x64,
IIS 10,
R.NET 1.7,
C# 4.5.2,
R 3.4.2
I've also tried on another (non-AWS) server with a similar setup.
Any ideas of what can cause this? Since a lot of people have issues with R.Net and IIS I suspect someone encountered the same problem where the PATH variable wasn't enough?
As mentioned by user2967150, It is not the stats.dll that is the problem, but rather another DLL it references.
After doing lot of research I found that It try to find Rlapack.dll in 'C:/Program Files/R/R-3.4.2/library/stats/libs/x64/ path.
so you just have to copy Rlapack.dll from 'C:\Program Files\R\R-3.4.4\bin\x64 \Rlapack.dll'
to 'C:/Program Files/R/R-3.4.2/library/stats/libs/x64/ .
After this the web Application can access external R libraries.
Note: I assume that your web Application Run locally but creates a problem when you try to run it on IIS.
I was solving same issue. For IIS I did not find the solution. I was also debugging the R.NET code, but solution by setting correct path to R folder did not work.
The solution is created additional layer, which cover running R project (actually create own R server). I used self hosted WCF service,
https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-a-managed-windows-service
which is practically console application and has benefits application running not in IIS application pool. This solution also cover singleton REngine problem. In case you run the instance or REngine in IIS, there is no posibility dispose it, only by stop application pool. For self-hosted service you can set trigger for restarting application in case memory leak.
During this implementation I discover problem run R.NET again R 3.4.3 in debug mode on console application I get error "The library "..." could not be load", so I used the R 3.4.2. which work nice. 86x installation is required - independent the your application run in 64x/ANYCPU environment.
Have you found any other solution for that?
In Brief
When I attempt to browse my website, I get the following error message:
CS0016: Could not write to output file 'c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\www\xxx\yyy\zzz\a.b.dll' - 'The directory name is invalid'
In Detail
I have two web-sites on my Development PC (fictitious names):
Web2 - this is written in ASP.NET using .NET 3.5 and runs in an AppPool that addresses the v2.0 .NET framework and runs in an Integrated mode. This is developed using Visual Studio 2010
Web4 - this is written in ASP.NET using .NET 4.5 and runs in an AppPool that addresses the v4.0 .NET framework and runs in an Integrated mode. This is developed using Visual Studio 2012.
Recently, I've been working in VS2012 on Web4 almost constantly and it works fine, however the other day I tried to run Web2 and got the exception displayed above.
Bizarrely, part of the path (which I replaced above with letters "zzz") appear to point to a German language path, since it's "\de-DE\" - I'm not operating in German, so I've no idea where it got this idea from.
One thing that is almost certainly un-related, but for some unknown reason I feel it's important to mention: I was using the Performance Analysis tool in Visual Studio 2012 the day before this problem first appeared and I don't know if this might have made some changes to my computer...??
Attempted fixes
There are quite a few threads regarding this on the internet; some threads end in success where file access permissions have been altered whilst others finish on a somewhat desperate sounding note... I have gone through the process of comparing the NTFS permissions on all relevant sounding directories on my PC with that of a colleagues on whose machine this is still working. Unfortunately, no joy to be had there.
I have also un-installed asp.net 2.0 and re-installed it using:
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -u
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -ir
and again, no joy to be had there either.
My Web4 continues to run unaffected.
Also FYI: using IIS 7.5 on Win7 x64.
I'm now turning to the this wider audience in the hope of turning my current state of despair into one of success.
Thanks everyone
Griff
In IIS Manager, in the advanced settings of the Application Pool, make sure "Process Model > Load User Profile" is set to "True".
I had this exact same problem. I tried changing permissions, disabling anti-virus, creating a new app pool, and reinstalling .NET. I even created a new site with just a "Default.aspx" page and tried to view that site. Even that site had the compilation error. Finally, I noticed that my app pools (clean test site and main site) had the non-default value "False" for the Load User Profile setting. I set that back to true and the issue went away.
The answer was found using ProcMon:
http://technet.microsoft.com/en-us/sysinternals/bb896645
The temporary asp.net files are first created in the user's temp folder and then moved into this folder. For some as yet unknown reason, the compilation for my Web2 site (.NET 2 AppPool) now uses the same folders as my Web4 (.NET 4 AppPool) site.
I used ProcMon to identify all results for "access denied" and gave the IIS_IUSRS group write permissions (and in one case - C:\Users\ASP.NET V4.0 Integrated - modify permissions).
I have no idea why the compilation is using the "wrong" folders and I suspect I may have over-elevated the permissions in some cases, but for now it's working.
In case the above answers didn't fix it for you, check your environment variables (right-click on Computer -> Properties -> Advanced System Settings -> Advanced tab -> Environment Variables
Make sure the temp variables are pointing to a folder with all the necessary permissions. (full access for Network Service, IIS_IUSRS)
Note: don't check just the two variables at the top, look inside the scroll menu under System Variables. You might find the variables configured there too.
It may not be the cause, but this error started occurring for me after trying to run VS 2010 Performance Wizard with the Instrumentation method.
A quick fix in my DEV environment: changed the Identity of the Application Pool of the app to LocalSystem.
My C# web application stopped working for no apparent reason, while a similar application on the same server still works. Looking for ideas what could be going on and how to fix it.
Yesterday I launched a build of the site with some minor updates. The server apparently went down during the build, because for a few minutes TeamCity displayed a message indicating the connection had been lost. However, it recovered and resumed the build.
After the build, I was no longer able to load the site. The home page now seems to be the only page that can load, and it displays incorrectly because the scripts and stylesheets fail to load. If I check the browser’s error console I find reports of multiple server error 500’s, where the referenced css and script files are failing to load.
The server is IIS on Windows Server 2008.
If I go to the server and open the site there, the page gives me error messages saying, “Could not load file or assembly ‘Antlr3.Runtime.Debug’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).”
Initially it was reporting the same message for a different file, AntiXssLibrary. I removed that DLL from the project, and the site switched to complaining about antlr instead. It looks like the problem isn’t either DLL, but something else.
On my machine, a nearly identical copy of the same code works without problem. Another copy of the site on the same server, a slightly earlier version of our software, works just fine.
I deleted all of the temp files recommended for this error, redid the build, restarted the machine, and deleted the bin directory and repeated the build. I’m skeptical that uninstalling or reinstalling any versions of the .net framework would help, given that the other site works—any problem with the frameowkr ought to affect both of them.
I turned on assembly logging, which gave me lots of additional information that didn’t help at all.
Any suggestions what could be going on?
Edit: a link below suggests that the problem is corrupted temp DLLs, and that deleting and recompiling will replace them with good copies. That's plausible. But it seems like re-running the build ought to recompile if anything is going to.
Might there be some other way to force it to recompile / update the DLLs?