The located assembly’s manifest definition does not match the assembly reference

I am trying to run some unit tests in a C# Windows Forms application (Visual Studio 2005), and I get the following error: System.IO.FileLoadException: Could not load file or assembly ‘Utility, Version=1.2.0.200, Culture=neutral, PublicKeyToken=764d581291d764f7’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)** at … Read more

What’s the difference between SoftReference and WeakReference in Java?

What’s the difference between java.lang.ref.WeakReference and java.lang.ref.SoftReference ? 12 s 12 From Understanding Weak References, by Ethan Nicholas: Weak references A weak reference, simply put, is a reference that isn’t strong enough to force an object to remain in memory. Weak references allow you to leverage the garbage collector’s ability to determine reachability for you, … Read more

What’s the difference between the ‘ref’ and ‘out’ keywords?

I’m creating a function where I need to pass an object so that it can be modified by the function. What is the difference between: public void myFunction(ref MyClass someClass) and public void myFunction(out MyClass someClass) Which should I use and why? 27 s 27 ref tells the compiler that the object is initialized before … Read more

How do I pass a variable by reference?

Are parameters are passed by reference or value? How do I pass by reference so that the code below outputs ‘Changed’ instead of ‘Original’? class PassByReference: def __init__(self): self.variable=”Original” self.change(self.variable) print(self.variable) def change(self, var): var=”Changed” 3 36 Arguments are passed by assignment. The rationale behind this is twofold: the parameter passed in is actually a … Read more