Quantcast
Channel: ASP.NET Administration
Viewing all 392 articles
Browse latest View live

Odd 'The resource cannot be found' error

$
0
0

I have a UAT server and two Prod servers (2012 r2) that are not yet live but all have been working fine.  In the past month or so (not sure quite when) they have starting giving the following error for all managed code app pools:

Server Error in '/ISTAdmin' Application.


The resource cannot be found.

Description:HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.
Requested URL: /istadmin

These sites will not even serve basic HTML pages with no app code - if I change the App Pool to no managed code they will. I have upgraded .net to v4.6.1, run diagnostics, uninstalled several patches, even uninstalled and reinstalled IIS but no success!  The site works 100% fine on my dev machine (Windows 10) and build with no issues.

Event viewer and IIS logs don't appear to have anything of any use either!  I'm really stumped - any ideas what the issue could be or what else to try to trouble shoot?

thanks for any assistance


URL Rewrite - HTTPS to HTTP

$
0
0

My site is ASP.Net framework 2.0 on IIS 7.5. It is non-ssl site with all pages working on HTTP.

  • Suddenly it is observed that with latest IE11 update, site is being redirected to HTTPS automatically. On checking it is found that IE v 11.953.x is doing so.
  • When checked in IE v11.576.x, the site is coming up in HTTP and redirection is not happening.

I installed URL Rewrite module on IIS and added following rules, but none of them worked. 

ANY HELP IN THIS REGARD IS HIGHLY APPRECIATED.

Trial 1:

-------------------------------------------------------

<rule name="Redirect to http" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP}" pattern="off" ignoreCase="true" />
<add input="{REQUEST_URI}" pattern="(/\w*[/ | \w]+\.aspx)" />
</conditions>
<action type="Redirect" url="http://{HTTPS_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
</rule>

---------------------------

Trial 2 - Throws error - 

The condition's expression "{RequiresSSL:{R:1}}" is not valid.

--------------------------

<rule name="HTTPS to HTTP redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{RequiresSSL:{R:1}}" pattern="(.+)" negate="true" />
<add input="{HTTPS}" pattern="on" ignoreCase="true" />
<add input="{REQUEST_URI}" pattern="^(.+)\.(?!aspx)" negate="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="http://{HTTP_HOST}/{R:1}" />
</rule>

 

New ASP.NET with oracle ODP.NET only connects with admin login

$
0
0

noob on iis and asp.net C# mvc5 with oracle ODP.NET managed driver....worked thru many problems but now site works locally on my newly created iis on spare workstation with iis 6.1 with either user or admin credentials....but connecting to website from remote workstation it will only work as admin login when I am logged into iis workstation as admin and have the site open...perplexed

IIS8 Application Initialization not working after first init

$
0
0

I am trying to get application initialization working on Win Server 2012R2 DC and IIS8, for an ASP.NET WebApi.    I have followed these instructions:

https://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-application-initialization

Initialization works correctly when the application first starts, but it's not being re-initialized on a periodic basis after the AppPool is recycled.   Then, when a request comes in, the configured application init occurs again but results in the typical warm-up delay.

Below I have included screenshots of my configuration.   As shown, it works the first time the application starts.  I expect to see the log entries on a periodic basis, but that's not happening.   And after some period of time, if I hit the WebApi using a client application, there is a delay in the response (due to warm-up).

Any thoughts or suggestions what might be wrong here?   I appreciate any insight.

Thanks.  

Application Initialization feature is installed:

applicationHost.config:

-------------------------------------------------------------------------------------------------

web.config:

Verification of Application Pool:

WebApi controller action (reads # entries from database table, then writes log):

Startup page is correctly shown the first time application initializes:

And finally, the log entry is written from the WebApi controller action, so I know the first appInit is occurring:

Cannot do async await from a website running in IIS 10

$
0
0

I have a website where we have created a client to consume responses from a web.api from the server side using the below code. If I run that code on my machine I can see that the request goes out successfully and the web.api service logs a success response with the data I am looking for. However, that response never comes back to me and the code just hangs waiting for it. If I run the same code from a small test console app I created it works fine. If I run it from a small empty test web app I created I experience the same issue. There are also three other developers on our team who can all run the same code on their machines from our website successfully. The only difference between my machine and theirs is that I have IIS 10 and Windows 10 and they do not. So we're thinking IIS 10 might be causing an issue for me. I have also discovered that removing the await call and adding a .Result at the end of each of the async calls allows the code to run on my machine. So somehow the await is causing some sort of deadlock on my machine but not on others. I have googled extensively and no one else seems to have had this problem with IIS 10 exactly. So I was hoping someone here might know why IIS 10 would be causing a deadlock on async calls from my machine. Any help will be greatly appreciated.

code to retrieve the response:

T model = default(T);

JsonSerializerSettings serializerSettings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() { IgnoreSerializableAttribute = true } };

using (client)
{
HttpResponseMessage response = await client.GetAsync(path);
if (response.IsSuccessStatusCode)
{
var models = await response.Content.ReadAsStringAsync();
model = JsonConvert.DeserializeObject<T>(models, serializerSettings);
}
else
{
HandleErrors(response);
}
}
return model;

Code to create the Client:

var client = new HttpClient();

client.BaseAddress = new Uri(url);
client.Timeout = new TimeSpan(0, 0, 0, 0, 500 * 1000);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("Authorization-Token", "my token}");

iis looking for asp.net file reference in the wrong place!

$
0
0

I have an asp.net web application which has been deployed for *years* with no problem.

At first, it was deployed by hand, then by scripts in CruiseControl

Recently, we changed the deployment tool to Octopus deploy, and it has a bunch of predefined scripts, one set of which is set up to deploy a web application.  But something is different!

In one of the aspx files, a resource is referenced thus:

          ToolsFile="~/TaskEditorToolbarDefault.xml"

Where before, things would just work, with the new deploy scripts, i get an error 

Could not find file 'c:\windows\system32\inetsrv\~\TaskEditorToolbarDefault.xml'.

on the server, as i play with the file reference the error message changes to reflect the change i make in the file.

But, it is always is looking in c:\windows\system32\inetsrv

I've checked the application settings, the application advanced settings, the app pool basic settings, the app pool advanced settings.

I can't see any difference between what is there now and what was there.

Is there anyplace else i have to look?

Why would IIS want to resolve to the inetsrv folder?

thanks in advance

dmc_lat47

Windows Server 2008 r2 Enterprise

framework version 4.0

Problem binding an SSL Cert with SNI enabled to support multiple SSL certs on single IP on IIS 8.5

$
0
0

I'm having a strange issue with IIS8.5 on Windows 2012 Server  trying to select a wildcard SSL cert for site bindings with SNI flag enabled. Earlier I had a single SSL certificate to be selected for all bindings and hence I did not need to set SNI flag for bindings, but to support multiple SSL certs on a single IP, I had to make this change.

I am able to assign the SSL cert to binding if I do not set the SNI flag.

Interestingly, if I go into the IIS Administrator and perform the steps manually to create new bindings using similar configuration, the process works fine but get following error when I try to create the binding through code using C# program and Microsoft.Web.Administration library: 

 [code]A specified logon session does not exist. It may already have been terminated. (Exception from HRESULT: 0x80070520) [/code]

What wrong I might be doing here?

access to path denied

$
0
0

getting the error below.

is it as simple as giving right to the file only. and what account to I add to the NTFS?

thanks

Server Error in '/tool' Application. Access to the path 'C:\inetpub\qa.123.com\tool\Images\hart.png' is denied. 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.UnauthorizedAccessException: Access to the path 'C:\inetpub\qa.123.com\tool\Images\hart.png' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source File: C:\inetpub\qa.123.com\tool\hart.aspx  


IIS 10 sites hosted on port 80 are not working

$
0
0

Hi

Recently i upgraded my machine to windows 10 and IIS version is 10. So now when i am hosting any site on port 80 its not working.Its just displaying as 'This page can’t be displayed' on IE. But if i give any other port to the site then it opens site properly like http://localhost:1280 .etc.

I tried to check anything working on port 80 using netstat -a so found that PID 4 is using port 80 and PID 4 is displayed as 'System' in task manager processes. Can you please give me solution due to what it's not working or what i needs to do to solve this issue.

Thanks,

Ashvini

asp impersonate as authenicated user

$
0
0

hello

is there a way to set the impersonation to authenticated users? instead of hardcoding a username and password.

thanks

Redirect to internal pages in web.config

$
0
0

we have internal pages such as application, pricing, about-us, blog etc like:
https://www.site.com/application
https://www.site.com/pricing
https://www.site.com/blog

what I want is to set a 1 to 1 301 redirection in web.config of the pages without https in the URLs to the respective https version pages of the site.
For example: Set a 301 redirect for the page http://www.site.com/application to https://www.site.com/application

Right now it gets redirected from http://www.site.com/application to https://www.site.com

Server Error in '/' Application.

$
0
0

could it be related to backend oracle connection failing?

Server Error in '/' Application.


Runtime Error

Description:An exception occurred while processing your request. Additionally, another exception occurred while executing the custom error page for the first exception. The request has been terminated.

window eventviewer:

Log Name:      Application

Source:        ASP.NET 4.0.30319.0

Date:          6/30/2017 10:30:23 AM

Event ID:      1309

Task Category: Web Event

Level:         Warning

Keywords:      Classic

User:          N/A

Computer:      something here

Description:

Event code: 3005

Event message: An unhandled exception has occurred.

Event time: 6/30/2017 10:30:23 AM

Event time (UTC): 6/30/2017 2:30:23 PM

Event ID: 92d2a6d399304588a02855fbf0badbe4

Event sequence: 2

Event occurrence: 1

Event detail code: 0

Exception information:

    Exception type: HttpException

    Exception message: The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

   at System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)

   at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)

   at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)

   at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)

   at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)

 

The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.

   at Oracle.DataAccess.Client.OracleConnection..ctor()

   at .Global_asax.Application_Start(Object sender, EventArgs e)

Page can't be displayed error while browsing IIS hosted website

$
0
0

Hello Team,

I came across a weird issue. There is a website hosted on IIS 8.5. When I am trying to browse it from IIS, I am getting "page can't be displayed" error. But if I try accessing any page(placed inside the website), there is no issue. There are two ports (80,443) configured for the website.

For example, if I browse https://www.abc.com.au, it doesn't work and is giving "page can't be displayed" error. but if I browsehttps://www.abc.com.au/anypagename , it's redirecting to specific page.

I found below error from event viewer log and tried finding solution but no luck.

A process serving application pool 'XXXXXXXX' suffered a fatal communication error with the Windows Process Activation Service. The process id was 'xxxx'. The data field contains the error number.

Please advise on how to fix the issue.

Regards,

JS

httphandler 404

$
0
0

developed a httphandler on .net 4.5, workstation win10 pro

tested everything good

deployed to server, i believe the server iis is 8.5

getting error 404

they both running apppool with integrated mode

so the config is within <system.webServer>

i can c the httphandler mapping in the server iis

tried googled, putting in whatever additional attributes suggested, none working

anyone has good way to troubleshoot/fix?

Unexplained AppPool recycles

$
0
0

Since June 19 we are experiencing unexplained and undesired recycles of application pool worker processes.

The Application Pool has a scheduled 3am recycle. Bit since June 19th we are experiencing additional unexplained daily recycles between 5am and 5:30am. We are not yet able to find the cause or trigger. Not in the IIS Admin settings nor in the Event Logs nor in the Task Scheduler.

We luckily do have a call stack of the recycle, sent by email of IIS Admin:

Current StackTrace (max 30 frames deep):
	0.	ezWeb.Global_asax.Application_End()
	1.	System.RuntimeMethodHandle.InvokeMethod()
	2.	System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal()
	3.	System.Reflection.RuntimeMethodInfo.Invoke()
	4.	System.Reflection.MethodBase.Invoke()
	5.	System.Web.HttpApplication.InvokeMethodWithAssert()
	6.	System.Web.HttpApplication.ProcessSpecialRequest()
	7.	System.Web.HttpApplicationFactory.FireApplicationOnEnd()
	8.	System.Web.HttpApplicationFactory.Dispose()
	9.	System.Web.HttpRuntime.Dispose()
	10.	System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain()
	11.	System.Threading.ExecutionContext.RunInternal()
	12.	System.Threading.ExecutionContext.Run()
	13.	System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
	14.	System.Threading.ThreadPoolWorkQueue.Dispatch()

Where should we further search for the cause, the trigger of this recycle?

 


NET 4.5 on a Windows Server 2008 R2

$
0
0

I know that the .NET Framework 4.5 has been installed on my VPS running Windows Server 2008 R2 but how do I know it is enable or if the application pool where my website is running has this framework working ? The website is running fine up to the point of calling a 3rd party component requiring .NET Framework 4.5

Re: Unexplained Application end's or unloads

$
0
0

Hi nick

So could you provide the recycle configuration in application pool advanced setting? If there it is not  an abnormal recycle, there should have a log entry in event viewer system log .  Frist of all, just ensure you didn't set the recycle for specific time in IIS manager->application pool level->recycling->ensure the specific time checkbox is unchecked.

If there is no log entry for recycling, I assume you do have an idle time out configuration for IIS manager, then when application pool become inactivity between 5am and 5:30am, the application pool get recycled. You may need to check the IIS log, dump file, performance monitor for more information.

In addition, just ensure all the options under generate event recycle log entry has been selected to true in application pool advanced setting.

Best Regards,

Yuk Ding

Unexplained Application end's or unloads

$
0
0

Since June 19 we are experiencing unexplained and undesired recycles of application pool worker processes ends or unloads of Applications or Application Domains.

The Application Pool has a scheduled 3am recycle. Bit since June 19th we are experiencing additional unexplained dailyrecycles Application End's between 5am and 5:30am. We are not yet able to find the cause or trigger. Not in the IIS Admin settings nor in the Event Logs nor in the Task Scheduler.

We luckily do have a call stack of therecycle, sent by email of IIS Admin:

Current StackTrace (max 30 frames deep):
	0.	ezWeb.Global_asax.Application_End()
	1.	System.RuntimeMethodHandle.InvokeMethod()
	2.	System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal()
	3.	System.Reflection.RuntimeMethodInfo.Invoke()
	4.	System.Reflection.MethodBase.Invoke()
	5.	System.Web.HttpApplication.InvokeMethodWithAssert()
	6.	System.Web.HttpApplication.ProcessSpecialRequest()
	7.	System.Web.HttpApplicationFactory.FireApplicationOnEnd()
	8.	System.Web.HttpApplicationFactory.Dispose()
	9.	System.Web.HttpRuntime.Dispose()
	10.	System.Web.HttpRuntime.ReleaseResourcesAndUnloadAppDomain()
	11.	System.Threading.ExecutionContext.RunInternal()
	12.	System.Threading.ExecutionContext.Run()
	13.	System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
	14.	System.Threading.ThreadPoolWorkQueue.Dispatch()

Where should we further search for the cause, the trigger of this recycle?

 

STATE SERVER on 2012 Windows on VEGETATE STATE after working so far

$
0
0

Hello,

Two of our production servers running on windows 2012 Servers with framework 4.5.2 were unexpectedly quitted the service from today morning. We found below warning messages in Event Log. We are using State server for the session handling. All Servers have multiple web sites and many virtual directories beneath each of them. Majorities are configured to state server and all are doing well for quite SOME MONTHS. Restart of State server doesn’t yield any impact; but done multiple times. Restarts of IIS have little impact and served two or three requests before enter VEGETATE STATE.

Restart of entire server makes everything back to normalcy. But can trust it as same has been occurred on one of our server on 14th and 15th and we were forced to switch session to IN PROC.

Session in web.config is configured like this. State Server is in auto start mode. Any help is appreciated.

<sessionState cookieless="UseCookies" mode="StateServer" stateConnectionString="tcpip=loopback:42424" stateNetworkTimeout="60" timeout="120" />

=============================================================================================

Event code: 3009

Event message: Unable to make the session state request to the session state server. Details: last phase='Sending request to the state server', error code=0x80072749, size of outgoing data=0

Event time: 8/31/2016 8:41:11 AM

Event time (UTC): 8/31/2016 8:41:11 AM

Event ID: 01d70364db994082a59213a589666626

Event sequence: 266

Event occurrence: 133

Event detail code: 50016

 Application information:

    Application domain: /LM/W3SVC/6/ROOT/Main-2-131171051828682492

    Trust level: Full

    Application Virtual Path: /<Virtual Directory>

    Application Path: <Application Path>

    Machine name: <Machine Name>

 Process information:

    Process ID: 77988

    Process name: w3wp.exe

    Account name: IIS APPPOOL\<Application Pool Name>

 

Exception information:

    Exception type: HttpException

    Exception message: Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same.  If the server is on a remote machine, please ensure that it accepts remote requests by checking the value of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection.  If the server is on the local machine, and if the before mentioned registry value does not exist or is set to 0, then the state server connection string must use either 'localhost' or '127.0.0.1' as the server name.

 Request information:

    Request URL: <Page URL>

    Request path: <Actual Page>

    User host address: <Request IP>

    User: 

    Is authenticated: False

    Authentication Type: 

    Thread account name: IIS APPPOOL\<Application Pool Name>

 Thread information:

    Thread ID: 65

    Thread account name: IIS APPPOOL\<Application Pool Name>

    Is impersonating: False

    Stack trace:

PDF Rendering at a large size in IIS 8.5

$
0
0

I have a simple HTML file with one small image, (html embedded image). Windows App creates file with 23KB. Where as sample ASP.NET MVC application uses exact same code and creates PDF file of size 193KB. And PDF looks like image snapshot.

Background

WIndows 2012 server, IIS 8.5, Net framework 4.5, app. pool 4.5 - integrated. Using EXPERTPDF pdf converter. 

Any help is appreciated.

Shan

Viewing all 392 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>