I come to you because I'm desperate. I've developed a GTK# application in C# with the latest MonoDevelop. It's built for .NET framework 4.0 / x86, and the only external library it uses is the official Mysql .Net connector. It's meant to run under Windows XP.
It's the first application I make with this IDE. I was very happy with the results and the development time, but the deployment is a real headache.
It works perfectly on the development machine. The debug is clean. Everything's okay.
Then, as I couldn't find any information about the deployment, I installed a clean XP to try it and see what do I should install on the client's machine.
I've installed the SP3, .NET 4.0 and copied the release package with all the DLLs mentioned in the build log (that made it work outside the MonoDevelop in the development machine). But I'm getting a "the application has encountered a problem and needs to close" error, with no exception, in kernel32.dll, offset 0012aeb.
I've tried to install the .NET 3.5 before the 4.0, updated IE (just in case...), copied more GTK# and Monodevelop DLLs to the exe's folder, installed the Mysql .NET connector, installed Mono 2.8... But nothing. Still getting that unexplained error.
Google and StackOverflow searches didn't help me. I've researched and tried a lot of things in the last twelve hours or more without moving from this machine.
Do you have any advice? What can be causing it? Is there any way to debug the exe (without installing VS...)? Does anyone know what are all the dependencies of this kind of executable?
WinDbg can help you figuring some JIT trouble...
Even though it aint intuitive and require skills, Worth a try. might pop something up.
If it's meant to run under Windows, then you should probably compile it with the Visual C# compiler.
However, more related to your problem - get a debugger in your deployment machine and run the application on it. This is the best way to figure out the problem because we really can't guess it.
Mono Application Deployment Guidelines
There are several options to installing Visual Studio on your production machine, one of them is the Remote Debugging Monitor. It does not require a Visual Studio installation. You can copy the files from your development machine to your server. I've got them under C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger.
You can also use it for Remote Debugging of a Project Built Locally.
Related
I just installed Visual Studio 2015 Community on my computer. Until now I have been using Visual Studio 2010 Professional. Now when I try to run my MVC apps in the build in web server, I get the following error message.
The procedure entry point __CrtGetFileInformationByHandleEx could not be located in \WINDOWS\SYSTEM32\msvcp120_clr0400.dll
I get the same error message if I try to execute vbc.exe (the Visual Basic compiler) on directly at the command prompt. My MVC app also shows a YSOD with
Compilation Error - Compiler Error Message: The compiler failed with error code -1073741511.
How can I fix my VS so I can run my programs again?!
Steps I've tried
Uninstall VS 2015 Community
Uninstall and reinstall .NET 4.6 and .NET 4.5.2
DISM /Online /Cleanup-Image /RestoreHealth
The .NET Repair Tool
Run sfc /scannow
Manually rename the msvcr120_clr0400.dll file to msvcr120_clr0400.dll.corrupt and do 1-5
Uninstall and reinstall VS 2010 w/ SP1
sfc /scannow successfully replaced the msvcr120_clr0400.dll file, but it replaced it with the exact same CTP file as before!
EDIT:
The problem dll's from my system are available for download here:
32 bit
64 bit
32 bit msvcr
64 bit msvcr
Microsoft is aware of this issue with KB3098779 and 3097997:
https://support.microsoft.com/en-us/kb/3118750
The recommendation is to uninstall these patches and then rescan for updates. Newer versions of these security patches (that do not break the VB compiler) are now available.
Okay, I see it from the files you uploaded to the sharing service, your .NET install is corrupted. A standard DLL Hell problem, your c:\windows\syswow64\msvcr120_clr400.dll file is the wrong version. Something you can see when you use Explorer and navigate to the file. Right-click and select Properties, look at the Details tab.
Note the word "CTP" in the Product name, means "Community Technology Preview". A Microsoft term that means "beta version". Clearly you should not be having the VS2013 beta on your machine. Your msvcp120_clr0400.dll is correct, it is file version 12.0.52512.0. It depends on an exported function in the msvcr DLL that the CTP version did not yet have.
Exactly how this happened is always hard to reverse-engineer. You are the 3rd SO user that I know of that had this problem this week, a bit too much of a coincidence. Two basic scenarios, if you ever had the VS2013 CTP edition installed on the machine then the problem is that it didn't get updated like it should have. Otherwise a very typical problem with CTP editions, they are pretty dangerous because the uninstaller is always the last thing Microsoft gets right. And the problem was just never detected until you started using a program that required this export.
Or it was caused by a rogue installer, copying the old version onto your machine without checking the version number. Much less likely, installers never have a good reason to install this particular file since it is only ever used by the .NET Framework. My money is therefore on your machine getting corrupted by the CTP.
You need to solve this by getting your machine fixed. Not that easy, you can never be sure how many other bad DLLs are lying around from such a bad CTP uninstall. A shortcut is copying this particular DLL from a good machine. But best to get .NET 4.6 re-installed.
EDIT from OP:
This answer correctly identified the problem files but reinstalling (or any other common steps) didn't solve it. In the end I copied "good" files from another computer with the version number 12.0.20806.33440.
KB3098779 appears to be the culprit on our server. That is the patch that installed the rogue CTP msvcr120_clr0400.dll mentioned in the above answer.
Solution: we reversed out the patch set that applied KB3098779, and everything is working again.
FYI: this is a .NET framework 4+ issue, not Visual Studio. Our server is a standard 2012 IIS server: Visual Studio is not installed.
I had the same issue on Windows 8.1 although KB3098779 and 3097997 were not installed on my machine. Probably it happened after installation of ASP.Net 5.
The issue was that I had both mcvcr files in version 12.0.51670.34230 while mcvcp files were already in 12.00.52512.0. It was enough to copy both mcvcr files (from System32 and SysWOW64) in this version from my colleague's pc.
If you have problems with permissions set to TrustedInstaller on these file, you can run this powershell command and then change permissions as Administrator:
takeown /A /F C:\windows\syswow64\msvcr120_clr0400.dll
Microsoft have issued a notice on this.
https://support.microsoft.com/en-us/kb/3118750
As others have pointed out too many people in too short a time to be a coincidence. Not a VS issue, this is to do with a bad update from Microsoft.
The info from MS mentions two security patches (KB3098779 and KB3097997).
I have uninstalled only KB3098779 and my site is up was up and running. It required a machine restart to complete
KB3097997 uninstalled without a restart. I maybe didn't need to uninstall but seems sensible given it is also subject to the same notice from MS.
Right now I'm developing a Windows Mobile 6.0 application. When I want to test the user interface, I deploy the application from Visual Studio 2008 to the emulator or a physical device. Unfortunately the deployment is really slow, because the IDE is installing some dependencies on each launch again.
Is there a way to avoid this somehow?
As it turned out, this is happening, because the referenced version of System.Data.SqlServerCe is different to the version on the device or in the emulator, which came with the Compact Framework. To solve this problem is just removed and added again the reference to the System.Data.SqlServerCe library.
I've found this solution here:
http://social.msdn.microsoft.com/Forums/en-US/68e8d920-edd5-4aab-aa4f-ba0bfcf42d26/vs2008-how-to-stop-sqlce-cab-from-deploying-on-every-debug-session
I searched around but I could not find anything on this.
I have programmed a c# application in VS 2010, targeted to .NET Framework 4.0. It has a .DLL and a few config files which I have being copied to the output directory upon compilation. It works great on my computer, I have .NET 4.0 Extended and .NET 4.0 Client installed. I set the build configuration to "release" on "any CPU".
After it compiles I copy all the files from the release directory to a folder on a shared drive, so that multiple computers on the network can execute it. When I execute it from the computer that I used to develop it, it runs great. When others try to execute it starts but just shows a small blank form, and that's it. I make sure that they have .NET 4.0 installed (Both Extended and Client, though I think the full version is what is really required).
I can't for the life of me figure out why it does this.
All machines are running 32 Bit Windows Vista SP2.
Any thoughts? Much appreciation for any help.
It can be a lot of things. First, like one comment, you should do a quick Deployment project and try to install on another computer to see how it work.
If you can't do that, here a couple of things to check:
It can be a network permission problem. I've seens an .NET application that could not be executed on the network for x reason but worked on the desktop. To check, make sur your user copy it on their computer before executing.
I don't think it's a .NET problem because it wouldn't let you start the application.
My guess is that one of your control/library (the one that is not showing) does not have the proper reference when run from another computer. To check, run the application "Dependency Walker" (you can find it on google) and see what DLL are missing from other computers.
That's all I can think for now ! Good luck! You just have to use ellimination method and you will find the problem.
I checked here: How do I get an XNA 4.0 game to run on other machines?, but there's no real solution in it.
I created a completely empty XNA4.0 project, selected Release and compiled it, rar'd up the Release folder and sent it to a non-development PC. Got an Appcrash generic error.
Its probably something standard I'm doing wrong, but no idea what..
Can confirm that both .NET4.0, XNA Redist 4.0 and DirectX are installed on the other machine.
UPDATE: The empty 'new game' loads now, but I have made a program or six over the last years, each of which doesn't run on the other machine. Could someone perhaps link me to 'proper' referencing, assemblies, and such? Google dropped those words more than once in combination with my problem.
UPDATE: I asked a friend to test on his PC, at first, same error, but he forgot to install the XNA 4.0 redist. After that, my files were running fine on his pc. Still, they're not working on my own non-development machine, for some reason. Anyway, thanks for the suggestions, now that I know its local I can probably fix it myself. Suggestions are still welcome.
The end-user needs to have .NET 4.0, the XNA 4.0 Redistributable (not the full game studio), and DirectX installed.
Is there the Dot-Net 4.0 and XNA 4.0 framework installed?
Choose to publish the project and you will get an installer that check and install required libraries for you...
I create a C# application with an injector in it. I'm using CreateRemoteThread & LoadLibrary technique to inject a C++ DLL into another process.
It works fine on my desktop which has VS 2008 installed but It doesn't work with my laptop which does not have VS 2008 installed.
I installed VS 2008 to my laptop and it's been working fine since then.
My question is Do I need to install the entire VS 2008 product (about 4GB) in order to have my program work properly or Do I just need to install or update certain components for it to work?
Even though my laptop is working fine right now but I don't want to waste a good chunk of hard drive for something that I don't really need. And It's always good to learn.
Thanks in advance
Andrew
You are missing the C++ runtime on the target machine. You can either:
Install the redistributable package for the runtime on the target machine.
Link to the runtime statically using the /MT switch.