1

I developed a WPF Application with C# and LocalDB (.mdf file). It works fine on my laptop (win10, 64bit) but it keeps showing the same error when I tried to install it on another PC (win7, 32bit). I installed 4.5.2 .Net framework, SQL server express LocalDB 2012 & SQL server express 2014. Still the same error keeps on showing ! I checked many other Questions with the same issue yet the solutions didn't work !

Also this is my first time with WPF & C# !

Problem signature: CLR20r3

Problem signature:‎ 01: CET_staff.exe

Problem signature:‎ 02: 1.0.0.0

Problem signature:‎ 03: 58737888

Problem signature: 04: System.Data

Problem signature:‎ 05: 4.6.1590.0

Problem signature:‎ 06: 5787ef07

Problem signature:‎ 07: 1d3b

Problem signature:‎ 08: 27

Problem signature:‎ 09: System.Data.SqlClient.Sql

Community
  • 1
  • 1
ArwaSh
  • 11
  • 4
  • You need to add error handling / logging – ErikEJ Jan 19 '17 at 12:27
  • Possible duplicate of [Windows Application has stopped working :: Event Name CLR20r3](http://stackoverflow.com/questions/5701767/windows-application-has-stopped-working-event-name-clr20r3) – Mat Jan 20 '17 at 07:19
  • maybe this has something to do with Arabic language? – Mat Jan 20 '17 at 07:22
  • @Mat It's true the application contains Arabic characters. – ArwaSh Jan 22 '17 at 20:33
  • This is just because the application is built in non unicode language fonts and you are running the system on unicode fonts. change your default non unicode fonts to arabic by going in regional settings advanced tab in control panel. That will solve your problem. -> Answer from the duplicate question – Mat Jan 23 '17 at 10:25
  • @Mat It still doesn't work even after changing the default non-unicode language. – ArwaSh Jan 27 '17 at 01:31

2 Answers2

0

This can happen if you have a wrong target framework. For me Client Profile sometimes breaks it. Please check it on your project properties.

enter image description here

There are also some other causes: http://hasstoppedworking.com/fix-clr20r3-event-issues/

You can also try to run it on other machines/OS to make it more clear what causes the Error. Most likely Win7...

Mat
  • 1,960
  • 5
  • 25
  • 38
  • The target framwork is .Net 4.5.2 and I downloaded it on the client PC. so I don't think it's the issue! – ArwaSh Jan 19 '17 at 18:17
-1

I used localDB always with .NET Framework above 4.0 which is not 4.0 because I also experienced this.

You can check this blog from Microsoft but must read carefully the blog says 4.0.2 enables localdb, not 4.0

In other word, it's simply impossible to use localdb with .NET Framework 4.0

https://blogs.msdn.microsoft.com/sqlexpress/2011/10/27/net-framework-4-now-supports-localdb/

You can set through prerequisites on Publish menu so that all clients computer to be updated to proper version for localdb.

Hope this helps...

Kay Lee
  • 922
  • 1
  • 12
  • 40
  • Actually its 4.5.2 .Net framework! sorry I just edited the question. – ArwaSh Jan 19 '17 at 18:32
  • @CamiloTerevinto, ok I removed the part. Please focus on the essence not the extra things. OP commented about 4.0 and my answer is in accordance with the point. – Kay Lee Jan 20 '17 at 00:26
  • @ArwaSh, sorry, my answer didn't help you. However, I also crushed this kind of CLR problem but finally solved. Time passed but as I remember, I used remote debugger of Visual Studio with connecting with the client pc. Have you tried remote debugging for this issue? – Kay Lee Jan 20 '17 at 00:31
  • @ArwaSh, For your serious reference, why do you use localDB and SQL express 2014 together ? My case is also C#, WPF but changed database strategy from localDB to SQL express because localDB doesn't support networking as it's called as localDB. I think you don't need to use localDB and SQL express together. Like me, if you use SQL express only for client pc (or together with the other client PCs connected by LAN), SQL express server would just play a role as for your local DB. Using unnecessary additional Server requires more resources and influences performance. – Kay Lee Jan 20 '17 at 01:00
  • @KayLee When I deployed the application Both localDB and SQL Express 2014 were prerequisites. I personally don't know which to use but thanks for your explanation. I'm just using the application on one client not connected to any server. – ArwaSh Jan 22 '17 at 19:52
  • @ArwaSh, as I explained, local or not local is matter of relativity. If your application will be used really on the client pc only, not even connected with LAN(local area network). I'd recommend localDB because it's really compact, light(occupy smaller memory), little bit faster and optimized form of database just like for your case. – Kay Lee Jan 23 '17 at 00:10