0

I'm using visual studio 2015 I have an WPF application consists of 5 projects in one solution I need to change the name of 3 of them to be like (helper03.dll instead of helper.dll, UIResources03.dll instead of UIResources.dll & Utility03.dll instead of Utility.dll )(I need to change the output dll name not the project name itself ) when I do that from property window and change assembly name, try to rebuild , visual studio gives me errors that he can't find helper.dll, UIResources.dll & Utility.dll visual studio always looks for the original names I make some search and found that I have to manually change the .csproj files for each dll project but actually I couldn't understand any thing I found some thing like this:

 <AssemblyName Condition=" '$(MyAssemblyName)' != '' ">$(MyAssemblyName)</AssemblyName>

then pass MyAsseblyName in the msbuild task. I couldn't find out how to use msbuild to pass the assembly name

Can you please show me how to do that in details Many thanks in advance

Hazem Elamir
  • 51
  • 1
  • 8
  • Are all references within your solution to the changed projects "project references"? Or are some of these references added by browsing for the assemblies? – Klaus Gütter Nov 08 '20 at 07:05
  • all projects are referenced in loaded & referenced in my solution and referenced to others, meaning UIResources.dll is project in my solution and referenced in all the other projects, helper.dll & Utility.dll also are projects and referenced in my solution Reference to the project it self not to the dll files – Hazem Elamir Nov 08 '20 at 18:42
  • I made simple solution contains many dll & wpf projects I found that when I change the Assembly Name property, it compiles fine, the problem in wpf references. when i rename UIResources.dll to UIResources03.dll , I need also to change the wpf references in all projects to be xmlns:UIres="clr-namespace:UIResources;assembly=UIResources03" instead of xmlns:UIres="clr-namespace:UIResources;assembly=UIResources" in all over my solution, which is annoying , Is there is an automatic way to rename these declaration automatically upon changing the Assembly Name without using find and replace? – Hazem Elamir Nov 08 '20 at 21:52
  • Take a step back: why would you need to change the AssemblyName at all? Would [changing the assembly file name](https://stackoverflow.com/questions/28301058/how-to-change-the-output-name-of-an-executable-built-by-visual-studio/44188341#44188341) be sufficient for your purpose? – Klaus Gütter Nov 09 '20 at 05:25
  • yes, its the only solution that i found i'm creating separated plugins which have shared dll projects when i'm updating these base projects and have new plugin, the base application load the base files of one plugin and ignore the rest because they have the same name, and all my plugins refer automatically to them which is not correct and crash my apps or gave wrong data, – Hazem Elamir Nov 09 '20 at 19:35
  • i tried strong name for my base files & assembly load file and assembly resolve but i couldn't succeed in that, i can't also use same folder and override the old ref. dlls because this crash the old plugins, so i have to rename them so the base application load every dll and use them correctly , i hope if there is an better solution, thanks – Hazem Elamir Nov 09 '20 at 19:36
  • There are a couple of SO questions around loading multiple versions of the same assembly, e.g. https://stackoverflow.com/questions/4451220/loading-multiple-versions-of-the-same-assembly (other answers linked from there). – Klaus Gütter Nov 09 '20 at 19:40

0 Answers0