We are getting the error message noted in the subject line. It just started today.
Environment:
- OS - WinXP SP3 with all the latest updates.
- Visual Studio 2008 with all the latest updates.
Steps to recreate the problem:
Open Visual Studio and create a VB Class Library project. Add the following property and property method to Class1:
Protected mProperty1 As String
Public Property Property1() As String Get Return mProperty1 End Get Set(ByVal pProperty1 As String) mProperty1 = Left(pProperty1, 100) End Set End Property
Compile the project.
Open a second copy of Visual Studio and create a VB Windows Application project.
Add a reference to \Projects\ClassLibrary1\bin\debug\ClassLibrary1.dll
Compile the project.
Alt-tab to the Class Library project and change the Left(pProperty1, 100) to Left(pProperty1, 50).
Compile the project.
Alt-tab to the Windows Application project.
The error list shows two errors:
Error 1 Unable to load referenced library 'D:\Visual Studio 2008\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll': The process cannot access the file because it is being used by another process.
Error 2 Unable to load referenced library 'D:\Visual Studio 2008\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll': The process cannot access the file because it is being used by another process. D:\Visual Studio 2008\Projects\ClassLibrary1\bin\Debug\ClassLibrary1.dll
If I close the Windows Application project (leaving Visual Studio open) and re-open it, the error goes away and the project compiles.