Could not load file or assembly or one of its dependencies. An attempt was made to load a program with an incorrect format.

I got the above message for one of the library I am working on;

Could not load file or assembly ‘Atalasoft.dotImage’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

I tried re-adding the reference file to a different version (new versioning and even making sure that the referenced dll is running on x64) and tracing the assembly binding error through FUSION but those didnt give me enough clue to figure out where went wrong.

After repeatedly few round of stopping and debugging attempt to view the errors, I finally found the main issue that triggered this error.

By default, the Visual Studio uses IIS express x86 to run the app for debugging. In my case, the referenced dll is in x64 (which is what I am intending to run it) and that itself causes issue with the mismatching runtime environment. Here is what I did to resolve that, changing the IIS Express to run on x64:
In VS – Go to Tools | Options | Projects and Solutions | Web Projects | Use the 64 bit version of IIS Express

Written by admin on January 10th, 2016 with no comments.
Read more articles on Programming.

MSSQL Connection Timeout Expired (pre-login handshake failed or the server was unable to respond back in time)

If you happen to get this error (full error below):
TITLE: Connect to Server
——————————

Cannot connect to

——————————
ADDITIONAL INFORMATION:

Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake acknowledgement. This could be because the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was – [Pre-Login] initialization=13472; handshake=14425; (Microsoft SQL Server, Error: -2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=-2&LinkId=20476

——————————

The wait operation timed out

——————————
BUTTONS:

OK
——————————

What I did that helps me resolving the issue:
Enabling TCP/IP for both IP versions resolved the issue.
The fact that SSMS worked turned out to be coincidental (the first few attempts presumably used IPv4). Some later attempts to connect through SSMS resulted in the same error message.
To enable TCP/IP for additional IP addresses:
Start Sql Server Configuration Manager
Open the node SQL Server Network Configuration
Left-click Protocols for MYSQLINSTANCE
In the right-hand pane, right-click TCP/IP
Click Properties
Select the IP Addresses tab
For each listed IP address, ensure Active and Enabled are both Yes.

Help that helps!

Written by admin on January 10th, 2016 with no comments.
Read more articles on Programming.

« Older articles

No newer articles