Just starting out with C# (using VS2008) - am an experienced Java, C++, VC++, VB programmer.
I downloaded an assembly (I guess) from codescales.com; it's a dll.
In my (new) C# project, I added this dll as a Reference -- by browsing to it. I got intellisense working for it, and coded-up a simple example to test it, but everytime I hit the VS "Debug", I get the following Exception. Do I need to "register" or do something to this downloaded DLL to use it properly in my project? (VS seems to copy it to the output dir automatically on build.)
Thanks in advance, AJ
System.IO.FileNotFoundException was unhandled Message="Could not load file or assembly 'CodeScales.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
Source="ocrTest1" FileName="CodeScales.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" FusionLog="=== Pre-bind state information ===\r\nLOG: User = CAPTURESDK-VM\XXXXX\r\nLOG: DisplayName = CodeScales.Http, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\n (Fully-specified)\r\nLOG: Appbase = file:///C:/Documents and Settings/XXXXX/My Documents/Visual Studio 2008/Projects/ocrTest1/ocrTest1/bin/Debug/\r\nLOG: Initial PrivatePath = NULL\r\nCalling assembly : ocrTest1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.\r\n===\r\nLOG: This bind starts in default load context.\r\nLOG: No application configuration file found.\r\nLOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.\r\nLOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).\r\nLOG: Attempting download of new URL file:///C:/Documents and Settings/XXXXX/My Documents/Visual Studio 2008/Projects/ocrTest1/ocrTest1/bin/Debug/CodeScales.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/Documents and Settings/XXXXX/My Documents/Visual Studio 2008/Projects/ocrTest1/ocrTest1/bin/Debug/CodeScales.Http/CodeScales.Http.DLL.\r\nLOG: Attempting download of new URL file:///C:/Documents and Settings/XXXXX/My Documents/Visual Studio 2008/Projects/ocrTest1/ocrTest1/bin/Debug/CodeScales.Http.EXE.\r\nLOG: Attempting download of new URL file:///C:/Documents and Settings/XXXXX/My Documents/Visual Studio 2008/Projects/ocrTest1/ocrTest1/bin/Debug/CodeScales.Http/CodeScales.开发者_开发问答Http.EXE.\r\n"
There's a name mismatch, not sure how that happened. Remove the assembly reference. Rename the DLL you downloaded from CodeScales.Http.V0.14.dll to CodeScales.Http.dll. Then add the reference back.
You need to change Framework. Go to 'Properties' and the change '.Net Framework 4 Client profile' to '.Net Framework 4'.
精彩评论