libcurl.dll problem with curl and c# .NET - c#

I Need to develpe application for getting http website page
I found this tutorial for using curl in .Net
http://thedotnetframework.blogspot.com/2008/06/lets-talk-about-http-protocol-and-http.html
I downloaded the curl dll files and add reference (LibCurlNet.dll) to my project
and added the class in my project
but when I run my project, I have error message at line
Curl.GlobalInit((int)CURLinitFlag.CURL_GLOBAL_ALL);
the error message says
Unable to load DLL 'libcurl.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
it seems that ibcurl.dll has a problem
note : I can not add (ibcurl.dll) as reference in my project
please help ;

You're looking for the built-in WebClient class.
You don't need any third-party libraries.

The error you are seeing is that you need that file (and LibCurlShim.dll) present in your build directory (e.g. bin\debug) or wherever your exe is running from. There is no problem with the file - you just cannot add it as a reference in the usual way in Visual Studio.
You could right-click on Project Explorer and add Existing Files and select libcurl.dll and LibCurlShim.dll. Then in Solution Explorer, on the Properties of those two files make sure you set the Copy To Output Directory to something like Copy Always or Only If Newer

Related

How do I set the "executable project as the startup project" in Visual Studio 2013 Express?

So I am trying to study a sample application called ModernUIDemo.exe found in a zip file here. The website mentions the source code of the app can be found here.
After downloading, and pointing Visual Studio Express 2013 for Windows Desktop to the solutions file and trying to start without debugging, I get an error message:
A project with an Output Type of Class Library cannot be started
directly.
In order to debug this project, add an executable project to this
solution which references the library project. Set the executable
project as the startup project.
I am assuming this means that there are multiple projects, and I need to set a startable project. So how do I do this?
I have been looking in the Application settings, where it lists "Startup objects" and it says FirstFloor.ModernUI.App.App. Isn't that correct?
Typically, how is documentation laid out in C# apps? Is there like a javadoc I have to generate for C#/XAML/WPF?
edit:
I am now getting some reference errors in the XAML to <mui:ModernTab and <mui:BBCodeBlock does not exist in XML namespace. Any clues? I already thought I added the dll file....
Right click on the project you want to run -> Set as start up project
In your project's property in Application tab you have to see:
Output type: Windows Application.
With this configuration after compilation you will get EXE file. Instead, according to the error message you get, your application is configured like Class Library, so output is DLL.

Cannot add SQLBASEUTIL.dll (Gupta) as reference to C# - VStudio 2012

I am doing a C# project in Visual Studio 2012 (x86). I was able to add Gupta.SqlBase.Data to the project but when I run the project if gives me an error related to SqlBaseUtil.dll.
Unable to load SQLBASEUTIL.dll driver library.
Please check your CLIENTRUNTIMEDIR entry inside INI file or check your environment variable path or system path.
Therefore, I tried to add as reference to the project the SqlBaseUtil.dll. I could not manage to add this dll. This dll is also added to GAC.
Please help.
Check if the mentioned ini file exists. If it does, the language files associated with the SqlBaseUtil.dll are missing and cannot be loaded.
I had the same problem, and even after finding the dll and putting it in the same folder as the exe I was trying to run, it still gave the same error.
The problem wasn't that it couldn't find the dll, but rather that it couldn't load it, because it was missing vcredist2005_x86.exe (Microsoft.VC80.MFC).
If anyone else has the same problem, try checking the Event Viewer for more info (Windows Logs > Application).

Setting up 32feet library

I'm trying to get started with this library: 32feet
I have a Broadcomm Bluetooth Stack and haven't been able to figure out how to get this library set up. When I run my code, I get:
Unhandled Exception: System.PlatformNotSupportedException: No supported Bluetooth protocol stack found.
After digging around on their site, I found this: Installation instructions
It says to copy the appropriate DLL's into the project and then run the Test32FeetWidcommWin32.exe. I've tried putting the files in every single folder in my Visual Studio project and then running that EXE, but I still get the same error. Initially I tried just adding the InTheHand.Net.Personal.dll file as a reference to my project, but that didn't work either.
What could I be doing wrong?
It may also simply be that BlueTooth is not turned on in Windows.
I was using the .NET InTheHand library, and received this message only because BlueTooth was turned off in Windows, and resolved it by activating BlueTooth.
I just solved this. I think the problem was an old reference in my project to the NETCF version of the DLL from when I was trying to brute-force a solution, so I wiped my project clean and then started adding everything again and it worked!
A helpful tool to those trying to figure out their problem with this is to copy and paste the app.config file into your release directory with the app you are creating, and change the name to <YOUREXENAME>.exe.config. When you then run your EXE file, it should create a more detailed trace file. For mine, I found that coredll.dll was the culprit by not loading and was masked by the Stack not supported exception. After an easy Google search I found the problem to be with NETCF.
edit: To be clear, after I cleaned out my project a bit I re-added the reference to the correct InTheHand.Net.Personal.dll file and also added the 32feetWidcomm.dll file to my Release folder.

Visual Studio 2010 dll create error

I am new to C# programming and I have a problem with dll creation.
I opened a class library project and write public static methods in my classes. Clicked debug and copied dll and pdb files (under bin/debug/..) to my WPF application project.
I didn't get any reference problems also editor shows my methods normally, also when I use them it gives me no error or warning...
However, when I run my program, I saw that my methods calling dll methods are not working. In addition, debug mode also jumps my methods so I cant trace the code.
Where am I doing wrong? Is there any other way to create dll or am I missing a trick in here?
Thank you..
Rather than copying the DLLs into your WPF app's bin directory, you should either add a project reference to your class library from your WPF app, or add a reference to the output directory of the class library. Otherwise the build is probably copying over your hand-copied files. Basically, you should treat anything in bin as "controlled by Visual Studio" IMO - don't copy anything there manually. It helps if you use project references rather than referring to specific files, too - that way each build gets an appropriate configuration for its dependencies.

Could not load file or assembly ... The parameter is incorrect

Recently I met the following exception at C# solution:
Error 2 Could not load file or assembly 'Newtonsoft.Json,
Version=3.5.0.0, Culture=neutral, PublicKeyToken=b9a188c8922137c6' or
one of its dependencies. The parameter is incorrect. (Exception from
HRESULT: 0x80070057 (E_INVALIDARG))
This does not depend either on my code or on the name of assembly (like Newtonsoft.Json in this case).
When I delete this dll from the solution the compiler tells about another in the same exception. So I suppose something shoud be turned off/on at my PC :)
Looks like a corrupted assembly being referenced.
Clear both:
the \bin folder of your project
the temp folder (should be C:\Users\your_username\AppData\Local\Temp\Temporary ASP.NET Files in windows 7)
and see if the error still happens
Depending on if your are running X64 you might need to clean up a couple more spots. Just cleaning up my user directory was not enough.
%TEMP%\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
This list will grow as if you have other versions of the framework installed.
I had to clear
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
Only then did the issue get resolved.
To know what to clear for sure - add the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\EnableLog (DWord set to 1).
Then you will see output like below. This tells you where asp.net is attempting to load your DLLs. Clear this directory.
LOG: This bind starts in default load context.
LOG: Using application configuration file: c:\app\AtlasAdvisor\web\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL **file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/3c8629f7/dfa387b6/Avanade.ViddlerNet.DLL.**
LOG: Attempting download of new URL **file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/root/3c8629f7/dfa387b6/Avanade.ViddlerNet/Avanade.ViddlerNet.DLL**.
Clear out the temporary framework files for your project in:-
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
You can also clear the packages directory and allow NuGet to re-download missing packages
it solved the issue for me
Delete all files from these folders .
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET
Files
Getting fresh set of binaries from Source control helped.
Thanks
Just clear this folder: (only windows x64)
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
Thanks Alex your second point helped me fix this.
It appears that unless you run visual studio as an administrator in Windows 7 it stores your temp files locally rather than C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files.
See following blog post: http://www.dotnetscraps.com/dotnetscraps/post/Location-of-Temporary-ASPNET-files-in-Vista-or-Windows-7.aspx
I had the same issue here - above solutions didn't work. Problem was with ActionMailer. I ran the following uninstall and install nuget commands
uninstall-package ActionMailer
install-package ActionMailer
Resolved my problems, hopefully will help someone else.
This can happen while referencing COM wrapper dlls. Within your Visual Studio Project, under References, select the COM wrapper dlls being referenced and ensure they have the the following property values: "Embed Interop Types": False and "Specific Version": False.
I just delete my application temp data from this path
C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files
Problem resolve
I see lot of techies have posted about clearing temporary directories of ASP .Net run-time pertaining to each and every .Net framework hosted on your machine as in this answer. But I believe we should know the clear-cut logistics as to why we need to blindly clear all of temporary working directories of all .Net frameworks. According to me, it should not be the case.
My advice would be that you should try a pin pointed directory clearing approach to resolve this issue. How would you know which directory to clear?
Go to IIS and right click on your website node in left navigation pane to open the context menu. In the context menu point to Manage Application -> Advanced Settings... to open the Advanced Settings window.
Check the Application Pool your website is assigned to. In my case it is DefaultAppPool as shown below:
Now go to Application Pools node in left navigation bar in the IIS. Now check that which .Net CLR Version is being run by your app pool. In my case it is v4.0 as shown below:
Since the CLR version being hosted by my app pool is v4.0, so I prcisely cleared only the temporary files in the folder pertaining to ASP .NET v4.0 only as below:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
And that's it. My problem got resolved.
Lesson learnt: This is indicative of the fact that all the temporary files being used by your website aren't scattered across several directories but they are at once place being referred by your app pool. So you need to clear that specific folder only.
Clearing C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files worked for me. Thinking of automating the deletion process to avoid the issue in future.
If you are using SQL Server 2012's Data Tools, which uses the VS2010 shell as at May 1 2013, check your Configuration Manager settings. A server name change from Workflow to xCPWorkflow was enough to produce the exact same The parameter is incorrect (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) message.
You can either clean, build or rebuild your application or simply delete Temporary ASP.NET Files at C:\Users\YOUR USERNAME\AppData\Local\Temp
This works like magic. In my case i had an assembly binding issue saying Could not load file bla bla bla
you can also see solution 2 as http://www.codeproject.com/Articles/663453/Understanding-Clean-Build-and-Rebuild-in-Visual-St
I had this problem when making controller in MVC. I changed version .net framework. The problem was solved
The problem relates to the .Net runtime version of a referenced class library (expaned references, select the library and check the "Runtime Version". I had a problem with Antlr3.Runtime, after upgrading my visual studio project to v4.5. I used NuGet to uninstall Microsoft ASP.NET Web Optimisation Framework (due to a chain of dependencies that prevented me from uninstalling Antlr3 directly)
I then used NuGet to reinstall the Microsoft ASP.NET Web Optimisation Framework. This reinstalled the correct runtime versions.
In my case i wanted to compile a COM visible DLL. The problem was that an older version of this DLL was located here:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
Thus Visual Studio loaded this version instead of the newly compiled one, as it tried to register it.
Clear all files from temporary folder (C:\Users\user_name\AppData\Local\Temp\Temporary ASP.NET Files\project folder)
Sometimes you, also, need to clean this folder: C:\Windows\Temp\Temporary ASP.NET
I faced same error because application didn't find dependent frameworks in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\ folder. I just repair my Visual studio which added required framework in above location and it working fine.
In my case, changing the IISExpress port number in my project properties, solved the problem.
If anyone else out there is using the WiX toolset, I discovered that my installer project had a reference to an old project that had recently been removed from the solution. Took me a while to realize since there are a number of projects in the solution I was attempting to build and the message did not indicate which project was failing to build (and clean, which was failing as well).
I had users of Siemens Teamcenter 10 Client for Microsoft Office getting the same error about a different DLL. None of the other answers worked. The solution was to delete the folders in
C:\Users\%username%\AppData\Local\assembly\
I Had the similar issue while opening Nuget Packet manager,
I removed all the temp files and build the project, it worked fine.
I had the same issue with "Chocolatey Server (Simple)" running on IIS and had to do the following steps
Clean the "C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files" as recommended
Uninstall the "Chocolatey Server (Simple)" application via choco
Remove the directory "C:\tools\chocolatey.server" from the chocolatey package directory. Important, because otherwise Web.config is holding old dependencies which leads to the error. A simple re-installation will not update an existing Web.config (as it was in my case).
Restart IIS and config Chocolatey Server as recommended by the authors. The chocolatey server page should now be visible without any errors.

Categories

Resources