Continuing from my previous post on common causes for memory leaks, remote debugging is another ASP.NET feature that has the potentiality to either delight (uhm… am I exaggerating here…? đ) a web developer or drive him completely crazy đ I remember 8-9 years ago, when I was a young technology passionate learning the basics of web development (HTML, CSS, ASP etc…), on my desk I just had a couple of programming books for beginners, my dial-up modem to download some online manuals and my copy of Office 97 for students. My editors at that time were FrontPage 97 and Notepad… so all I could do to debug my web pages were to use lots of Response.Write() to inspect variable values, and lot of brain work to try to understand where things were going wrong… With ASP.NET and Visual Studio .NET in these days developers still have to do lot of brain work, but for sure the tools now help a lot with debugging web applications… but what happens if the debugger has tantrums? đ˛ Here is a list of the common debugger problems I saw so far in my experience with Microsoft Support; this is not at all a comprehensive…
-
-
Quick things to check if you are leaking your memory
After a couple of years working in InternetDev support I’ve seen many different kind of problems reported by customers (different environments, different use of Microsoft technologies and products combined together, different application needs, different customer’s background and technical knowledge etc…), but as one of my favorite authors said, Sometimes they come back, so it happens that sometimes we also get incoming calls for well known problems like memory leaks, high CPU and worker process crashes. Of course there could be many different causes for those problems, but some of them are more likely to affect your application; here is a list of the first things I check when I’m working on a memory leak problem (usually analyzing a memory dump of the faulting application). This is not a complete list (but I promise to update the post if I’ll find something new and interesting) and if you talk to other Support Engineers they might give you a slightly different view on the subject, this is what I found and learnt in my day to day support experience. Application deployed in debug mode This is something we must avoid in a production environment; debug mode is useful during development, but in…
-
ASP.NET Membership Provider with custom schema
PROBLEM DESCRIPTION===================Asp.net Membership control issue: when I create users and roles by wizard the default database is sql server express and the file is aspnet.mdf, but in my case I have my own database which store the users detail. I want to use the membership control functionality but don’t want to deal with 2 databases; also, I want to add my table to the default database thus changing the schema.I expect the Asp.net Membership provider to support that change and want to know what should I change in the application code SUMMARY of TROUBLESHOOTING==========================âHow to: Use membership in ASP.NET 2.0â at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000022.asp, in particular the section âUsing the SQLMemberShipProviderâ; basically you need to configure Forms authentication, install the membership database and configure the SqlMembershipProvider. Step 2. Install the Membership DatabaseBefore you can use the SqlMembershipProvider, you must install the SQL Server membership database.To install the membership database, log on to your server with an account that has authority to administrate SQL Server (such as the Administrator account). Open the Visual Studio 2005 command prompt, and run the following command: aspnet_regsql.exe -E -S localhost -A m Where: -E indicates authenticate using the Windows credentials of the currently logged on user-S (server) indicates…
-
Unable to get the private bytes memory limit for the w3wp process
PROBLEM DESCRIPTION =================== I can run ASP.NET applications on the server, however I have noticed that when I do there is an asp error entry in the event log: "Unable to get the private bytes memory limit for the W3WP process. The ASP.NET cache will be unable to limit its memory use, which may lead to a process restart. Error 0x80070005". ENVIRONMENT =========== – Windows Server 2003 – .NET Framework 1.1 SUMMARY of TROUBLESHOOTING ========================== This error is caused by a known issue with insufficient permissions in your IIS metabase. The metabase ACL’s on the target server did not include the IIS_WPG group on the following two nodes of the metabase (IIS_WPG is in both ACL’s on a clean install): – W3SVC/AppPools – W3SVC/Filters You can download the MetaACL utility from http://support.microsoft.com/?id=267904. After you have installed the program, open a command prompt and navigate to the directory where you installed it. Then type the following: – cscript metaacl.vbs IIS://Localhost/W3SVC/AppPools IIS_WPG RE – cscript metaacl.vbs IIS://Localhost/W3SVC/Filters IIS_WPG RE Warning: The path is case sensitive – type exactly as above; after you run this command restart the IIS services and see if this corrects the problem. Update: here is…
-
Automatic proxy configuration in .NET Framework 2.0
PROBLEM DESCRIPTION =================== The outcome of the execution of PAC file seems to change when called from IE or from a .Net 2.0 client. The internal URL we want to call is http://webapps.custname.com and the IP address of the web apps server is 141.122.180.192. For example, here is a sample PAC file function FindProxyForURL(url, host) { if (isInNet(host, "141.122.0.0", "255.255.0.0")) { return "DIRECT" } else { return "PROXY 169.12.232.25:8080" } } When called from IE, the internal url http://webapps.custname.com is directly connected to the web server without using a proxy. So the PAC file returns âDIRECTâ. When called from a .Net 2.0 application, the same url (http://webapps.custname.com) is redirected to the internal proxy 169.12.232.25:8080. If he uses the IP address of the web Server ( http://141.122.180.192 ), the isInNet function seems to work as the request is not redirected to the proxy anymore. I used the code below to test the differences between .Net 1.1, .Net 2.0 and IE (taken from http://msdn.microsoft.com/msdnmag/issues/05/08/AutomaticProxyDetection/default.aspx ). using System; using System.Net; public class Test { public static void Main(string[] args) { IWebProxy iwp11 = GlobalProxySelection.Select; Console.WriteLine(iwp11.GetProxy(new Uri(args[0])).ToString()); //comment the following 2 lines when compiling on 1.1 IWebProxy iwp20 = WebRequest.DefaultWebProxy; Console.WriteLine(iwp20.GetProxy(new Uri(args[0])).ToString()); } …
-
Content Management Server and proxy detection
PROBLEM DESCRIPTION===================You are using Site Manager from MCMS 2002.Site Manager is partly build on C# and is using the HttpWebRequest class in .NET framework to connect to the MCMS server.In the customers environment SiteManager wrongly tries to connect through a proxy server rather than directly connecting to the MCMS server. SUMMARY of TROUBLESHOOTING==========================Using a configuration file to instruct your application to use the right parameters:. Set the GlobalProxySelection option in the application config file (NRClient.exe.config) and copy the file into âC:\Program Files\Microsoft Content Management Server\Clientâ (see below for file content) <configuration> <system.net> <defaultProxy> <proxy proxyaddress = “http://proxyaddress:port” bypassonlocal = “true” /> </defaultProxy> </system.net></configuration> CheersCarlo
-
Missing ASP.NET Tab in IIS Management Console
PROBLEM DESCRIPTION =================== On a Windows 2003 64bit machine with both .NET Framework 1.1 and 2.0 installed, you are tying to configure a website on IIS, but you are unable to find the tab to specify ASP.NET settings. SUMMARY of TROUBLESHOOTING ========================== Researched turned out this being a bug that is closed as "won’t fix". If you are gong to run IIS 32-bits on WOW64, MMC Support for ASP.Net snap-in is currently not allowed. We are in the process of writing a KB article to document this. In general the ASP.net tab is giving you the UI to configure the application to run different versions. You could use the specific version of aspnet_regiis.exe utility to configure this. The utility is aspnet_regiis -i under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727, if you want your application to run under 2.0. There are several command switches to configure specific sites or directory only. If you see these problems on 32-bit OS there’s a known workaround: Manually run the install for ASP.NET: ASPNET_regiis -i Register the dll for the MMC: regsvr32.exe "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mmcaspext.dll" "rundll32.exe" "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\webengine.dll",RegisterAspNetMMC From a command prompt run: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm.exe C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\AspNetMmcExt.dll /tlb:AspNetMMCExt.tlb Change the About value in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MMC\SnapIns\{fedb2179-2335-48f1-aa28-5cda35a2 b36d}" from {7D23CCC6-A390-406F-AB67-2F8B7558F6F7} to {7D23CCC6-A390-406F-AB67-2F8B7558F6F6} UPDATE (5th November, 2006) Just…
-
Http compression and WinForm controls as legacy ActiveX
The following is the summary of a couple of cases I worked on a while ago, there are some details which I’ll need to investigate thoroughly… anyway those are the facts so far. PROBLEM DESCRIPTION===================I have a rich WinForms UserControl which is embedded into a web page. Since installing .NET 2.0 on the clients, the control stopped loading completely. – I disabled security completely using caspol -s off => no effect – I enabled fusion logging => no single entry generated – I enabled the IEHost log => nothing created – Changed to another client machine => same issues, same results – I started writing a new UserControl from scratch and deployed it to the same server. The control could also not be loaded. I deployed the same test project to another 2003 server in the same domain, with equal patch levels (SP1 and latest patches installed) and it worked. Perhaps a naming issue? – I tried to change the names => no result – I compared the HTTP requests to the different server => nothing special – The issues stated above are reproducible from any client, such it should be a server or framework issue. – I even have…
-
Watch your symbols!
This morning I had an open discussion with a customer regarding symbols and their importance in our job (our intended also as a developer, not just as a support specialist). This customer sent in a dump for a memory leak problem he has in his web site (ASP.NET with COM components, calls to Web Services etc…). I have to admit that a few times in the past I went through a dump without any symbols for the application (luckily I always have access to both internal and external symbol server for the OS, .NET Framework etc…), and even sometimes I’ve been able to find the cause of the problem anyway (sometimes it’s quite obvious, it you have memory fragmentation, debug=”true” in web.config, too many dynamic assemblies caused by XML/XSLT stuff etc…), but there are occasions where the call stack is completely messy and the real problem quite hard to discover. Also more important is to have matching symbols: debugging with non-matching symbols could be much worse than debugging without symbols at all, and the analysis could take a completely wrong direction, wasting time and efforts without helping sorting out the problem… and you’ll get a bad support experience when you’ll call us to ask…