Argh DLL Hell

I thought .net ended this, but I am in DLL Hell, I cannot rebuild my project, I get the following error:

------ Rebuild All started: Project: NWizard.Common, Configuration: Debug .NET ------

Preparing resources...
Updating references...
Error: The dependency 'NWizard.Common, Version=1.0.1934.35935, Culture=neutral' in project 'NWizard.Common' cannot be copied to the run directory because it would conflict with dependency 'NWizard.Common, Version=1.0.1934.35920, Culture=neutral'.
Warning: The dependency 'NWizard.Interop, Version=1.0.1934.35935, Culture=neutral' in project 'NWizard.Common' cannot be copied to the run directory because it would overwrite the reference 'NWizard.Interop, Version=1.0.1934.36023, Culture=neutral'.
Error: The dependency 'NWizard.Common, Version=1.0.1934.35920, Culture=neutral' in project 'NWizard.Common' cannot be copied to the run directory because it would conflict with dependency 'NWizard.Common, Version=1.0.1934.35935, Culture=neutral'.
Performing main compilation...

Build complete -- 0 errors, 0 warnings
Building satellite assemblies...

I've tried deleting all the assemblys in the output dir and rebuilding but I still get that, do I have a circular dependancy or something

Thanks, Martin.


Answer this question

Argh DLL Hell

  • sunzhoujian

    Looks like that you are using auto generated AssemblyVersion for starters.

    In your AssemblyInfo.cs (or AssemblyInfo.vb) you probably have the following line:

    [assembly: AssemblyVersion("1.0.*")]

    This is what Visual Studio gives you by default and its a bad thing.

    I would change the above to:

    [assembly: AssemblyVersion("1.0.0.0")]

    It is recommended that you only change the AssemblyVersion at the start of a new reason. The * causes Visual Studio to change your AssemblyVersion every time you build, this can causes issues like the above.

    Once you have done the above, close Visual Studio and delete the Bin and Obj folders within all the projects.  Restart Visual Studio and it should be fixed.



  • Milque

    I think you are mixing 'Project' references and direct assembly references.
    Check each projects settings and make sure the references for your solution are project type, the rebuild.

    if you've fiddled the build order or set some projects to not build you. Might need to reset the solutions configuration and let vs sort out the correct build order based on the dependancies.




  • zxeltor

    To me it looks like the DLL ''NWizard.Common' which you have is being used by multiple projects in your Solution and each one is referring to a different version of the same NWizard.Common.dll.

    One way to fix this is to fix the version numbering as has been already explained. Otherway is to remove the NWizard.Common.dll from being Built each time if thats something that does not change often and make sure all your projects are referencing the same version. You might as well take off the Project reference and add DLL reference to this DLL so that all projects reference the same version.

    Vikram
    http://dotnetupdate.blogspot.com/


  • Argh DLL Hell