0

I have read that versioning can be a problem if a project is split into multiple DLLs. I am trying to introduce a versioning problem to understand what it means. I have two simple projects i.e. a windows forms application and a class library. Here is the form:

Imports ClassLibrary1

Public Class Form1

    Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim c1 As Class1 = New class1
        c1.TEST()
    End Sub
End Class

Here is the class library:

Public Class Class1
    Public Sub TEST()
        MsgBox("TEST1")
    End Sub
End Class

Please see the version number of the windows form app below:

enter image description here

Please see the version of the class library below:

enter image description here

When I build the project I get an executable and a DLL as expected. I have followed these steps in an attempt to introduce a versioning problem:

 1) Build the project
 2) Go to the bin folder and create a copy of debug/WindowsApplication1.exe 
 3) Go into the DLL properties and change the DLL version in Visual Studio
 4) Rebuild the project
 5) Overwrite the .EXE in the BIN folder (debug/WindowsApplication1.exe) with the .EXE copied in step 2
 6) Launch the .EXE in the bin folder

I thought I would see an error at step five as an old version of the .exe is using the new DLL. However, the program runs as expected. What am I missing? I realise this is a basic question. I have Googled it this afternoon.

3
  • You probably copied the wrong EXE. Step 5 should fail, the .vshost.exe can't be overwritten while the project is loaded. Your repro steps certainly are not detailed enough, starting with describing a "bin" folder that doesn't contain any EXE. May 23, 2013 at 22:58
  • what about configuration manager and your compile dependency? You have to check that also when you work at VS solution with multiple dlls and exe's
    – luchosrock
    May 24, 2013 at 0:45
  • @Hans Passant,thanks. I have edited the repro to hopefully make it clearer.
    – w0051977
    May 24, 2013 at 18:31

1 Answer 1

2

The GUID is the more important part. Open up your vbproj file (or csproj file for future readers) and see how the .EXE vbproj references the .DLL project.

The numbers (on the version) which you are changing .... are kinda like friendly FYI's.

If the GUID matches and there are not breaking changes, your old exe can use the new dll and vice versa.

  <ItemGroup>
    <ProjectReference Include="..\MyDll\MyDll.csproj">
      <Project>{33333333-3333-3333-3333-33333333333}</Project>
      <Name>MyDll</Name>
    </ProjectReference>
  </ItemGroup>

EDIT:

You may want to try:

Changing the signature of your method.

Public Sub TEST(s as String)
    MsgBox("TEST1")
End Sub

Or change the name (which is the same as removing it)

Public Sub TEST1()
    MsgBox("TEST1 Msg")
End Sub

Or change the GUID of the "DLL" project in the project properties (that you already know about from your screen shot above)

3
  • Thanks. Where are the references stored at runtime?
    – w0051977
    May 23, 2013 at 21:23
  • When you build the DLL, they are "compiled into" the dll or exe. May 23, 2013 at 21:24
  • Thanks +1.i will try your suggestions tomorrow and then come back to the post to mark the answer.
    – w0051977
    May 23, 2013 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.