title: VS2010 Can't find assembly after it is renamed
body: <p>I have a solution which consists, to put it simply, a Windows Forms Application project and a Class Library, both in C#. My library project was named <code>OldName</code>. Thus the namespace was also <code>OldName</code> and the generated file was <code>OldName.dll</code>.</p>
  
  <p>I wanted to change the name, so I went into Properties, and changed the Assembly Name from <code>OldName</code> to <code>NewName</code>.</p>
  
  <p>Building now generates a <code>NewName.dll</code>. However, the moment my application tries to access this dll, I get a <code>System.Runtime.Serialization.SerializationException</code> (the dll contains my methods for binary-serializing some stuff): It claims that <code>Unable to find assembly 'OldName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.</code>Procmon.exe confirms that it is looking for the old dll (<code>NAME NOT FOUND</code>).</p>
  
  <p>Now the strange thing is, if I copy the <code>NewName.dll</code> and rename it to <code>OldName.dll</code>, so that I have <code>OldName.dll</code> and <code>NewName.dll</code>, the problem persists. If I delete <code>NewName.dll</code> and only leave <code>OldName.dll</code>, the program crashes at launch with: <code>System.IO.FileNotFoundException: Could not load file or assembly 'NewName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</code> This time, Procmon.exe reports that it failed a <code>CreateFileMapping</code> operation on <code>OldName.dll</code> because <code>FILE LOCKED WITH ONLY READERS</code>, but it seems it gets the same thing on <code>NewName.dll</code>.</p>
  
  <p>Changing the Assembly Name back to <code>OldName</code> fixes everything, but of course then the file name becomes <code>OldName</code> and I don't want that.</p>
  
  <p>I can't for the life of me figure out where else it references the old assembly name. What could I be missing?</p>
  
  <p><strong>SOLUTION:</strong> My program allows the user to create a file, and then save it to the disk using serialization with the methods in my dll. It also Allows loading the file. Being lazy, I had made a test file once, and kept reusing it. Turns out, as @Tigran suggested, the old Assembly name still appeared inside the serialized data file, so when I attempted to load it from my program I was getting an exception because it couldn't find the assembly referenced <em>in the serialized file</em>.</p>