Captcha not working in asp.net - asp.net

hey guys,
i have downloaded mondor's captcha control, and implemented on localhost, thats working fine, but when i did the same steps and uploaded to the hosting server, i am unabel to get captcha image,i want to know whats the difference between placing dll's in bin folder and adding it as a reference because anyway it will go in bin folder. on localhost i added a reference to that dll and on hosting server i just added the dll in the bin folder, is that the problem, if yes than what could be the solution for this issue...
If anyone knows about it, please suggest..

Please check IIS version on server.
For IIS 7
change the following line in web.config file under <system.webServer> <handlers>:
<add name="MSCaptcha" path="CaptchaImage.axd" verb="GET" type="MSCaptcha.CaptchaImageHandler, MSCaptcha" preCondition="integratedMode,runtimeVersionv2.0"/>

Check all folders and files had been uploaded related to captcha control

Related

IIS can't install custom module

i'm trying since hours to install a custom module on IIS from the manager.
I coded it in C#.
I'm able to load it into a test ASP.NET app that i created.
I copy it into the bin folder, and add this line into the web.config :
<system.webServer>
<modules>
<add name="Module" type="IISExtend.Module"/>
</modules>
</system.webServer>
It works.
To add it to IIS, i tried :
Put the output DLL into the bin folder of the root of the website, like this : https://i.gyazo.com/14b54742cc758d6083a9787df8a8cbe1.png
Add it in the module list like this : https://i.gyazo.com/b686a505c8d4785ffb63d5c384580ac5.png
But i get this warning : https://i.gyazo.com/b137ecca9369cc53018aecd7409d8737.png
I already tried to edit config files manually, sign the dll, add it to global store, change the .NET version, and it changes nothing.
The module does not loads, and seems not installed.
Here the exact name of my class : https://i.gyazo.com/10973b6852e1d1de139641905bee2b19.png
Thank you very much for your help :)
I found a solution.
I installed a lot of windows features, regarding ASP.NET and ASP.NET core under IIS section.
I worked.
Thank you for your help.

Stop bad handler mappings from re-appearing

I'm on Windows 10 running an ASP.Net web app locally in IIS Express. Initially when I was trying to serve my app on localhost I introduced some bad handler mappings in my IIS Express options for the app. I figured out I didn't have IIS ASP.Net installed as part of IIS and fixed that. Then I removed the bad mappings and everything works. But every time I restart my app in IIS the bad mappings re-appear, and I have to remove them again. How do I permanently delete or remove these bad mappings? Thanks in advance for any replies.
I think I figured it out. I added lines to remove the bad handlers in my Web.cong in the system.webServer section ( the Web.config in my projects root folder). The problem was happing everytime I published to the local server. Seems intorducing these lines replaces the Web.config in the app's root folder for the server. Adding these lines seems to fix the problem. Here's the lines I added:
<handlers>
<remove name="Start Module" />
<remove name="Start" />
</handlers>

Deployment of the ASP.NET website to Windows Server via FTP

I am trying to deploy my test website to the ftp server, yet I am having quite a few difficulties with it (as it is my very first time doing this).
Here is how the ftp's server folder setup looks like:
There is a main folder named www_root, which contains the following two folders app_data and data.
Here is a printscreen from a TotalCommander:
I was being told by the support people, that I need to copy all my data into the www_root folder.
Once I published my ASP.NET 5 MVC application via Visual Studio 2015 to a File System, I could see three folders:
My base index.html, together with css & javascript is located under wwwroot folder. Here is what the inside of wwwroot folder looks like:
When I copy the contents of my wwwroot folder inside www_root folder (under FTP) and I exclude web.config file, then my base webpage is loaded without a problem (but without server side logic...it's just a plain page with some HTML & CSS code).
Now the problem occured when I added web.config to that folder, then suddenly I received Error 500 when I tried to open my website. I believed that the problem was caused by the fact that web.config contained the following setup:
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Here I could see that we are targeting \approot\web.cmd file. Therefore what I did was, that I copied my approot & logs folders (generated by Visual Studio) to the base folder under my FTP.
So in the end when I logged in to my FTP I had the following folders: approot, logs, www_root, where inside of www_root I had all my css, js, & index.html.
Nonetheless, when I reloaded my webpage, it still gave me the 403 - Forbidden: Access is denied..
How can I solve this problem? What am I doing wrong?
In the end, the problem was occurred by the fact, that my hosting server had folder named www_root, however my ASP.NET application automatically creates folder wwwrooot.
What I ended up doing is creating a script, which loops through all the files and replaces wwwroot with www_root.
That has solved the problem.

ASP.NET: HTTP Error 500.19 – Internal Server Error 0x8007000d

I am replicating web application deployment and found several issues related to HTTP Error 500.19. My machine is running Windows 7 while the working development is using Windows 8. We're developing our Web Application using Visual Studio 2010.
First, I got error code 0x80070021, similar as posted here.
I update my web.config according to the accepted answer and then I got following error code (which is similar as posted here).
HTTP Error 500.19 - Internal Server Error
Error Code 0x8007000d
Config Source -1: 0:
I have read the symptoms definition in Microsoft support page and cause of the error is:
This problem occurs because the ApplicationHost.config file or the Web.config file contains a malformed XML element.
and the solution is
Delete the malformed XML element from the ApplicationHost.config file or from the Web.config file.
However, the web.config that I used is working perfectly in the original development environment.
Here is what I have checked and tried so far:
Install ASP.NET by calling aspnet_regiis -i
Set my application to use different application pool (ASP.NET v4.0, .NET v4, etc)
ApplicationHost.config file is still using default from Windows 7.
This is part of my Web.Config
<system.webServer>
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
</modules>
<handlers>
<remove name="UrlRoutingHandler" />
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<urlCompression doStaticCompression="true" doDynamicCompression="false"></urlCompression>
<directoryBrowse enabled="true" />
<defaultDocument>
<files>
<add value="Logon.aspx" />
</files>
</defaultDocument>
</system.webServer>
I have read similar/duplicates/closed posts (around 13) posts in stackoverflow, tried all except the answer related to Ajax (is it related) and still have no clue on what the error is.
Does anyone one how to fix this error? (And if possible, a comprehensive lists of things need to be checked so we can reduce similar posts like this.) I am ready to provide more details.
Error 0x8007000d means URL rewriting module (referenced in web.config) is missing or proper version is not installed.
Just install URL rewriting module via web platform installer.
I recommend to check all dependencies from web.config and install them.
When trying to set up a .NET Core 1.0 website I got this error, and tried everything else I could find with no luck, including checking the web.config file, IIS_IUSRS permissions, IIS URL rewrite module, etc. In the end, I installed DotNetCore.1.0.0-WindowsHosting.exe from this page: https://www.microsoft.com/net/download and it started working right away.
Specific link to download: https://go.microsoft.com/fwlink/?LinkId=817246
Yes, for .net core apps, install dotnet hosting. This worked for me.
And here it is for .net6
And now if you need .net7
Install URL rewriting:
UPDATE - this is now available here (and works with IIS 7-10):
https://www.iis.net/downloads/microsoft/url-rewrite
Ensure you have the following set to 'Allowed' for your IIS server:
In my case, because I had reinstalled iis, I needed to register iis with dot net 4 using this command:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
In my case (.Net Core Web API) for this issue HTTP Error 500.19 – Internal Server Error 0x8007000d
First download dotnet-hosting-3.0.0-preview5-19227-01-win (.Net Core 3) or dotnetcore 2 hasting windows
https://download.visualstudio.microsoft.com/download/pr/5bed16f2-fd1a-4027-bee3-3d6a1b5844cc/dd22ca2820fadb57fd5378e1763d27cd/dotnet-hosting-3.1.4-win.exe
Any .net core 3.1 application either angular or mvc application would need this.
Second install it as Administrator
Open cmd as administrator, type iisreset, press enter
So refresh your localhost app
Best regard
M.M.Tofighi from Iran
A repair of the DotNetCore hosting bundle did the trick for me. :/
Installing ASP.NET Core Runtime Hosting Bundle solved the issue for me. Source: 500.19 Internal Server Error (0x8007000d)
Kind of late to the party here, but I have just been struggling with the exact same issue (symptoms) and cursing the lack of error detail reporting.
It worked fine on IIS 8+ machines but Win 7 got these INSTANT HTTP 500.19 errors.
For me it was as silly as having an unsupported configuration element in the config file:
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
So while running old web.config files worked fine, I just diffed them and started chopping away at new blocks until I got the page to start loading. Had I seen this as an answer I would have gone this route immediately as I knew none of the popular solutions were relevant. So there you go :)
I turn on .Net Framework 3.5 and 4.5 Advance Service in Control Panel->Programs and Features->Turn Windows features on or off.it work for me.
Problem solved. Here are the steps that I tried:
Enable the 32-bit application in IIS -> Application pool -> Advanced settings
Copy System.EnterpriseServices.dll and System.EnterpriseServices.Wrapper.dll from C:\Windows\Microsoft.NET\Framework\v2.0.50727 to the application bin folder
Do comments/uncomments to sections on the web.config and found that problem related to the referenced DLL.
The config that I commented the previous one that I added:
<section name="handlers" overrideModeDefault="Allow" />
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Allow"/>
Add the required FasterFlect.DLL used by Combres.DLL v2.1.0.0 to the application bin folder (shall download the full zip from Combres codeplex, because the required fasterflect DLL V2.0.3732.24338 cannot be found in fasterflect codeplex) and other DLLs. For convinience, use the full Combres.DLL (1,3MB)
Check that the DLL versions and public key tokens are configured correctly in web.config using tool, e.g. .NET Reflector
I understand that this error can occur because of many different reasons. In my case it was because I uninstalled WSUS service from Server Roles and the whole IIS went down. After doing a bit of research I found that uninstalling WSUS removes a few dlls which are used to do http compression. Since those dlls were missing and the IIS was still looking for them I did a reset using the following command in CMD:
appcmd set config -section:system.webServer/httpCompression /-[name='xpress']
Bingo! The problem is sorted now. Dont forget to run it as an administrator. You might also need to do "iisreset" as well. Just in case.
Hope it helps others.
Cheers
I had this problem with a brand new web service. Solved it by adding read-only access for Everyone on Properties->Security for the folder that the service was in.
I had the exact same error. It turned out that it was something was caused by something completely, though. It was missing write permissions in a cache folder. But IIS reported error 0x8007000d which is wildly confusing.
I have the same problem when I was trying to publish asp.net core 5.0 web app on my local IIS and the solution was to add the following inside System.webserver tag in my web.config file
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
Reinstalling ASP.NET Core Runtime - Windows Hosting Bundle Installer made the trick for me... I belive the "ASP.NET Core Module" was missing.
For me I had a web.config file in one my root folders, this config file was for the live server so removing it allowed the site to run on the dev server.
So check for any web.config files in folders too.
In my case, i have installed dotnet hosting but error change to HTTP Error 503. The service is unavailable, but after install windows update KB2999226 and dotnet sdk, its work!
follow the procedure chronologically or it might fail due to missing or errors in redirecting.
install Runtime bundle e.g.. dotnet-sdk-7.0....
2.turn asp services on and internet services"Turn Windows features on or off" to enable IIS
3.install web hosting bundle iis 7.0 e.g dotnet-hosting-7.0.2...
this worked for me
For me, it was all about setting up my web server to use the latest-and-greatest tech to support my ASP.NET 5 application!
The following URL gave me all the tips I needed:
https://docs.asp.net/en/1.0.0-rc1/publishing/iis-with-msdeploy.html
Hope this helps :)

WebResource.axd not found

I can't get script files to load on my website. Everything else works fine. I haven't tried ScriptResource.axd however.
I have verified this issue exists on both cassini and IIS7.
I have verified my 64bit 4.0 web.config contains the mapping for WebResource.axd.
My system time is correct (I heard there may be issues with that).
I have verified that it works in other projects, so the culprit has to be my web application.
My web application is 4.0 MVC3 web application.
My web.config can be found here.
This error is killing me! Any help would be appreciated!
Your web.config file is amazing (it's not a compliment): in .NET Framework 4.0, it should be much shorter/lighter.
I think that your handler is declared in the wrong section :
<system.webServer>
<handlers>
<add name="WebResource" path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" />
</handlers>
</system.webServer>
Normally, the WebResource.axd handler is declared in "system.web" section :
<system.web>
<httpHandlers>
<add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
</httpHandlers>
</system.web>
I resolved a similar issue by adding read permissions for Everyone to the folder where the assembly containing the embedded resource was located. Clearly Everyone is overkill, but that might help others researching similar issues.
In our case some resources loaded (so I know the AssemblyResourceLoader was working) and it worked on one machine but not another.
This answer to another question helped me determine what assemblies were not working.
I solved this issue on a production machine running again aspnet_regiis:
%WINDIR%\Microsoft .NET\Framework\4.xxxx\aspnet_regiis -i
Probably the standard installation of the framework 4 went wrong.
Bit late but might help someone in the future...
I found that this can happen if the DLL of the web application you are delivering are newer than the current date time. For example, you put your web application on the production server where the server time is older than on your development machine.
Getting the server time in sync with the dev machine did the trick for me...
Absolutely solution is : https://web.archive.org/web/20211020131200/https://www.4guysfromrolla.com/articles/080906-1.aspx
when you check the .net framework code : https://github.com/Microsoft/referencesource/blob/master/System.Web/Handlers/AssemblyResourceLoader.cs
you can see the trick : at line 606
WebResourceAttribute wra = FindWebResourceAttribute(assembly, resourceName);
if the assembly does not have WebResourceAttribute it throws 404 error.
You can see at this line
if (resourceStream == null) {
if (resourceIdentifierPresent) {
LogWebResourceFailure(decryptedData, exception);
}
throw new HttpException(404, SR.GetString(SR.AssemblyResourceLoader_InvalidRequest));
}
so add the WebResourceAttribute to your AssemblyInfo.cs file like this :
[assembly: WebResource("FullNameSpace.SampleResourceFile.js", "text/javascript")]
I had this .axd issue with Umbraco on a production server, it drove me crazy until I found out that the server had different security and under Request Filtering, the extensions .axd and .asmx were not listed in the Allowed filenames by default, and the hosting company had the setting Allow unlisted file name extensions turned off, which was different to my development machine.
None of the previous solutions worked out for me. Although it took me some time, in the end it was as simple as this:
Plesk Admins, Please disable the Web Application Firewall to solve this issue.
Tools & Settings > Web Application Firewall > Turn Off
Cheers!
Colin's tip got me looking at my new webhost (InterServer). Turns out their Web Application Firewall was the culprit. Switch it to Detect Only or Off, and it's fine.

Resources