Oct 15, 2011 Adding WCF Service References to multiple projects. Ask Question 5. A couple of very basic questions. I am new to WCF and I am building an application which has a Service Project, A Web Application project and a few Class library projects which I use for Business logic, etc. In answer to the first question, you can put the service reference.
I have a C# project that references sided assembly. When I try to update the sided assembly, the Version tag stays the same in *.csproj file even if I unload/reload project:
So my project tries to reference an old version of assembly, and that causes an exception. It's such a pain to change all those versions in references manually, especially if there are alot of references.
I tried to change some attribute of reference, like
SpecificVersion
, to True
and back to False
, and reference refreshed:Any ideas, how to automatically update references, if I update an assembly? Note that when I reference any system assembly like
System.Configuration.Install
, the reference is very simple:![Service Service](/uploads/1/2/4/8/124880520/187218464.png)
![Update Update](http://lh5.ggpht.com/-scRr9DqRHtY/UYPV3Jvpq0I/AAAAAAAAAcY/Cca0u4_htd0/03_AddMappedFolderMenu_thumb2.png?imgmax=800)
I can manually remove everything from that reference to sided assembly, but when I change some attribute, it gets back to the complex version, and I'm not sure if that's safe.
So how to update references normally?
Artem Kachanovskyi
Artem KachanovskyiArtem Kachanovskyi
1 Answer
If you always want to get latest version of assembly from specified path just avoid version attribute in csproj file or set SpecificVersion to False. SpecificVersion is an optional attribute that indicates whether to do the complete name matching (including version, culture and PublicKeyToken).
But this is not recommended because new version of assembly can cause compilation errors, e.g. method signature is changed. Instead it is better to use strong named assemblies and redirect assembly versions using config files.
Then Runtime will locate new assemblies using algorithm described here
rsemenovrsemenov