Can't Find DLL (Visual Studio 2008) - c#

Right now I'm trying to write a program for a sensor to collect data with. The sensor manufacturer released an SDK that has example code in it. I haven't made any changes to the code and am only attempting to use their examples to figure out how to make my own code work with the sensor. I've opened it up with Visual Studio 2008 and attempted to run the code as both debug and release. In both cases, it stops when it can't find the manufacturer's dll files.
I've copied the files in question to the same folder with the project in it and the problem persists. I've been to multiple forums and downloaded things and nothing has worked. I've run Dependency Walker which indicated issues with ieframe.dll and ieshims.dll. I copied both files from the IE folder and into the system32 folder and then registered them with an elevated command prompt. This fixed the issue with ieshims but ieframe persists. I tried downloading the latest IE (11) but that just introduced more issues and failed to fix the ieframe issue.
I'm not really sure how to proceed and any help would be appreciated.

The dll needs to be in the same folder as the executable. I use a shortcut/link within VS to achieve this. The result looks like this:
See this post for more details and an example.

Are you getting other errors besides the .DLL errors? If so, you need to get ride of those errors. Once you get rid of those errors your DLL errors should go away then.

Related

Unable to run a MonoGame project on a clean installation of Visual Studio and MonoGame

I recently got a new computer, and finally got around to installing MonoGame, as I worked with it a few months back on my old computer, and primarily use Unity for my game development when not working on 2D games. Their website says they have CLI templates that work with Rider, but I figured it would be best to get it installed with Visual Studio first. Following the exact steps listed on the MonoGame website, I got everything installed that I needed, and started a project from one of the Visual Studio MonoGame templates. Upon opening the project, and everything finishing loading, I am greeted to this miserable sight. I also had an error in the console relating to MonoGame, with the error code MSB3073. From what research I did, I found that it either had to do with my username having a space in it (it clearly does not, so that was out of the picture), or it had to do with using the Visual Studio templates, and I would simply need to create the project from the CLI templates, as seen here. However, creating a new project from the CLI templates does not change anything. I have tried uninstalling and reinstalling dotnet, I have tried uninstalling and reinstalling Visual Studio. I have, of course, powered my computer off and back on multiple times. Even trying to open the project in Rider after installing the proper MonoGame packages in the program has the same exact errors. But when I zipped the project up and sent it to a friend who works with MonoGame, he was able to run the project with no issues, so clearly it has something to do with my setup.
I have also cleaned my nuget cache, cleared my project temp folders, and cleared the visual studio cache. Eventually, the Microsoft dependencies stop having issues when I simply close and open the project again, but every time I open the project in Visual Studio, I get the same error in the console, and it prevents me from running/building the project.
Hoping someone on here will know what to do with the info I've given, as I'm completely out of ideas!
So I figured it out. I'm not very experienced with the command line, but I managed to find a very nice tutorial by someone who wanted to make games with MonoGame using only the command line. In it, I was able to attempt to build the project from the CLI, and it gave me an error message unlike what was in Visual Studio. It said that MonoGame only works on a 64bit OS, but I'm on a 64bit OS. So I went to look at what version of dotnet was being used, and sure enough, it was the 32 bit version! It took a while to figure out how to uninstall it, and how to use the dotnet-core-uninstaller tool in the command line. Then all I had to do was remove the Environment Variable in the System category for the Path variable that referenced the Program Files (x86) directory of dotnet.
Hopefully if anybody else comes across this issue, they'll find this post, as none of the others seemed to fully explain how to do anything that needed to be done to fix the problem :)

Error when trying to use .NET Generate Assets for Building and Debug in VSCode

I'll make this brief, below is the main issue I'm having.
I'm learning C# again so I can expand my skillset. Long story short, the tutorial I was following was showing the viewer how to use the above command from VSCode's command palette.
Whenever I try to use said command to generate the files it should, I get the error: "Unable to generate assets to build and debug. OmniSharp server is not running."
Thus far I have tried:
Uninstalling and reinstalling VSCode
Uninstalling and reinstalling the C# Extension in VSCode
Added C:\Windows\System32 to my PATH environment variable
Doing the above plus completely deleting the original project folder, restarting my computer, and remaking the simple "Hello world" print program created using "dotnet new console", inside of a workspace.
I am using:
Windows 10 Pro
Visual Studio Code 1.48.2
.NET SDK 3.1.401
I'm not sure what other information may be necessary, and I've looked through other similar questions, but nothing I try works, even after restarting my machine. I'm at a loss frankly.
Turns out the C# Extension on the current version is just buggy and not working right. Downloading an older version (1.21.16) and installing from VSIX seems to have somewhat fixed the previous issue. At the very least the error message has changed to something else.
For anyone also having this issue, I recommend trying what I did.

Visual Studio 2015 and uwp development - User-Mapped section error and CopyWin32Resources error

Continuing with some UWP development and 2 things keep happening with visual studio and I can't work out if its a VS2015 bug, the fact that I am deploying to a windows Mobile 10 device or something else.
Randomly when I try to build or deploy to my device I get either.
Could not copy "obj\ARM\Debug\MyApp.exe" to "bin\ARM\Debug\MyApp.exe". Exceeded retry count of 10. Failed.
Unable to copy file "obj\ARM\Debug\MyApp.exe" to "bin\ARM\Debug\MyApp.exe". The requested operation cannot be performed on a file with a user-mapped section open.
or I get
CopyWin32Resources failed with exit code 500
Seems to be random and I can't nail down what is causing either. Googling didn't really help. Some said Anti-virus but disabling mine did nothing. Some said it was something to do with Visual Studio Achievements Extension but I don't have it installed.
Anyone know the cause or a fix? Making development difficult when I can't deploy.
UPDATE: Ok so the first set of errors is more related to Windows 10 I think. When the error appears again I try to manually copy the file and when I do I receive similar error in explorer.
error 0x800704c8: the requested operation cannot be performed on a file with a user-mapped section open.
can you try those things:
Close all other VS windows except one.
Clean the project you works on.
Try build project. If you get same errors, close all VS windows.
Delete 'bin' and 'obj' folders.
Open VS again and try building your project.
Then try deploying your project.
I know you might have found a fix already. But I had the same error after installing new emulators for my uwp application, after installing these emulators I seem to have gotten those errors. I thought uninstalling these emulators would be the fix, but was not. Now I run my program without restoring any missing packages and it seems to be the fix.
For anyone still facing the CopyWin32Resources Error on Windows, try uninstalling CbDefense (both Carbon Black Sensor and CB Defense Sensor 64bit). To much disbelief, this solution suggested by Microsoft resolved the issue for me!
I got this problem whenever I have my project in a folder that is synced by something like Dropbox. Pausing Dropbox always fixes the problem for me.
Fixed the problem. Moved the project out of the Visual Studio Project folder in My documents folder and into a projects folder on the C Drive. None of the errors have returned so I am guessing this is a windows 10 issue.

DLL Hell(p) - Works on dev box, but not any othe

3 Days of hair pulling. It just doesn't make any sense. I can't figure out what I've missed.
So I have this C#/WPF VS2013pro project I'm building that works fine on my Visual Studio machine: Win 8.1 x64 but fails due to 'dll not found' on any target PC I transplant it to.
It uses FreeImage, which has two DLLs:
FreeImage.dll - C++ that does all the work
FreeImageNet.dll - .NET wrapper to make like easy in C#
The two need to be in the same directory and preferably the same as the .exe - so they are.
My project is 64bit. I downloaded the source for FreeImage and compiled both DLL's for x64: First the CPP one, then the .NET one. Then copied them to the solution.
The .net DLL is referenced in my solution. The CPP does not reference, of course. Both are part of the solution and copy to the %outputdir% (Bin/Debug or Bin/Release) when the solution is built. The program runs fine in DEBUG and in RELEASE on my Development PC and the DLL methods do their job.
I copy the entire BIN directory to another PC running the same version of Windows, same updates, the works... The program runs but when a method is needed from the FreeImage.dll it fails with "unable to find dll".
To make sure I'm right about it using the dll from the BIN directory (and not from System32 or SysWOW64) on my VS machine I pull it out and run the app: Yep it fails.
I put it back and move the entire directory: It works
I pull it out: It fails
I put it back and move it to a thumbdrive: It works
{you get the idea}
So at this point it sure seems like it is really using the one in the same directory as the .exe and the .NET wrapper dll
I move the thumbdrive with the code that just worked on my VS machine to the other PC: It fails.
Next I try remote debug to the other PC: All the files copy to a matched directory, debugging starts and works, I get output and breakpoint behavior from the remote PC: Only the calls that require the DLL again fail because FreeImageNet.dll cannot locate FreeImage.dll
I did nothing special on my Visual Studio machine to make FreeImage work: I downloaded the source and compiled then copied the DLLs to the solution and referenced the .NET dll - That's it.
I have Googled, and researched and opened questions on SourceForge about it.
Every previous question I have found on this issue are cases of someone thinking FreeImageNet.dll was self-contained and not realizing it had to be located along side of FreeImage.dll
I have checked registry for I have checked registry for HKLM/System/CurrentControlSet/Control/SessionManager/KnownDLLs/
I have tried to register it with regsrver32 (yes, the 64bit flavor)
I have tried setting an environmental variable to it.
I have tried copying the DLL to every directory that is part of the DLL search order.
I have tried it on Win8.1x64pro (same as my Visual Studio pc) and two Win7x64pro machines.
I have assumed it was some weird quirk in 3.16 of FreeImage and done this again and again with previous releases as far back as 3.6, all with the same results.
I have built an installer for the solution and installed it on the VS machine where it worked, and installed it on the test machine where it failed.
I am trying for the first time (and not so successfully) to virtualize my physical PC. VMware has always been good to me for test environments and at this point I want to see if a total clone of the Visual Studio machine will succeed or fail with this project.
So... Anyone have an idea?
Darn it, I missed one: vcomp120.dll
Seems it is part of the Visual C++ redistributable that was installed with Visual Studio.
It should have dawned on me that I would need to include this, but with the entire EMGUcv package working... and the fact that I hate C++ and haven't used it in a dozen years... It totally never occurred to me.
Can you please try to import the dll with DLLIMPORT. Copy and place the dll to the directory same as of exe and use following code in Code behind:
[DllImport("FIBITMAP.dll")]
public static extern void Load(string param1,string param2,...);
Here Param1, Param2,... will be your parameters to the function Load.
Hope this helps.

Visual Studio 2008 crashes when opening solutions in a TortiseSVN directory? How do I fix this?

I'm using TortiseSVN for my subversion client on a Windows Server 2008 box and I've got a folder with code checked out into it.
When I go to open the solution file that's under source control Visual Studio 2008 starts and before it can even finish loading the solution from what I can tell Visual Studio crashes. I'm trying to open a solution that has VB code in it. It gives no error messages or warnings. It's just gone.
I have checked the files and they all seem fine. The solution file seems fine when I look at it with a text editor.
This is also Visual Studio 2008 SP1 and I've got all the latest .NET service packs installed.
Has anyone else seen this before and know how to fix it?
Edit: I just did an SVN export to a new directory and it still crashes in the exported directory where there is no longer any SVN attached to it.
Additionally, it crashes EVERY time I try to open the project that came from SVN.
You should be looking at the solution file with an xml editor, at least then you will get some help for subtile flaw's in the formatting or something like that.
You can also submit feedback to Microsoft on the VIsual Studio Connect site, if the bug turns out to be real.
Some commonsense things todo however would be, goto your visual studio command prompt, start off with "devenv /ResetSettings", that often helps isolate any weirdo add-on or something lke that.
Also, try to build clean with msbuild or vcbuild, then build fully with either one (i.e. if vcbuild can not build your solution, use msbuild). That can help by laying out the symbols and such and maybe clear out some corrupted file or something.
You also may have .suo files from your subversion, those are binary files that do contain some settings, it's common for people to accidentially check them in, but they are usually better off being kept on a per-developer basis (not in the source tree). The /resetsettings will likely clear these out also, but you may want to make sure.
You can also double check the path's to all of the assemblies referenced, that your not going from a 32/64 bit host, and the CLR DLL's are in different path's now etc...
One last thing, if your really stuck, you can get a stack trace and debug the crash a bit ;), see where the fault is occuring and search that module online, your'll often find that somebody may have a specific solution.
Oh yeah, also, hooker's can be trickey. Don't trust them for a minute. Make sure you set tsvn's "only load in windows exlporer" option and configure it specifically for what folders on your system have local-svn working directories, this will greatly reduce the working set for their shell extension. On most any system, over time, one program or another (apple irw.exe or adobe pdf-preloader.exe sort's of ad-ware) will try to work it's way into your shell. You should try to make sure your dev box is rather clean from anything hook's, simular to what VladV was saying...
I had a similar problem and I fixed it and afterwards I wasn't quite sure how I managed it.
It basically involved going to the tools/options menu and setting the source control plugin to none. However, I obviously had to have had the solution open in Visual Studio if doing this was to fix the solution, but yet I thought the problem was I could not open the solution.
The only possible scenario would be if I was able to open the solution, but not open any of the projects inside it, hence able to change the source control settings immediately after opening the solution.
Does that make sense?
Try opening your solution and projects files in a text editor, and looking for anything strange.
I once heard of a similar problem: a solution contained SVN bindings created by AnkhSVN, but Visual Studio had no AnkhSVN installed, and failed to open the solution without giving any meaningful error information.

Categories

Resources