Can´t open my c# app on some Windows 7 computers - c#

I´m receiving the following logs from the system events. I have no idea why this only happens on some machines:
Level: Information; Source: Windows Error Reporting
Detail: 756021398 30 CLR20r3 Not available 0 DayZ Ambient Launcher.exe 1.0.0.0 59d3d3b2 System.Windows.Forms 4.7.2558.0 59d4145b 63d 36 PSZQOADHX1U5ZAHBHOHGHLDGIY4QIXHX
C:\Users\kevo1414\AppData\Local\Temp\WERAA52.tmp.WERInternalMetadata.xml C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_DayZ Ambient Lau_4e74decfa163bcb1cc9a3fc7dd961b8b6b975b8_108bafbf
0 093ea276-bf39-11e7-b709-902b345e4b59 0
Level: Error Source: Application Error
Detail:
DayZ Ambient Launcher.exe 1.0.0.0 59d3d3b2 KERNELBASE.dll 6.1.7601.23915 59b94abb e0434352 0000c54f 1498 01d35345cae21649 C:\Users\kevo1414\Downloads\DayZ Ambient Launcher 1.1 [eXWoLL,Cobblest0ne]\DayZ Ambient Launcher.exe C:\Windows\syswow64\KERNELBASE.dll 093ea276-bf39-11e7-b709-902b345e4b59
Level: Error Source: .NET Runtime
Detail:
Application: DayZ Ambient Launcher.exe Framework Version: v4.0.30319 >Description: The process was terminated due to an unhandled exception. Exception Info: System.Runtime.InteropServices.COMException at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(System.Guid ByRef, System.Object, Int32, System.Guid ByRef) at System.Windows.Forms.AxHost.CreateWithLicense(System.String, System.Guid) at System.Windows.Forms.AxHost.CreateInstanceCore(System.Guid) at System.Windows.Forms.AxHost.CreateInstance() at System.Windows.Forms.AxHost.GetOcxCreate() at System.Windows.Forms.AxHost.TransitionUpTo(Int32) at System.Windows.Forms.AxHost.CreateHandle() at System.Windows.Forms.Control.CreateControl(Boolean) at System.Windows.Forms.Control.CreateControl(Boolean) at System.Windows.Forms.AxHost.EndInit() at dayz64.Form1.InitializeComponent() at dayz64.Form1..ctor() at dayz64.Program.Main()

There are two possible causes that I can see: operating system mismatch, or .NET installation mismatch.
Windows 7 was around right when x64 was being introduced, so there are some installations that either use x32 or x64, and going between them can result in issues if you don't install the right version of the application.
If you're going to run this application on a Windows 7 computer, then open the Start Menu, right click on Computer, and click on properties. You can see the specs of the operating system you're running from there.
The second possible issue is a .NET installation issue - maybe you have an outdated version of .NET installed, or the application relies on a legacy version of .NET and can't run on the newer frameworks, in which case you would need to look up the specifications of the product and the version you're using.
Hope this helped!

Related

Buffer Overflow in clr.dll at application start-up

I have two computers. Both work under Windows 7 Embedded and have same version of .Net 4.0 framework installed.
My WinForms application works with no issues on one of them but fails at start-up with BEX in clr.dll on another.
Problem Event Name: BEX
Application Name: Myapplication.exe
Application Timestamp: 5669ec33
Fault Module Name: clr.dll
Fault Module Version: 4.0.30319.526
Fault Module Timestamp: 4eb3b6b1
Exception Offset: 002b65ec
Exception Code: c0000409
Exception Data: 00000000
OS Version: 6.1.7601.2.1.0.320.65
Locale ID: 1033
Additional Information 1: a835
Additional Information 2: a835052745ddb3bce091e0cd181de7e7
Additional Information 3: 7cb8
Additional Information 4: 7cb8eec426d05584b36071af9d74719d
What is very "strange"
I was able to find two things in my application that somehow have impact or provoke this problem.
First I found exact line of code.. I have few buttons that I manually create manually on UI thread. And if I remove next line my application starts.
btn.Font = new Font("Tahoma", 9, FontStyle.Bold, GraphicsUnit.Point, 0);
Second I noticed that if I use my debug logger which uses StackFrame to find out where log message is coming form, Application will crash with the same error in CLR but at some other place. Not at the line I mentioned above.
My two computers have different RAM. 2GB and 1GB. Application fails on the second one with 1GB of memory. But application iself uses 30 MB and system has ~350 MB of free memory. Could memory be a reason ?
My research for the most part referred me to different hot-fixes issued by Microsoft. I tried them but nothing helped. I also tried to install .Net v4.5 but with the same negative result.
Where else I can start looking for the problem ?
... And yes, this problem does not show up when running application with attached debugger.
Update
I just realised that "Exception Code: c0000409" means STATUS_STACK_BUFFER_OVERRUN. This brings some sense to strange application behaviour that I have but still not clear why it works on one computer but does not work on another.
Solution finally found
My application uses third party C# library which is actually a wrapper on top of calls to other native library. I decompiled library and realised that calling convention is set to CallingConvention.Cdecl but as I see from Dependency Walker application, all methods in native library has CallingConvention.StdCall
After changing calling convention and recompiling the library issue disappeared.

Services crashed with event name [CLR20r3] [duplicate]

This question already has answers here:
Deciphering the .NET clr20r3 exception parameters P1..P10
(2 answers)
Closed 8 years ago.
I have created a service in .Net c# that basically send emails periodically.
The service works fine on my x32 XP machine but when i deploy the x64 build on an another 'x64' based Windows Server 2008 R2 machine, the service starts and just stops after few seconds and in event log it has this:
Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: sentEmailDraft.exe
P2: 4.2.0.0
P3: 538d3cf1
P4: mscorlib
P5: 2.0.0.0
P6: 4ca2b851
P7: 20f4
P8: d4
P9: System.TypeInitialization
P10:
Attached files:
These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportQueue\AppCrash_sentEmailDraft._87f56e55f14a51a946ed1a1f9f2a3a31cf693a17_1839149a
Analysis symbol:
Rechecking for solution: 0
Report Id: b3695789-f45c-11e3-b6c6-005056be2c69
Report Status: 4
I found a similar discussion here and tried the solution but didnt work for me.
Can anyone please suggest something?
I had a problem similar to this once with the service starting and then quickly stopping afterward. The second computer only had the .NET Framework 4.0 Client Profile installed, while the application relied on features/assemblies that were only present in the full .NET Framework 4.0. Might be worth checking since the full .NET Framework 4.0 is the default when you create a new project.

C# .Net App On Windows XP Fails Shell32 Code for Renaming Shortcut

I have a situation where I have a windows Desktop APP in .Net C# that must on both Windows 7 and Windows XP rename a shortcut. I have it working in Windows 7 but on XP this fails.
.Net 4.0 Client Profile and Extended is installed on XP and all other parts of the applciation are functioning on XP. The project has a reference Interop.Shell32 (MIcrosoft Shell Controls and Automation through COM Interop rahter than pinvoke) and the code is simply the following:
var shl = new Shell32.Shell();
argStrLnkPath = System.IO.Path.GetFullPath(argStrLnkPath);
var dir = shl.NameSpace(System.IO.Path.GetDirectoryName(argStrLnkPath));
var itm = dir.Items().Item(System.IO.Path.GetFileName(argStrLnkPath));
itm.Name = "My Shortcut Name";
The above works in 7 but not XP. The following versions of the Shell32.dll exist:
Win7 Shell32.dll version 6.1.7601
WinXP Shell32.dll version 6.00.29.6242
When I spy the XP shell32dll in the object browser, the same objects exist, so the functionalty should be there (unless I'm not seeing something important).
My project is set to build as x86 platform for both machines. For the reference, I have tried the Embed Interop Types as True and also copy local as False.
I have an msi installer but is there something I need to do on the target XP machine? And should I copy Local? Any ideas on the propper way to get this working?
I have run the code on that XP Machine and receive the following from teh Event Viewer:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidCastException
Embed Interop Types for Reference = True: The stackTrace for this error is:
Unable to cast COM object of type 'System.__ComObject' to interface type 'Shell3
2.Shell'. This operation failed because the QueryInterface call on the COM compo
nent for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed
due to the following error: No such interface supported (Exception from HRESULT:
0x80004002 (E_NOINTERFACE)).
Embed Interop Types for Reference = False: The stackTrace for this error is:
Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.IO.FileNotFoundException
Issue Solved! I hadn't realized that when you make those types of COM Interop inclusions, they must have a Setup Project (msi installer if going on another system). Also, another caveat is that if you have already created a setup project, you must Add > project Output again. This will automatically pull all of those interop inclusions in under the Detected Dependencies folder. This solved my issue.

C# windows application Event: CLR20r3 on application start

I created a C# application and installed it on my test box. My app works perfect on my dev box, but when I install in on a different machine it crashes in the Main(). I get the EventType: CLR20r3
here is the Event Message
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: logfileviewer.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4f356c9c
Problem Signature 04: LogFileViewer
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4f356c9c
Problem Signature 07: 94
Problem Signature 08: 44
Problem Signature 09: System.IO.FileNotFoundException
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
I used the details and looked up the error code in IL Disassembler and cam back with the following...
Method #5 (06000094)
-------------------------------------------------------
MethodName: .ctor (06000094)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x000081d0
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments.
.NET 4.0 has been uninstalled and re installed on the system and did not change anything. I have searched all over the net and everyone with the same problem do not seem to have a solution. I have now spent a day and a half on this problem. I would hate to miss my deadline do to not being able to launch the application.
This is the only code in my Main()
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
Here are the details from the Event Viewer
Application: LogFileViewer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at LogFileViewer.frmMain.InitializeComponent()
at LogFileViewer.frmMain..ctor()
at LogFileViewer.Program.Main()
EventData
Application: LogFileViewer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack: at LogFileViewer.frmMain.InitializeComponent() at LogFileViewer.frmMain..ctor() at LogFileViewer.Program.Main()
Not sure how the designer can have a FileNotFound Exception. I am using the DotNetBar.dll and I am referencing it out of the install directory, so that should be good. I can post my designer if you want, but there is quite a bit there.
I've seen this same problem when my application depended on a referenced assembly that was not present on the deployment machine. I'm not sure what you mean by "referencing DotNetBar out of the install directory" - make sure it's set to CopyLocal=true in your project, or exists at the same full path on both your development and production machine.
I encountered the same problem when I built an application on a Windows 7 box that had previously been maintained on an XP machine.
The program ran fine when built for Debug, but failed with this error when built for Release. I found the answer on the project's Properties page. Go to the "Build" tab and try changing the Platform Target from "Any CPU" to "x86".
.NET has two CLRs 2.0 and 4.0. CLR 2.0 works till .NET framework 3.5. CLR 4.0 works from .NET 4.0 onwards. Its possible that your solution is using a different CLR than your reference assemblies. In your local development environment, you might have both the CLRs and hence you did not faced any problem. However when you moved to deployment environments, they might have a single CLR only and you got this error.
Have been fighting this all morning and now have it solved and why it happened. Posting with the hope it helps others
I installed the Krypton.Toolkit which added the tools to the Visual studio toolbox automatically. I then added the tools to the designer, which automatically added the dll to the projrect references, however the toolkit was marked as CopyLocal=false
I built an installer, using all dlls in the release build folder (of course the above dll wasn't there).
Setting copylocal=true, then rebuilding the installer, everything worked fine.
To solve CLR20r3 problem set - Local User Policy \ Computer Configuration \ Windows Settings \ Security Settings \ Local Policies \ Security Options - System cryptography: Use FIPS 140 compliant cryptographic algorithms, including encryption, hashing and signing - Disable

.NET application won't open in windows 7

I created a pretty simple c# application using visual studio 2010 on windows xp. It compiles, runs and debugs fine on my machine. I even built it for release and ran the .exe on my machine and another windows xp machine perfectly fine. When I send the release folder with the .exe file and they open it, nothing happens! No errors or anything, just blank!
.NET version 4 framework installed
It is a windows form application.
UPDATE: Details from OP's comments given to one of the answers below:
Hey everyone, thanks for the ideas. I
copied what I found on my friends
windows 7 machine event log and this
is what it said:
Application: ePrescribing.exe Framework Version: v4.0.30319
Description: The process was
terminated due to an unhandled
exception. Exception Info:
System.IO.FileNotFoundException Stack:
at
ePrescribing.frmApp.InitializeComponent()
at ePrescribing.frmApp..ctor() at
ePrescribing.Program.Main()
Faulting application name: ePrescribing.exe, version: 1.0.0.0,
time stamp: 0x4d61e693 Faulting module
name: KERNELBASE.dll, version:
6.1.7600.16385, time stamp: 0x4a5bdbdf Exception code: 0xe0434352 Fault
offset: 0x0000b727 Faulting process
id: 0xb38 Faulting application start
time: 0x01cbe1dbe6d4ba2d Faulting
application path:
C:\Users\Duane\Downloads\ePrescribing.exe
Faulting module path:
C:\Windows\syswow64\KERNELBASE.dll
Report Id:
266adc61-4dcf-11e0-8438-e0cb4e197cde –
Fault bucket , type 0 Event Name: CLR20r3 Response: Not available
Cab Id: 0 Problem signature: P1:
eprescribing.exe P2: 1.0.0.0 P3:
4d61e693 P4: ePrescribing P5: 1.0.0.0
P6: 4d61e693 P7: 28 P8: e P9:
System.IO.FileNotFoundException P10: –
I removed the only area where I
thought there would be a file load
(for the picturebox loading
profile.jpg) and still got the same
error. Any ideas?
First, you might try checking the Event Viewer for any relevant errors messages (as stated above).
Next, make sure they have .NET installed (as stated above).
Then, try adding an UnhandledExceptionEventHandler to your application and in that handler, try to at least write a simple log/text file containing the exception that caused your application to exit.
Make sure the latest .NET framework is installed.
Check .NET framework installed on win7 computer equal your application framework target.
Check in the process explorer that it's running but didn't show you anything.
Check event log for crash reports.
Try to add logging to your application in different places and add unhandled error handlers.
Additionly to other answers I would also check whether your app compiled against x86/x64 runtime
Have you included a manifest file?
Take a look at this.
Or this...
Are you accessing any folders via static paths instead of environment variables? That could cause issues between these versions of Windows.
You should check if all other third party assemblies can be found either in GAC or app folder
Referenced assembly may be missing from target computer. Please set Copy Local=True for all referenced library. This may solve your issue.

Categories

Resources