.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘file’

BUG: You receive a “The operation has timed-out” error message when you access a Web service or when you use the IPAddress class

Symptoms
In Microsoft Visual Studio .NET 2003, when you try to add a Web reference to a Web service, or when you call a Web service method, you may receive the following error message:

There was an error downloading ‘http://WebServerName/WebServicePath/WebServiceName’. The operation has timed-out.
Note WebServerName is a placeholder for the name of your Web server, WebServicePath is a placeholder for the path of the Web service, and WebServiceName is the name of the Web service.
In addition, when you use the IPAddress class, you may receive a “System.TypeInitializationException” exception. For example, when you use the Web Service Description Language tool (Wsdl.exe) to try to create a Web service proxy file, you may receive the following error message:

Unhandled Exception: System.TypeInitializationException: The type initializer for “System.Net.Sockets.Socket” threw an exception. —> System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full at System.Net.Sockets.Socket.InitializeSockets() at System.Net.Sockets.Socket..cctor()
Note You do not receive the previous error messages when you use Microsoft .NET Framework v1.0.
Resolution
When you install a protocol or a network adapter on your computer, the operating system creates a protocol binding between the network adapters and the protocols that are installed on your computer. Typically, a computer can store up to 50 protocol binding details. Therefore, if the number of protocol bindings exceeds 50, and you use the IPAddress class directly or indirectly (such as when you try to add a Web reference or when you call a Web service method), you receive the error messages that are mentioned in the “Symptoms” section of this article.
NotesThe operating system creates a protocol binding even for “phantom” (“ghosted”) adapters on your computer.
For additional information about phantom devices, click the following article number to view the article in the Microsoft Knowledge Base:
241257?(http://support.microsoft.com/kb/241257/) Device Manager Does Not Display Devices Not Currently Present in Windows 2000To determine the number of protocol bindings on your computer, run the enum.exe file.
The following file is available for download from the Microsoft Download Center:

Collapse this imageExpand this image
Download the enum.exe package now.(http://download.microsoft.com/download/9/3/0/930e1ecb-a6c6-445f-bd79-82fc3e66f009/enum.exe) For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591?(http://support.microsoft.com/kb/119591/) How to Obtain Microsoft Support Files from Online Services Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Application Exception in Spoolss When Printing

Symptoms
When you use the Citrix ICA client and are connected to a server configuredusing the Metaframe add-on to Microsoft Terminal Server, you may receive aDr. Watson error in Spoolss if using the HP LaserJet 4000 printer.

Application exception occurred:App: exe\spoolss.dbg (pid=74)When: 9/14/1998 @ 14:28:14.841Exception number: c0000005 (access violation)
Resolution
This issue may be caused because you may have a mismatched version of theHpdcmon.dll file, or the Hpdcmon.dll file may be corrupted, or it may beunnecessary for proper operation.

ACC2000: “Can’t Open the Table” in Data Source of ASP File Error

Symptoms
When you try to open a Microsoft Access table in Design view, you mayreceive the following message:

You can’t open the table ‘<tablename>’ for modification.
A query or form bound to the table is open, you may not have permissionto open this table in Design view, or another user has the table open.Do you want to open this table as read-only?
If you have opened a query or form bound to this table, close it, andthen try again to open the table in Design view.You may also receive errors if you try to move or copy a database inWindows Explorer; for example you may receive the message:

Cannot move <database>: There has been a sharing violation.
The source or destination file may be in use.
-or-

Cannot rename <database name>: Access is denied.
Make sure the disk is not full or write-protected and that the file isnot currently in use.
Resolution
The database is an ODBC data source that is used by an ASP file. Forexample, this behavior would occur if the table itself, or a query or formbased on that table, had been exported to ASP format. Although the ASPfile, itself, may not currently be open in a user’s browser, the Session object for a particular user session persists for the period of time specified by its Timeout property. The ASP file contains code that creates a Connection object and stores that connection in the session variable. Therefore, the connection to the Microsoft Access database that serves as the ODBC data source persists until the session times out. The default value of the Timeout property is 20 minutes.

A System.Resources.MissingManifestResourceException exception occurs when you try to access a localized resource

Symptoms
In a Microsoft ASP.NET application, when you try to access a localized resource, a System.Resources.MissingManifestResourceException exception may occur, and your Web browser may display an error message that is similar to the following error message:

Server Error in ‘/MyApp’ Application.
Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure “MyApp.strings.resources” was correctly embedded or linked into assembly “MyApp”. baseName: MyApp.strings locationInfo: <null> resource file name: MyApp.strings.resources assembly: MyApp, Version=VersionNumber, Culture=neutral, PublicKeyToken=null
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.Resources.MissingManifestResourceException: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure “MyApp.strings.resources” was correctly embedded or linked into assembly “MyApp”. baseName: MyApp.strings locationInfo: <null> resource file name: MyApp.strings.resources assembly: MyApp, Version=VersionNumber, Culture=neutral, PublicKeyToken=nullNotesIn the error message, MyApp is a placeholder for the name of your ASP.NET application.In the earlier error information, VersionNumber is a placeholder for the version number of the primary assembly for your application.
Resolution
This problem occurs if you use a localized resource that exists in a satellite assembly that you created by using a .resources file that has an inappropriate file name. This problem typically occurs if you manually create a satellite assembly.
To manually create a satellite assembly, you must first run the Resource File Generator (Resgen.exe), and then you must run the Assembly Linker (Al.exe). When you run Resgen.exe, if you do not specify the file name of the output file while you convert an XML-based resource format (.resx) file to a .resources file, Resgen.exe creates a .resources file that has the same file name as the input file. If the file name of your XML-based resource format file does not start with the namespace name of your application, the file name of the .resources file will not contain this namespace name either. You may run Al.exe to create a satellite assembly that contains the localized resources that exist in the .resources file. However, when you try to access a localized resource that exists in the satellite assembly, the behavior that is mentioned in the “Symptoms” section occurs.