VS 2010 Low Virtual Memory Fix – Insufficient available memory

26. May 2010

 

Man VS 2010 is a memory hog.  Well heck even 2k8 was too, but at least it always let me copy/paste.

After awhile I lose the ability to copy text from my code. With a warning saying “Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later.”

image

Found this post to increase the Virtual Memory: http://msdn.microsoft.com/en-us/library/ff407021(v=VS.100).aspx

However, they have a typo in the command.

If you run their command: bcdedit /set IncreateUserVa 3072 it fails with a “The element data type specified is not recognized, or does not apply to the specified entry.” error.

Run the proper command: bcdedit /set IncreaseUserVa 3072 and you get “The operation completed successfully.

I don’t this will remove the error, just give me more time before it happens.  Supposedly, 64bit doesn't have this problem.

Troubleshooting, Visual Studio

HTTP Error 404.17

3. May 2010

HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.

One Possible Solution:

%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe -i

Troubleshooting, IIS And Hosting, WCF

Windows 7 Genuine Validation Fails on Genuine Install

15. April 2010

 

I was having problems trying to download XPMode because the website tries to validate your Windows 7 operation system.  Even though I activated successfully and I ran the MGA Diagnostic Tool locally and it said Genuine. It still failed the online check.

image

I even called Microsoft to see if they could figure it out. No luck. They tried the obvious stuff, re-entering my product key, re-activating.  They couldn’t figure it out. Even gave me a new product key and still no luck.  Then I told them I had to go.

Found the answer on my own..

I was getting Event Errors in my Application Log.

Source: CAPI2
Event ID: 257

The Cryptographic Services service failed to initialize the Catalog Database. The ESENT error was: -1011.

Then I caught online something on bypassing XP Genuine has to do with the Cryptographic services. Putting two and two together, I figured this error was the source of my problem.

After a little digging I found this article which gave me steps to wipe out my System Catalog Database. 

This fixed my error and allowed me to validate my windows online.

  1. Click Start, point to Administrative Tools, and then click Services.
  2. Right-click Cryptographic Services, and then click Stop.
  3. Click Start, and then click Computer.
  4. Navigate to %systemroot%\System32.

    By default, %systemroot% is located at C:\Windows.

  5. Rename the catroot2 folder to catroot2.old.
  6. In the Services snap-in console, right-click Cryptographic Services, and then click Start.

Operating Systems, Troubleshooting , ,

Silverlight & WCF Debugging and using Fiddler!

12. April 2010

 

Fiddler2 Best program out there I think for debugging WCF errors in silverlight when you get “NotFound” error messages.

 

Example. I had a Silverlight application where I had to enable it work over https and change the host headers. As many of you may know, WCF on .NET 3.5 you can not bind to website with multiple headers. You have to hardcode the WCF Address in the web.config. (I’ve read that .Net 4.0 will allow this but still not for ssl).

All my setting from what I can tell in my web.config and my clientConfig were correct, and the app worked fine in http mode only, however I would get the most generic message ever.

image

This is my custom error window I use to have users send the errors to the server.  As you can see the error is “The remote server returned an error: NotFound.”  this is basically the equivalent of the old server error message “An Unexpected Error Occurred”.  Basically who knows. Something’s wrong.  The WCF service is not responding. Could be your firewall, your IIS, your service is erroring out or 100 other things. 

Download and install Fiddler2 and let the magic begin.  I did try WebDevHelper which is like FireBug for FireFox but it works in IE.  It’s pretty good, but like FireBug, doesn’t give you that WCF error.

Loading up Fiddler, I can inspect the traffic and actually see the .Net error. It even highlights it in red for me.  (Had to block out the app names).

image

From this I was able to expand the information like below to see the real error message.

image

Cannot be process at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher.  Check that the sender and receiver’s EndPointAddresses agree

After I realized what the problem was I was able to fix my service by adding the attribute AddressFilterMode:=AddressFilterMode.Any to my WCF class.

<ServiceContract(Namespace:="")> _
<ServiceBehavior(IncludeExceptionDetailInFaults:=True, AddressFilterMode:=AddressFilterMode.Any)> _
<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
Public Class xxxxxxxxxxxService

 

Problem Solved.

 

WCF logging:

You can also log all your WCF Traffic to a Log file on your server.

  <system.diagnostics>
      <sharedListeners>
          <add name="WcfListener"
                  type="System.Diagnostics.XmlWriterTraceListener"
                    initializeData="C:\logs\wcfLog.svclog"/>
      </sharedListeners>
      <sources>
          <!-- switchValue attribute has no impact on MessageLogging -->
          <source name="System.ServiceModel.MessageLogging">
              <listeners>
                  <add name="WcfListener" />
              </listeners>
          </source>
          <source name="System.ServiceModel"
                        switchValue="Warning, ActivityTracing"
                        propagateActivity="true" >
              <listeners>
                  <add name="WcfListener" />
              </listeners>
          </source>
      </sources>
  </system.diagnostics>

 

<system.serviceModel>
    <diagnostics>
        <messageLogging
             logEntireMessage="true"
             logMalformedMessages="false"
             logMessagesAtServiceLevel="true"
             logMessagesAtTransportLevel="false"
             maxMessagesToLog="3000"
             maxSizeOfMessageToLog="2000"/>
    </diagnostics>
</system.serviceModel>

 

Other useful posts..

Silverlight and WCF – WCF Logs and Debugging

Service Trace Viewer Tool (SvcTraceViewer.exe)

Silverlight & WCF - HTTPS

WCF, SilverLight, Troubleshooting , , , ,

IIS7 Windows7/Server2008 ApplicationPoolIdentity Security Change from Network Service

31. March 2010

 

Yeah this one got me.. http://learn.iis.net/page.aspx/624/application-pool-identities/

The change microsoft made to have AppPool now run as “ApplicationPoolIdentity” instead of Network service.

So if you normally give Network Service rights needed to your webapp, you now have to stop doing that and change it to

IIS AppPool\DefaultAppPool

Or

IIS AppPool\<NAME OF YOUR APPPOOL>

End of that.

 

 

 

 

  1. Open Windows Explorer
  2. Select a file or directory.
  3. Right click the file and select "Properties"
  4. Select the "Security" tab
  5. Click the "Edit" and then "Add" button
  6. Click the "Locations" button and make sure you select your machine.
  7. Enter "IIS AppPool\DefaultAppPool" in the "Enter the object names to select:" text box.
  8. Click the "Check Names" button and click "OK".

By doing this the file or directory you selected will now also allow the "DefaultAppPool" identity access.

IIS And Hosting, Troubleshooting, ASP.NET, .Net Framework, Operating Systems , ,

EventID 4625 on Windows 2008 IIS7 Windows Authentication Error

22. March 2010

I was having wierd authentication issues on a Windows 2008 server with IIS7. I was trying to use Windows Authentication.  Worked fine from a remote location but failed when local on the server.

An account failed to log on.

Subject:
    Security ID:        NULL SID
    Account Name:        -
    Account Domain:        -
    Logon ID:        0x0

Logon Type:            3

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:        xxxxxx
    Account Domain:        xxxxxx

Failure Information:
    Failure Reason:        An Error occured during Logon.
    Status:            0xc000006d
    Sub Status:        0x0

Process Information:
    Caller Process ID:    0x0
    Caller Process Name:    -

Network Information:
    Workstation Name:    xxxx-xxxxxx
    Source Network Address:    ###.###.###.###
    Source Port:        49597

Detailed Authentication Information:
    Logon Process:       
    Authentication Package:    NTLM
    Transited Services:    -
    Package Name (NTLM only):    -
    Key Length:        0

This event is generated when a logon request fails. It is generated on the computer where access was attempted.

The Subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.

The Logon Type field indicates the kind of logon that was requested. The most common types are 2 (interactive) and 3 (network).

The Process Information fields indicate which account and process on the system requested the logon.

The Network Information fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.

The authentication information fields provide detailed information about this specific logon request.
    - Transited services indicate which intermediate services have participated in this logon request.
    - Package name indicates which sub-protocol was used among the NTLM protocols.
    - Key length indicates the length of the generated session key. This will be 0 if no session key was requested

I found the solution on the MS Support site, Q89681.  Which suggested to turn off the LoopbackCheck.

To set the DisableLoopbackCheck registry key yourself, follow these steps:

  1. Set the DisableStrictNameChecking registry entry to 1. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base:

    281308 Connecting to SMB share on a Windows 2000-based computer or a Windows Server 2003-based computer may not work with an alias name

  2. Click Start, click Run, type regedit, and then click OK.
  3. In Registry Editor, locate and then click the following registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

  4. Right-click Lsa, point to New, and then click DWORD Value.
  5. Type DisableLoopbackCheck, and then press ENTER.
  6. Right-click DisableLoopbackCheck, and then click Modify.
  7. In the Value data box, type 1, and then click OK.
  8. Quit Registry Editor, and then restart your computer.

IIS And Hosting, Troubleshooting, Operating Systems

Microsoft Test And Lab Management with Test Runner and Visual Studio 2010 CodedUI Testing UI

8. December 2009

Ok who at Microsoft can I go hug and bow down too for creating Test and Lab and Test Runner and the CodedUI Recorder script generator.  Client of mine wanted to do more automated and better testing of their web apps. I knew VS 2010 had new testing tools but didn’t know to what extent. So I did some quick research and installed it on my own and tried it out against a business application I develop.  Wow.

I still have a lot to learn on it’s use but in 5min I created a script that I could automate and test the UI functionality of the business web app.

Applications to look at:

  • Visual Studio 2010
  • Microsoft Test and Lab Management 2010 (Yes this only works with Team Foundation Server 2010. If you have TFS 2008, you’re out of luck.
  • Microsoft Test Runner 2010 (Comes as part of Test and Lab I believe)

Some quick overview features

  1. You can record your testing and play it back later to automate it
  2. It’s designed for non-developers but not end-users, for someone in QA
  3. With this tool you can have “Shared” scripts, so say you create 100 scripts and we change the login functionality. You would only need to edit that one shared script and all the other 100 are changed.
  4. Manual Testing can be turned into automated testing
  5. You can setup test environments for local, QA and Prod
  6. You can do full screen capture when manual testing and it will create Bug item in Team Foundation System with your screen shots and all the steps you performed and what data was used when you were developing.
  7. You can use datasource for username’s and passwords and addresses to test with etc.
  8. You can perform Coded UI Automated Scripts without coding anything, a recorder records and generates it for you.

You can view the Test and Lab Management Video here, skip ahead to 13:10 into video to see it in action. http://mschnlnine.vo.llnwd.net/d1/ch9/2/8/2/3/7/4/104Episode23AnIntroductionToManualTesting_ch9.wmv

CodedUI Functionality in VS 2010 Video. Fast forward to 2:20 to 7:10:  (You can do this on any VS 2008 project you have, using VS 2010 only) http://mschnlnine.vo.llnwd.net/d1/ch9/5/4/1/8/6/4/104Episode18FunctionalUITesting_2MB_ch9.wmv

Good Post on some of the Lab stuff: The Microsoft Test Runner – innovation for the Generalist Tester

Visual Studio, Troubleshooting, Developer Tools, Microsoft , , , ,

Show Ports In Use on your Windows OS

2. December 2009

TCP Ports:

netstat –anop TCP

UDP Ports:

netstat -anop UDP

Troubleshooting, Microsoft, Operating Systems , , ,

Test SMTP Server via Telnet

18. November 2009

As a developer I always have to write code to send emails, here's a quick way as a developer to make sure the SMTP Server is working properly.

Telnet to Port 25 to Test SMTP Communication

1. Telnet into Exchange or SMTP Server using port 25.
Command is telnet <servername> 25

c:\>telnet 192.168.0.5 25
220 fredmastro.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Sun, 29 Nov 2009 10:22:22 -0400

2.Start by typing the following:
helo <your domain name><enter>                 
response should be as follows
250 OK

 

c:\>helo
250 fredmastro.com Hello [10.x.x.x]



3. Type the following command to tell the receiving SMTP server who the message is from:

mail from: <your Email Address><enter>
response should be as follows
250 OK - mail from <your Email address>

For example,

c:\>mail from: fredmastro@fredmastro.com
250 2.1.0 fredmastro@fredmastro.com....Sender OK



4.Type the following command to tell the receiving SMTP server whom the message is to. Use a valid recipient SMTP address in the domain that you are sending to.

For example, if you are sending to someguy@gmail.com, you must be certain that someguy@gmail.com exists in your domain. Otherwise, you will receive an NDR.

rcpt to: <recipient address><enter>
response should be as follows
250 OK - Recipient <recipient address>

For example, 
c:\>rcpt to: someguy@gmail.com
250 2.1.5 someguy@gmail.com

5.Type the following command to tell the SMTP server that you are ready to send data:

data<enter>
response should be as follows
354 Send data.  End with CRLF.CRLF

c:\>data
354 Start mail input; end with <CRLF>.<CRLF>
Test Message
.

250 2.6.0 <someguy@gmail.com>
Queued mail for delivery

6. Close the connection by typing the following command:
c:\>QUIT

response should be as follows:
221 closing connection

Another good reference: http://www.messagingtalk.org/content/470.html

Developer Tools, Troubleshooting , ,

Slow Closing of Visual Studio on Remote Web Projects

9. December 2008

Found this post, and though it would be worth noting for my development friends.

If you are experiencing slow project close, try switching off participation in the feedback program in  Help | Customer Feedback Options... dialog. If it does not help, try disabling component in registry by changing

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\{2DC9DAA9-7F2D-11d2-9BFC-00C04F9901D1}

to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Packages\Disabled-{2DC9DAA9-7F2D-11d2-9BFC-00C04F9901D1}

Troubleshooting, Visual Studio ,