Questions tagged [clr4.0]

57 questions
2
votes
3 answers

CLR2 Compiled C# COM Doesn't Work with .Net 4

Does anyone know why a C# created COM library that was compiled under CLR2 (.Net 3.5) doesn't work when used with only CLR4(.Net 4)? What is missing in CLR4 that is in CLR2 for COM? We are using the appropriate startup in the app.config to have the…
Rodney S. Foley
  • 9,444
  • 10
  • 44
  • 64
1
vote
2 answers

Most efficent way to use locks for modifying two related fields based on previous values?

I know their are faster\better ways using Interlocked.CompareExchange but I'm just looking for the best way if you are limited to locks. Joe Albahari says the following: It’s also possible to safely assign a new ProgressStatus object based on its…
Aaron Stainback
  • 3,164
  • 1
  • 27
  • 31
1
vote
2 answers

Will implementing the IDisposable interface move the object to the Finalize list?

I am reading now about the Dispose and the Finalize method on the CLR ( 4.0 ) I dont understand something ... If I add an implementation of Finalize ( ~className1 ) to my code => then the Finalize List have pointer to the object instance that in…
Yanshof
  • 8,974
  • 14
  • 81
  • 168
1
vote
0 answers

System.AccessViolation Exception and Heap block modified past requested size during PInvokes

I am running into System.AccessViolation Exception and Heap block modified past requested size when trying to PInvoke a native call from managed code. The native code is COBOL win32 dll. The issue is only in .NET 4.0 and it isn't an issue in…
Rush
  • 77
  • 1
  • 1
  • 6
1
vote
1 answer

.NET app.config file containing useLegacyV2RuntimeActivationPolicy not being used when app launched via file association

My app needs useLegacyV2RuntimeActivationPolicy in its .exe.config because it is a CLR4 app that uses mixed mode CLR2 assemblies. All is well when starting our app from the Start Menu, but if a user starts our app by clicking on one of their files…
shoek
  • 13
  • 3
1
vote
2 answers

Labview .Net events

I have a .Net 4 control /.dll which I am using with LabVIEW. The control exposes the following event: public delegate void CommNewDataEventHandler(UInt16 u16StageGroup, UInt32 u32Status , string [] strNewDataTitle, float[] fNewData, string[]…
drone
  • 53
  • 7
1
vote
0 answers

.NET 4.5 assembly loading

I'm hoping someone out there can explain this behavior that I'm seeing. There are 3 main parts to my problem: A Wise setup A Managed C++ assembly A C# assembly The Managed C++ assembly defines an interface, let's call it ISetupHelper. There is a…
Bryan
  • 2,710
  • 3
  • 25
  • 40
1
vote
1 answer

SQL Transaction commit leaves connection in corrupt state (c#)

Short: After a call to transaction.Commit(), the next operation fails as if the transaction was not committed. More details: We have a thread running write queries to the database, some of which are encapsulated in a transaction. When running…
Amit Bens
  • 1,277
  • 2
  • 12
  • 18
1
vote
1 answer

CLR Assembly Binding

All, I have few questions how program's assemblies bind to the underlying CLR version. 1) Is it possible to build/run .net 2.0 app that references .net 4.0 assemblies (which use CLR 4.0)? If so, how? 2) My understanding of the .net framework tells…
ActiveX
  • 913
  • 13
  • 31
1
vote
1 answer

GC in .NET 4.0 not affecting Working Set in task manager

OK, just to be clear, I understand that the Task Manager is never a good way to monitor memory consumption of a program. Now that I've cleared the air... I've used SciTech's .Net memory profiler for a while now, but almost exclusively on the .Net…
1
vote
1 answer

How to use Finalize with managed resources?

I'm not 100% clear on how an instance of class A can be defined to exist until after the last instance of class B is finalized. Or in other words, I'd like all B's to call close&dispose methods in A inside the B finalisation... and for that to…
sgtz
  • 8,219
  • 8
  • 46
  • 90
0
votes
1 answer

CLR Versioning + Framework Targeting, what is expected behaviour?

There is a lot of mismash of information out there regarding which version of the CLR an assembly will be loaded into so in hope to consolidate some answers to disambiguate the questions that follow in relation to CLR version When I am targeting…
Anastasiosyal
  • 6,130
  • 6
  • 31
  • 39
0
votes
1 answer

Getting SQLAgent username fails

I have the windows console program code below that should show up NT Authoroty\Network Service but surprisingly it spells NetworkService without a space... When I check the account the SQLAgent is running on it's indeed Network Service. Why does…
CoolStraw
  • 5,060
  • 8
  • 38
  • 64
0
votes
2 answers

C++ CLR loading .net 4.0 dll when .net 4.0 is not installed

I have an application, written on c++ and compiled with VS 2010. I need to load .net dll written on C# and compiled for .net 4.0 platform from c++ code and call some functions. I have already done this through C++ CLR and its calling .net functions…
Valentin
  • 790
  • 2
  • 8
  • 20
0
votes
1 answer

How to avoid unregistering of mscoree 2.4 during 2.0 installation?

I've an application that depend on a reference to mscoree 2.0 (from .net 2.0-3.5). I know that it isn't a good practice, but I've to live with it for now. The app is installed with standard msi (generated by Visual Studion setup project). My issue…
stic
  • 938
  • 3
  • 9
  • 23