Microsoft KB Archive/837907

From BetaArchive Wiki
Knowledge Base


Your application takes a long time to build and a keystroke delay occurs when you edit code in Visual Studio .NET or Visual Studio 2005

Article ID: 837907

Article Last Modified on 5/17/2007



APPLIES TO

  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio .NET 2003 Enterprise Architect
  • Microsoft Visual Studio .NET 2003 Enterprise Developer
  • Microsoft Visual Studio .NET 2003 Academic Edition
  • Microsoft Visual Studio .NET 2002 Professional Edition
  • Microsoft Visual Studio .NET 2002 Enterprise Architect
  • Microsoft Visual Studio .NET 2002 Enterprise Developer
  • Microsoft Visual Studio .NET 2002 Academic Edition




SYMPTOMS

When you edit code in Microsoft Visual Studio .NET or Microsoft Visual Studio 2005, your application may take a long time to build and you may experience a keystroke delay. A keystroke delay (also known as keystroke lag) occurs when you experience a delay between the time that you press a key and the time that the character or the action appears on the screen.

CAUSE

This problem may occur if both of the following conditions are true:

  • You log on to a computer by using your domain account.
  • You use an AssemblyKeyFile attribute in the AssemblyInfo.vb file of a Microsoft Visual Basic .NET or a Microsoft Visual Basic 2005 project, or in the AssemblyInfo.cs file of a Microsoft Visual C# .NET or a Microsoft Visual C# 2005 project.


WORKAROUND

To work around this problem, follow these steps:

  1. Log on to your computer as a local administrator.


Note Make sure that you are not connected to the network.

  1. Open the Visual Basic .NET or Visual Basic 2005 project or the Visual C# .NET or Visual C# 2005 project on your computer.
  2. On the Build menu, click Build Solution.
  3. Log on to your computer again by using your domain account.


STATUS

This behavior is by design.

MORE INFORMATION

When you generate a key file by using the SN.exe tool, the key file contains both a public key and a private key. When you build the application, the compiler uses this public and private cryptographic key pair to create a strong-named assembly.

The private keys that the SN.exe tool generates are encrypted by using a Data Protection API (DPAPI) master key. DPAPI is a pair of function calls that provide operating system-level data protection services to user processes and to system processes. When you use a domain account, DPAPI makes two copies of each master key. DPAPI encrypts one master key by using your user password and encrypts the other master key by using a domain secret. The domain secret is used to unprotect the data if all the applications that are running under the same user try to access any protected data.

DPAPI must call one of the domain controllers of the user to encrypt the second copy of the master key. If you are on a domain that is running under Microsoft Windows NT 4.0, this domain controller does not support calls that DPAPI makes. When DPAPI makes a call, DPAPI periodically calls a domain controller that supports DPAPI calls.

REFERENCES

For more information about DPAPI, visit the following Microsoft Developer Network (MSDN) Web sites:

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

331333 User cannot gain access to certificate functionality after password change or when using a roaming profile


Keywords: kbvs2005swept kbvs2005applies kbserver kbbuilder kblogin kbevent kbprb KB837907