Visual Studio unable to copy file because it is being used by another process


To try and get around this I closed VS and re-opened it. Still the same problem. In this scenario I then closed it again and on inspection of Task Manager I found that devenv was still running as a process (it was not in Applications). After Killing this extra devenv my computer blue screened. After restarting itself I was able to open my solution and build.

How do I use Refelection to get names and values of an object


Function GetWODataAsMessage(WO AsInteger) AsString


Dim result = (From w In context.WorkOrders Where w.WO = WO Select w).FirstOrDefault

If result IsNothing Then

Return String.Concat(“WO, “, WO, ” was not found”)


Dim msg = String.Concat(“Information for W-“, WO)

ForEach prop In result.GetType().GetProperties

If prop.CanRead Then

SelectCase prop.PropertyType

CaseGetType(Byte()), GetType(Business.EBC.EntityModel.Product)

‘Do Nothing

‘Case GetType(Business.EBC.EntityModel.Product)

‘ ‘Do Nothing

Case Else

Dim Tabs = String.Concat(vbTab, vbTab)

If prop.Name.Length < 4 Then

Tabs = String.Concat(vbTab, vbTab, vbTab)

ElseIf prop.Name.Length > 16 Then

Tabs = vbTab


‘, prop.PropertyType ‘Testing only

msg = String.Concat(msg, vbCrLf, prop.Name, Tabs, prop.GetValue(result, Nothing))

End Select



Return msg

End Function

How to store data with XML

  1. One option is to set-up a dataset
  2. Add a manual table and columns.
  3. Add XML file
  4. See first two lines here

<?xml version=”1.0″ standalone=”yes”?>
<dsSystemNames xmlns=””&gt;

  1. It is very fussy about format. For instance DateTime format must have T and full time down to hundreths of a second

SQL Profiler Templates

With a lot of “noise” from hits on the live data I want the ability to see what my development code is hitting for SQL. In this particular case I want to understand the SQL that Entity Framework is generating.

The default location of SQL Profiler templates is (possibly 90 or 100 or other):

C:\Users\<USERNAME>\AppData\Roaming\Microsoft\SQL Profiler\10.0\Templates\Microsoft SQL Server\100

Events to include:



NTUserName = ‘<>’
ApplicationName Not Like ‘<>’


Could not load file or assembly … or one of its dependencies. The module was expected to contain

Possibly the reference is an executable program. Solution is:

  1. Right-click on project not building properly – Project Build Order
  2. Check that the reference is higher in the list
  3. If not then use Dependencies tab to add the required dependency which changes the Build Order

Similar to