launching a web service (.asmx) in a IIS 6.0 - c#

I have developed a web service with the .asmx extension using C# and i want to deploy this into my VPS which has Windows Server 2003 with IIS 6.
Service is running with Framework 4.0 and it's installed in the VPS also. When I upload the precompiled version into the VPS it shows a runtime error
Server Error in '/' Application.
Runtime Error
Description: An application error
occurred on the server. The current
custom error settings for this
application prevent the details of the
application error from being viewed
remotely (for security reasons). It
could, however, be viewed by browsers
running on the local server machine.
Details: To enable the details of this
specific error message to be viewable
on remote machines, please create a
<customErrors> tag within a
"web.config" configuration file
located in the root directory of the
current web application. This
tag should then have
its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are
seeing can be replaced by a custom
error page by modifying the
"defaultRedirect" attribute of the
application's <customErrors>
configuration tag to point to a custom
error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
can anyone help me on this?
Update
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to >service this request. Please review the specific error details below and modify your >configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names >are case-sensitive.
Source Error:
Line 26:
Line 27:
Line 28:
Line 29:
Line 30: Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Source File: C:\Inetpub\vhosts\akashvahini.com\httpdocs\web.config
Line: 28
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET >Version:2.0.50727.3053
this is the new error message after enabling debugging in the web.config

You should enable debugging to diagnose the problem.
Microsoft has a very detailed explanation on how to enable detailed debugging over here.
Server Error in '/' Application.
That error is too generic, check the output after you enabled debugging and post the results.
And don't forget to disable debugging after your site goes live.
Update:
Seems to be permission related:
http://forums.iis.net/p/1042369/1454379.aspx
The ASPNET user account needs permissions for the folder that contains your asmx service.
Update2:
You can give the ASPNET user permissions using the file system permission dialog:
http://www.asp.net/learn/whitepapers/denied-access-to-iis-directories
Might look different on newer versions of Windows.

From my experience "Server Application Unavailable" means that you have got web sites that use different versions of .net in the same application pool.
the site that hosts your webservice needs to be in an app pool that only has .net 4.0 web sites. The application pool is configured on the Home Directory tab in the web site properties.

Looks to me like the application pool is trying to run two difference versions on .net.
Make a new application pool and call it something like .Net4 and then move the new site across to use this app pool and everything should work.
This error is shown by
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET >Version:2.0.50727.3053
Where the site with a .asmx should say .Microsoft .NET Framework Version:4.0 etc...

Related

Configuration Error on Updating Web.config

I would like to update the web.config file by C# in windows container.
The following is a function of updating web.config in C#
private void UpdateWebConfigFile()
{
var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
var section = (System.Configuration.ConnectionStringsSection)configuration.GetSection("connectionStrings");
var defaultConnection = section.ConnectionStrings["DefaultConnection"].ConnectionString;
section.ConnectionStrings["DefaultConnection"].ConnectionString = Environment.ExpandEnvironmentVariables(defaultConnection);
configuration.Save();
}
but an error occurred in configuration.Save(); that I get the result as following
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Access to the path 'C:\inetpub\wwwroot\tynfsgbl.tmp' is denied.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: C:\inetpub\wwwroot\web.config Line: 0
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0
My question is How to update Web.config in the application of Windows Container?
Thank you!
Containers are by design intended to be immutable, and as such, the default user is set to a non-admin account which will not have permissions to modify the IIS directoy.
While you can modify the runtime user to be an admin, this would present another issue due to the way that IIS inside a container is montiored. Changing the web.config would cause IIS to reset the pool, which docker would treat as a process crash and stop the container.
Either you should modify the web.config as part of the container build, or you should use environment variables directly rather than trying to write them into the web.config when the container is running.

When I first start up website by clicking the link, it shows the error

enter image description here
I am fresher in ASP.Net C# (4.0). I developed one website and upload to a server. It works in my local system. But when i upload to the server, page displays one error in web.config. AND ERROR IS...
Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".
Your detail is clear enough,To see what caused this error add codes below to your webconfig inside configuration section and then try again
<system.web>
<customErrors mode="Off"/>
</system.web>

Seeing a generic 500 internal error, how to view detailed error?

On my production server, I just deployed a asp.net web application.
I am seeing a generic '500 internal server error'.
How can I view a detailed error temporarily until I fix the problem?
I already have:
<customErrors mode="Off" defaultRedirect="error.aspx"/>
<customErrors mode="Off" /> is usually enough. But if you have messed up with some IIS configuration it won't even reach your web.config which might explain why you are seeing this generic 500 error message. Take a look at the Event Log (eventvwr.msc) of the server which might contain additional information about the error. There could really be lots of possible reasons (.NET framework misconfiguration, application pool or virtual directory misconfiguration, missing access rights to some folders, ...)
That's the reason why you should have a staging server which has the same configuration as your production server - it would allow you to test your configuration before shipping.
Change IIS Error Pages feature settings to "Detailed errors" or try to run the app from the server where it's deployed.
If the error page is coming from IIS because of some configuration being incorrect, you can try using Failed Request Tracing.

Can't run uploadify for asp.net

I have downloaded the example code/demo from:
http://www.technowise.in/2009/12/uploadify-aspnet-c-vb-examples-demo.html
and when I try to run any of the aspx files, I just get the following message from the server:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 46: ASP.NET to identify an incoming user.
Line 47: -->
Line 48: <authentication mode="Windows"/>
Line 49: <!--
Line 50: The <customErrors> section enables configuration
Source File: C:\Inetpub\wwwroot\test_uploader\uploadify\web.config Line: 48
Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618
Anyone know why this is happening? I can normally run asp.net 2.0 and above web-forms perfectly will on this server.
You get this error because you have place a web.config in a subdirectory and this contains sessions that should be there, except if you define a new application/pool asp.net in this subdirectory of your iis.
From you question, here is the path of your web.config, but this must be one directory up, or not exist at all, or remove the lines that can not be there.
C:\Inetpub\wwwroot\test_uploader\uploadify\web.config

Not able to load MicrosoftAjax.debug.js

I have an ASP.NET 3.5 web application which works perfectly fine on my local machine and when I deploy it on my Windows 2008 server. I am getting the following javascript error:
Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Line: 4723
Char: 21
Code: 0
URI: http://localhost/ScriptResource.axd?d=e1Gld4LGHLsC4rWqevEI8zAMJKoVcCEVHBjdJIxcQLO9of6t7nNopbI1YyxJTv1QbaxN_lTSoz5Ly-VjBRHp08Mf3xxg5V9i5Z0AiXIkZRY1&t=6af1de90
I have a utility which can decrypt the URI and tell exactly what file is missing and it tunrns out that the file is ZSystem.Web.Extensions,3.5.0.0,,31bf3856ad364e35|MicrosoftAjax.debug.js|. Why am I not able to load this js file? Any help?
Possible options:
You've not installed .NET Framework SP1 on your server, so it can't find the 3.5 assemblies to generate the MsAjax file.
You've deployed your web.config file with <compilation debug="true"> while IIS has been configured to compile it in release mode.
I have run into a similar problem before when the development and production machines are set for two different time zones. When ASP.NET AJAX tries to load a script resource from an assembly, the last modified date/time of the assembly is validated. If the local time of the production server is "earlier" than the last modified date/time of the assembly, then an ArgumentOutOfRange exception is generated by ASP.NET AJAX when processing the request.
Really difficult to debug since the problem eventually resolves itself.
I suppose this might be possible with a System assembly if Copy-Local is set to true.
I was using some third party web services and the problem was with the following xml tag in the web.config:
<extendedProtectionPolicy policyEnforcement="Never" />
Once I removed this tag the error went away

Categories

Resources