i am working project in c# Visual studio 2009,i am using c++ dll in my project and also i call that dll through my function . In my system the project run successfully.but in other system not in single system more than system i checked it shows exception like unable to load dll. i am check that dll in dependency walker it shows msvcr71.dll is missing.how i get this.?i need better solution for this
The problem is that your native C++ DLL depends on the library msvcr71.dll. This is not part of the standard windows installed hence you must take some action to get it onto the target machine.
The simplest way to do this is to just copy the DLL around with your application. The following KB article covers this.
Documentation on msvcr71.dll
http://msdn.microsoft.com/en-us/library/abx4dbyh(VS.71).aspx
You're probably missing something in your installation of the SDK (or Visual Studio). I would recommend a Repair or Reinstall.
look on msdn for info about redistributables - this tell you what you need to install on a non dev box to make things work
This is not programming related. You are missing a dll file on your target system. Download and put in "windows/System32" and it should run.
Related
C#/.Net devs:
I've a DLL project. To debug I created a solution and with a Win Forms project with reference to DLL, included the project for the DLL. Recently, I had to sign the DLL w/ strong name key so it could be installed in GAC on a Win Server, running SQL Server/SSIS and be called by SSIS packages.
I tested this by installing compiled DLL in GAC on dev machine. What I now find is that I can't step into the DLL project from the Win Forms project unless my code with any changes are compiled and the resulting DLL AND the PDB are placed in the GAC and the new version of DLL is installed there, after uninstalling the prior version DLL.
It seems that all this effort is required simply to test/debug even a change to a single line of code.
No doubt I'm missing something. It can't that difficult. I have learned some things from reading other posts but I haven't picked up on quite this issue. Or, maybe everyone simply accepts this as the way it is? Any help or links to help explaining this and why it's necessary, or what I'm doing incorrectly are appreciated.
Just the fact that the solution and projects have to build/compile every time we run the process for test/debug purposes seems tedious. Having to go out an interface with GAC for every little adjustment during debug/test additionally. . . I might to stop defending C#/.Net to co-workers. But, I bet I missing something. Help me out please.
Jim.
I am working on a cross platform Gui app using c# Visual Studio on Windows. I was hoping to port my code to linux via Monodevelop because i have tried it with another project and it worked.
However in this particular project I happen to use EasyTabs dll to create a chrome tabs on my app. The projects is error free on windows but on linux i get a dll exception error and one dll it says is missing is that of uxtheme.dll
I have tried to copy the uxtheme dll from my windows C:\Windows\System32
To my project and add it to my .csproj and even copied it to my debug and release folder. However this has not been successful. Any workable idea would do.
it looks like you are trying to run a winapi project on linux. While Monodevelop may look like it support windows envirnonment on linux os it is very important to note that not all dll and supportive windows runtime files are available. You have to look for missing dll files to fix your problem or simply write a program that does not require them at all
I have a C# application running on the .NET Framework 4.5 deployed via Microsoft ClickOnce. I also am utilizing a small utility from a Microsoft SDK called DComPerm.exe which is a C++ application that I had to compile separately. My main application uses Process.Start() to access this executable.
When I first tried running this on a client machine, I got an error message stating that VCRUNTIME140.dll was missing when the application tried to call DComPerm.exe.
This makes sense... since that program was compiled in C++ it needs the Visual C++ 2015 Redistributable package, which had not been installed on the client machine. I want to make this as painless as possible, so I was hoping I could bundle the VC++ 2015 Redist with my ClickOnce application. Under the project properties > Publish tab, there's a button for Prerequisites, which allows me to specify that the application should bundle the redistributable package.
That sounds great in theory, but it doesn't work. Now when I try to install my ClickOnce application on the client machine, it doesn't work. The installation fails and points me to a log file, which contains the following relevant information:
'Visual C++ "14" Runtime Libraries (x86)' RunCheck result: Install Needed
Installation of components 'Visual C++ "14" Runtime Libraries (x86)' was accepted.
Copying files to temporary directory "C:\Users\Owner\AppData\Local\Temp\VSD3872.tmp\"
Downloading files to "C:\Users\Owner\AppData\Local\Temp\VSD3872.tmp\"
(8/4/2016 12:57:48 PM) Downloading 'vcredist_x86\vcredist_x86.exe' from 'http://go.microsoft.com/fwlink/?LinkID=800028&clcid=0x409' to 'C:\Users\Owner\AppData\Local\Temp\VSD3872.tmp\'
Download completed at 8/4/2016 12:57:49 PM
Downloading failed with HRESULT=-2146697208
And that message makes it pretty clear what the problem is: the link that it's trying to use to download the redist package is dead. Only... I'm not sure how I can tell it to find the correct link. I'm quite surprised that it can't find it automagically as that seems like a bug with Visual Studio. Some searching revealed that the correct link is actually this one, but that's not what ClickOnce is resolving. I also saw that by checking the box this was the corresponding XML update to my csproj file:
<BootstrapperPackage Include="Microsoft.Visual.C++.14.0.x86">
<Visible>False</Visible>
<ProductName>Visual C++ "14" Runtime Libraries %28x86%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
Is there some XML tag I can use to specify the location explicitly? Or how else can I fix this? How can I bundle the redistributable without breaking my application?
I had pretty much the exact same problem. You asked how to specify the download location that ClickOnce resolves. In order to do that, open
C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\vcredist_x86\en\package.xml
and edit the attribute with Name="https://go.microsoft.com/fwlink/..." to the correct URL. By the way, thanks for finding the correct download link, I hadn't been able to find it until seeing this post.
The VC++ Redis installed correctly on the client's computer after doing this.
I used VSTO a couple of years ago with Visual Studio to do some nice little addins for outlook. But I can't justify the cost of VS to do some part time projects. As a result I have installed the free version of VS and downloaded a promising office addin tool called NetOffice.
I am ok at c# but can't find a hello world example that includes setting up the environment to work.
I have VS express installed but don't know what to do with the NetOffice assemblies etc to get a simple example working.
I looked through the documentation and found a reference to "Netoffice Developer Toolbox" which set up projects for people who are not using the full version of VS. That sounded like exactly what I was after so I downloaded that also.
When I run the app NetOffice.DeveloperToolbox.exe I get a lot of errors, it does eventually load but tabs are missing and nothing seems to work.
Start up error is:
An attempt was made to load an assembly from a network location which
would have caused the assembly to be sandboxed in previous versions of
the .NET Framework. This release of the .NET Framework does not enable
CAS policy by default, so this load may be dangerous. If this load is
not intended to sandbox the assembly, please enable the
loadFromRemoteSources switch. See
http://go.microsoft.com/fwlink/?LinkId=155569 for more information. |
NotSupportedException | Void .ctor()
Following the link in the error message takes you to a page that has this description:
If you were directed to this topic because of an error message in the
Visual Studio project error list or a build error, see How to: Use an
Assembly from the Web in Visual Studio.
I didn't know i was referencing anything in the web so don't know what to do next.
Can anyone tell me what I need to do to get NetOffice working or if they have found/written a tutorial to getting it sorted IE a hello world tutorial?
Thanks in advance for your help.
you try to start a .net assembly from a network location.
this is forbidden from net policies(normaly)
move the toolbox folder to your hd and everything is okay.
NetOffice contains examples/tutorials for each office product in the release package. you find a lot of example online too directly from the main page(netoffice.codeplex.com) anyway, NetOffice is a 1:1 wrapper, this means if you already know the office object model from VBA or PIA(VSTO), you are ready to use NetOffice(you can use existing PIA code in NetOffice).
I wrote with VS10 the following projects:
a C# (.net 4.0) program which calls
a C++ unmanaged dll, which make use of boost::thread
a setup project which includes the C# executable, the C++ dll, the boost::thread dll and some other files. Moreover during the installation there is a check if the framework .net 4.0 is installed, and if not it will be downloaded.
The compilation (x64 for each of the three projects) is ok, and the program works on my pc (Windows 7 64bit).
I tested the program on some other computers (all Windows 7 64bit) and I noted that:
in the ones with VS10 and Boost the program works
in the ones without VS10 and Boost the program gives an error in the C++ Dll
I think the problem is that some boost Dll is missing. Am I right?
Or the problem could be related to VS?
edit:
I have to mention that the structure of the program is the following:
main form (C#) in which some parameters are set, then a backgroudworker calls
the C++ DLL which do its stuff and uses boost::thread
it does some computations
when it get some results, writes them on file
continue with its computations and so on
the main form has a filesystemwatcher which looks for the results file and do some stuff with the results.
Also, when I get the error, the main form correctly loads and the parameters could be set. The error happens when the backgroundworker starts his work (calling the C++ DLL).
So I'm quite sure that there is no problem with the framework installation.
Update:
It turns out that I forgot to include some DLLs in the setup project. Now, including them the error changed.
Now, at the same point as before (and on the same computers) I get another error:
BadImageFormatException: An attempt was made to load a program with an
incorrect format
I read this article, but I have set x64 in both C# project and in C++ DLL and the setup project has as TargetPlatform x64. Any idea?
VCRedist package is missing on target machine. It should be available in VS SDK directory. Also you may need to install .Net Framework on target machine (.Net Framework contains VCRedist package). If you don't have instalation files for those, they are available on microsoft sites i.e. VC10Redist for x64 is here
In such cases I use the tool Dependency Walker
Launch it and select your executable to discover the missing libraries.
It gives clues indicating what is needed to install then.
If your C++ DLL is dynamically linked to the CRT, then you have to deploy also the VC++ CRT DLL's, i.e. MSVCR100.DLL and C++'s MSVCP100.DLL on the target machine (they are already available on your dev machine, where you have VS2010 installed, so on that machine your C++ DLL loads fine; but you can't assume that on your client's machine the CRT/C++ DLL's are available).
There are several deployment options: you may want to read this documentation on MSDN.
I finally found the solution!
The C++ DLL needs the mpfr library for multiple precision floating point computations with correct rounding.
I was including (shame on me!) the incorrect version of the library (x86) and this was the motivation for the error:
BadImageFormatException: An attempt was made to load a program with an incorrect format
Then in all the computers (three different computers!) in which the program was ok there were both (unlucky and misleading coincidence):
Boost and VS10 installed and
a x64 version of the library in a folder contained in the Path environment variable.
So, in some way the program found the right version of the DLL.
Including the right version of the library in the Setup Project fixed the problem.
Thanks to Kamil Klimek, Stephane Rolland and Mr.C64 for their precious suggestions.