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

Good patterns and practices about IIS

$
0
0

Hi mister,

any good patterns and practices about  IIS: WebSite, Applications, Virtual Directories, AppPool?

aspnet 4.7.1 and IIS (Windows Server 2012 R2)

Now, we have in a client 51 apps in Default Web site with the same DefaultAppPool.

Better all sites in Default Web site with the same DefaultAppPool?

Regards


How to setup - Email Approval for a business process application

$
0
0

Hello All,

I am preparing an application which is a request - approval system. Currently the application is on Internet. My task is to move the application to Company's Local VPN Network. Situation is when any approver receives email in Mobile Phone, he/she click on a link in the mail-body, it opens in Mobile's browser with the supplied URL path, and the approver clicks on Approve/Reject button to take his desired action instantly.

After moving the application to Company's VPN network, it will not be possible to open the Webpage in Mobile devices due to VPN restrictions, hence there is another technology required - Email Reply with desired action (Approve/Reject).

What I can do is - can make 2 links with mailto:  (to set the predefined To, Subject, Body) for Approve or Reject in mail body.

Please Note: We have Lotus Notes as mail platform, and using its SMTP service to relay emails to users.

But I am new to this technology hence after 2-3 days of my searching on google I could not find the satisfactory solution to setup incoming email in IIS and next step would be trigger function when any new mail is there.

Please support me...

Error 500.19 web config

$
0
0

We are trying to move a web app from a Windows 2008 server to a Windows 2016 server and we are getting the following error when trying to run the app.  The error appears to be happening on the web.config file in the root of the app. What do I need to do to fix this?

This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false". 

404 when trying to access aspx on IIs

$
0
0

Signed up for the free tier on Amazon webservices. Installed an EC2 Instance using window server 2016. Enabled IIs. 

Static pages work fine but for some reason when I try to access aspx pages I get a 404.

Remote IIS administration error 80070005

$
0
0

Hi guys!

I have some problems with our deployment tool, that failed with error as below

Retrieving the COM class factory for remote component with CLSID {2B72133B-3F5B-4602-8952-803546CE3344} from machine cf-front failed due to the following error: 80070005 cf-front.

Tool represents a console application that doing requests using Microsoft.Web.Administration assembly to IIS server and getting pools and sites that exist in IIS.

Deployment tool placed in one PC and IIS server in another.

When it works

When we launch deployment tool obviously(double click to exe file using Windows UI interface)

When it does not work

When we launch tool under build agent (important: using the same account when we launch using UI)

What happened? I am working under problem all previous week and did not decide it

I tried many advices most part of them exist here

http://www.computerperformance.co.uk/Logon/code/code_80070005.htm

Launching happened with this PS script(Power shell installed on all PCs)

$session=New-PSSession-ComputerNameout-oracle

$exitCode=0;

Write-Output"RunOnlyUITests:"$Env:RunOnlyUITests

#$runOnlyUITests = ""

#if($Env:RunOnlyUITests -eq $true)

#{

# $runOnlyUITests = "-t True"

#}

$runOnlyUITests="-t False"

$exitCode=Invoke-Command-Session$session-ScriptBlock {

$process=Start-Process-FilePath$args[0]-WorkingDirectory$args[1]-ArgumentList"-o True$runOnlyUITests -h$buildVersion"-PassThru;

$process.WaitForExit() ;

$process.ExitCode;

} -ArgumentList$deployerPath,$finalPath

Please help;)

IIS Application Initialization after site restart

$
0
0

Hello,

We are developing a web API (owin/.NET 4.5.2) with job scheduler (Quartz.NET) functionality which need to run always without recycling and needs to boot up from the early beginning. So we configured our IIS 8 app and app pool to use application initialization (preload data, AlwaysRunning, idle time 0).

Application initialization just works fine when we start/stop/restart the application pool. If we only start/stop/restart our IIS site, the application initialization is not working. The first request will execute the logic.

Why does IIS does not trigger the application initialization after site restart and how can we achieve that goal?

thx

"HTTP Error 404.17 - Not Found" when I try to open a .aspx file

$
0
0

Good morning, I have a problem when I try to display into a browser a web-application, developed in .aspx and .aspx.vb format (through the Visual Studio 2017 environment). I distributed the app itself on a Windows 2012 R2 server, in which I uploaded both the ASPX 2.0 and 4.5 frameworks and the IIS.

In the IIS, through the Server Manager, I connected the app to the website on which I want to view it. The problem, however, is that when I type the address of the site and the name of the .aspx file on the browser, I read the following words: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable".

"Locally", when the web-app is located on the C and/or D disks (inside the server), if I try to open the website I found this problem: "HTTP Error 404.17 - Not Found. 

Most likely causes:

The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.

Things you can try:

If you want to serve this content as a static file, add an explicit MIME map."

How can I solve, and so to see the page I want to visit?? Thank you in advance.

asp.net LDAP query NOT Running as Logged on User with Impersonation and Windows Auth

$
0
0

Hi,

I'm really hoping that someone can help me with this as it's driving me crazy. I have a .net 4.5 "asp.net Web Application" which uses Windows Authentication and Impersonation and allows search for a computers extended attributes in an LDAP query when specifying the computer name.

It works fine in IIS Express/debug but not when loaded into IIS 7.5 on Sever 2008 R2. I do not see an error but the attribute I require is not returned from the LDAP query. If I grant the servers SYSTEM account (servername$) full control of the Computer object in active directory it works so I know it is because the LDAP query is using this account and not the windows identity as (I believe) it should.

I have also proven this outside of ISS by running the same query using DSQuery on a command line impersonating the server's local system account using PSEXEC and the results are the same.

The web.config has...

<identity impersonate="true" />
<authentication mode="Windows" />
<authorization>
<deny users="?"/>
<allow users="*" />
</authorization>

...and the application pool is set to...

.net Framework: v4.0
Managed Pipleine: Classic
Identity: ApplicationPoolIdentity

I have also added some code the the page to retrieve the running user context information from lots of properties and the following all return the logged on user identity (Domain\Username)...

Context.User.Identity.Name
System.Security.Principal.WindowsIdentity.GetCurrent().Name
System.Threading.Thread.CurrentPrincipal.Identity.Name
Page.User.Identity.Name
System.Web.HttpContext.Current.User.Identity.Name

I'd really appreciate any help or advice anyone can give. I just can't seem to get the impersonation running all the way through the app.

Thanks in advance,

Shaun


ASP high compilation

$
0
0

Hello all,

I've IIS 7.5 hosting ASP.NET site, we're monitoring them with Zabbix template. We're looking to IIS current connections per site and also number of ASP.NET requests.

I'm normal way, ASP request are near to 0, but happen that ASP.NET request increase when traffic is higher and at then number ot requet are so high that web site is unavailable and we have an 503 error.

I don't know how to find clue on the reason of this high value. In term of server, CPU, RAM etc are still good, only ASP.NET requests are high.

Any idea how to monitor it, or to see what's wrong in code maybe ? 

Tks in advance.

How to use web.administration module to get the current request?

$
0
0

Hi,

I would like to use web.administration module to develop a web app to get the current connection in IIS worker process. But I have no idea about how to acheive this. Could you provide any hint for this requirement? Thanks in advance.

general help about hosting asp.net web app

$
0
0

Hello guys, ive been developing asp.net web apps for a while. Typically, for hosting i use azure or some other hosting provider. Recently i got interested in hosting my apps on my windows server 2016 machine. Now, the problem is that ive never used windows server before so i am kinda lost. 

can u help me configure windows server so i can host my web apps on local network. And i would like to be able to deploy web app from visual studio on my dev machine to server machine (both on local network). Also my web app need database.

thanks

ASP.Net (C#), File Download fails on slow network

$
0
0

I have classic Asp.Net(c#) application for file download. I have tested the file download functionality upto 2GB (Giga bytes). Everything works fine on Intranet and on high speed internet connection. But when tested on slow network (low bandwidth) this functionality fails with "Network Failure" error. Sometimes it is observed that upto 90% of file content gets downloaded and then I get an error. I am currently simulating this using Google chrome Network bandwidth throttling feature (F12 -->Network -->Online Dropdown -->Slow 3G).

I need help on following

  1. Any code changes(api/method...) suggestion
  2. Any IIS settings we have missed
  3. Any web.config/Machine.config setting we have missed

We tried executionTimeOut, WebLimits settings in IIS & Application host configurations.

Code is similar as shown below

Response.Clear();
Response.Buffer = false;
Response.AddHeader("Accept-Ranges", "bytes");
Response.AppendHeader("ETag", "\"" + _EncodedData + "\"");
Response.AppendHeader("Last-Modified", lastUpdateTiemStamp);
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName.Name);
Response.AddHeader("Content-Length", (FileName.Length - startBytes).ToString());
Response.AddHeader("Connection", "Keep-Alive");
Response.ContentEncoding = Encoding.UTF8;

_BinaryReader.BaseStream.Seek(startBytes, SeekOrigin.Begin);

//Dividing the data in 1024 bytes package
int maxCount = (int)Math.Ceiling((FileName.Length - startBytes + 0.0) / 1024);

//Download in block of 1024 bytes
int i;
for (i = 0; i < maxCount && Response.IsClientConnected; i++)
{
    Response.BinaryWrite(_BinaryReader.ReadBytes(1024));
    Response.Flush();
}

Appreciate any help in solving this low bandwidth, file download issue.

Thanks in advance.

ASP.Net app able to connect to remote web service from command line but not when running under IIS

$
0
0

I have a asp.net project that gets input from a form and connects to a remote web service to get some information. 

On my development machine, this works fine, but on a somewhat locked down server the login to the web service fails because no response is received. 

I've gone to the lengths of writing a powershell to do the connection and get the info. That works fine when run from PowerShell on the server, but the exact same powershell fails to connect if called from the Asp.net program running under IIS. (being powershell I can write lots of debugging to a file, and it's clear that the step that fails is only the connection). 

So it's not a proxy or firewall issue one would think.  Any ideas much appreciated. 

Can't navigate to site using www

$
0
0

I have a site bound to www.phanetworktest.com. In my IIS configuration I have this binding as well as another (phanetwork46.phanetwork.net).

When I try to browse the site through IIS Admin using www.phanetworktest.com it first tries to redirect to https://www.phanetworktest.com and gives me a warning about a non-secure site (and it isn't secure). If I click the continue anyway link I get a 404 error.

However, If I browse http://phanetwork46.phanetwork.net the website comes up. This is all being tested internally on the server through the IIS Admin console. The same error occurs if I try to access the url remotely.

On the internal server, I have a local DNS setting pointing it to the IP address of the machine. I would think for testing, this should work. I also have a pointer set to phanetwork46.phanetwork.net in the same manner, and this works.

I'm scratching my head trying to figure out what may be happening here. First, I'm not sure why it tries to redirect to https and secondly, I can't figure out why I get the 404 error.

Any help would be greatly appreciated!

How do I determine whether ASP.NET 3.5 is installed on Windows Server 2008 r2

$
0
0

I am unable to find a straightforward answer on the web as to how to check what (if any) version of ASP.NET is installed on my Windows Server 2008 r2. There seems to be plenty of ways to ascertain which .NET Framework is installed, but nothing for ASP.NET 3.5.

Reed, from https://social.msdn.microsoft.com/Forums/vstudio/en-US/5a566002-a24e-44e3-ba0b-15af39963c2b/how-do-i-determine-whether-aspnet-35-is-installed-on-windows-server-2008-r2?forum=vbgeneral#5a566002-a24e-44e3-ba0b-15af39963c2b suggested that because ASP.NET 3.5 is not listed under my Application Pools (columns are Name, Status, .NET Framework Version, Managed Pipeline Mode, Identity, Applications) it is not installed. Is this a true idea?

Any help with this would be much appreciated.

Kind regards, Jon


The configuration section 'system.web.extensions' cannot be read because it is missing a section declaration

$
0
0

My system: I have installed Windows 7, VS2010 and .NET40 and ASPAJAXExtSetup.msi

I used to work with vs2008 and .NET3.5, after installing VS2010 I upgraded to .NET40. I dont think that is the issue here, but it might be something you need to know :)

My problem seems to arise from something within IIS, but I have no idea.

I'm getting the error below.

<div> Error Summary

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

</div> <div> Detailed Error Information <div id="details-left">
ModuleIIS Web Core
NotificationUnknown
HandlerNot yet determined
Error Code0x80070032
Config ErrorThe configuration section 'system.web.extensions' cannot be read because it is missing a section declaration
Config File\\?\C:\inetpub\tickets\web.config
</div> <div id="details-right">
Requested URLhttp://www.tickets.com:80/
Physical Path
Logon MethodNot yet determined
Logon UserNot yet determined
</div> </div> <div> Config Source
   45: 	</connectionStrings>
46: <system.web.extensions>
47: <scripting>
</div>

My web.config:


<?xml version="1.0"?>
<configuration>
    <connectionStrings>        
    </connectionStrings>
    <system.web.extensions>
        <scripting>
            <webServices>
                <!--http://weblogs.asp.net/andrewfrederick/archive/2008/02/18/a-client-side-ajax-login-for-asp-net.aspx-->
                <authenticationService enabled="true" requireSSL="false"/>
            </webServices>
        </scripting>
    </system.web.extensions>
    <system.web>
        <httpHandlers>
            <add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        </httpHandlers>
        <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
            <assemblies>
                <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
            <namespaces>
                <clear/>
                <add namespace="System"/>
                <add namespace="System.Collections"/>
                <add namespace="System.Collections.Specialized"/>
                <add namespace="System.Configuration"/>
                <add namespace="System.Text"/>
                <add namespace="System.Text.RegularExpressions"/>
                <add namespace="System.Web"/>
                <add namespace="System.Web.Caching"/>
                <add namespace="System.Web.SessionState"/>
                <add namespace="System.Web.Security"/>
                <add namespace="System.Web.Profile"/>
                <add namespace="System.Web.UI"/>
                <add namespace="System.Web.UI.WebControls"/>
                <add namespace="System.Web.UI.WebControls.WebParts"/>
                <add namespace="System.Web.UI.HtmlControls"/>
            </namespaces>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            </controls>
        </pages>
        <sessionState mode="InProc" timeout="60"/>
        <authentication mode="Forms">
            <forms name=".MyCookie" slidingExpiration="true" timeout="60" cookieless="AutoDetect" loginUrl="/login/" protection="All" defaultUrl="/">
                <credentials passwordFormat="SHA1"/>
            </forms>
        </authentication>
        <customErrors mode="Off" defaultRedirect="/contact.aspx">
            <error statusCode="404" redirect="/contact.aspx"/>
        </customErrors>
        <roleManager domain="192.168.0.103" enabled="true" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="60" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" defaultProvider="AccessRoleProvider" createPersistentCookie="false" maxCachedResults="25">
            <providers>
                <clear/>
                <add name="AccessRoleProvider" connectionStringName="conn1" applicationName="/tickets" type="Samples.AccessProviders.AccessRoleProvider"/>
            </providers>
        </roleManager>
        <membership defaultProvider="AccessMembershipProvider" userIsOnlineTimeWindow="30">
            <providers>
                <clear/>
                <add name="AccessMembershipProvider" type="Samples.AccessProviders.AccessMembershipProvider" connectionStringName="conn1" requiresQuestionAndAnswer="false" applicationName="/tickets" minRequiredPasswordLength="6" enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="true" minRequiredNonalphanumericCharacters="0" passwordFormat="Hashed"/>
            </providers>
        </membership>
    </system.web>

    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
        </modules>
        <handlers>
            <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </handlers>
        <rewrite>
            <rules>
                <rule name="ordermanagement">
                    <match url="^eventmanager/ordermanagement/([0-9]+)"/>
                    <action type="Rewrite" url="ordermanagement.aspx?eventid={R:1}"/>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

 

I then checked out this page: http://mvolo.com/blogs/serverside/archive/2007/12/08/IIS-7.0-Breaking-Changes-ASP.NET-2.0-applications-Integrated-mode.aspx

And now Im trying this:
%windir%\system32\inetsrv\Appcmd migrate config "c:\inetpub\tickets"

But I get the error:
ERROR ( message:Cannot find APP object with identifier "c:\inetpub\tickets"". )
I also tried:
%windir%\system32\inetsrv\Appcmd migrate config "tickets"

But still no luck..
What am I doing wrong?

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:

Why switch between HTTPS to HTTP and vice versa

$
0
0

I have my asp.net website hosted on public cloud. We have recently procured a certificate to secure communication between our clients and website. Currently I am reading forums where developers switch between HTTPS to HTTP. Eg..,

https://www.codeproject.com/articles/5523/switching-between-http-and-https-automatically

https://www.codeproject.com/articles/60706/switching-between-http-and-https-like-a-bigshot-ho

http://technicalsol.blogspot.com/2009/04/switching-between-http-to-https.html

I am new to installing certificates and HTTPS I would like to understand why we need to switch between HTTPS to HTTP redirection when the request cross IIS server.

Thank you

Saravanakumar

Having additional web server in DMZ - ASP.net

$
0
0

Hi,

We have an ASP.net 3.5 web forms based web application. So far we had this application on an App server facing internet. Our security team is asking us to have one additional Web server in DMZ and put this application server behind the DMZ. I had few queries.

a. If we have a web server forward request to our application, can the session state management work. We have our inproc session management.

b. Will there be any performance impact? Are there any precautions that we need to take care of?

Web.Config file issue.

$
0
0

I have setup IIS on a Windows 2016 standard server. Installed Web Services along with ASP, ASP.Net. I can view asp, aspx, html, htm pages with no problem. I even put a small function in the asp and aspx files and they work. As soon as I place a web.config file into the root of the website I can no longer view any pages. I get a 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

I am not doing anything complex. I am just trying to get it to work.

Also, I have nothing in the web.config file. It is just blank.

Any ideas?

Viewing all 589 articles
Browse latest View live


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