Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ServiceStack.Interfaces.dll no longer copied over to dependent projects

Tags:

servicestack

After upgrading to ServiceStack v3.9.70 via nuGet from v3.9.43, I noticed that the ServiceStack.Interfaces.dll is no longer copied over to projects that depend on the class library using ServiceStack. This causes the following error:

System.IO.FileNotFoundException: Could not load file or assembly 'ServiceStack.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'ServiceStack.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

All other ServiceStack dlls are copied, only ServiceStack.Interfaces is missing. All references are set to Copy Local = True, and this StackOverflow post's suggestion does not solve the problem.

I noticed that ServiceStack.Interfaces.dll is the only one with a version of 1.0.0.0, all others are set to 3.9.70.0. Could this be a cause?

Does anyone know how to fix it without manually referencing ServiceStack.Interfaces.dll in cascade in all projects referencing my class library?

Update - 2014-03-06

Problem still exists with v3.9.71.0. It really is related to the fact that the ServiceStack.Interfaces assembly has its version left to 1.0.0.0 instead of being.

I cloned the github repository for ServiceStack and changed this line in the build\build.proj file and ran build\build.bat.

<!-- Exclude versioning future strong-named libs -->
<RegexTransform Include="$(BuildSolutionDir)/src/**/AssemblyInfo.cs"
                Exclude="$(SrcDir)/ServiceStack.Interfaces*/Properties/AssemblyInfo.cs">
   <Find>\d+\.\d+\.\d+\.\d+</Find>
   <ReplaceWith>$(Version)</ReplaceWith>
</RegexTransform>

for this (noticed the removed exclusion)

<RegexTransform Include="$(BuildSolutionDir)/src/**/AssemblyInfo.cs">
   <Find>\d+\.\d+\.\d+\.\d+</Find>
   <ReplaceWith>$(Version)</ReplaceWith>
</RegexTransform>

Result: Now it works correctly, i.e. the file ServiceStack.Interfaces.dll is copied over to projects referencing a project that references ServiceStack.

Can someone explains this to me? Why would you want to exclude the Interfaces from versionning?

like image 674
dstj Avatar asked Nov 11 '13 22:11

dstj


1 Answers

The assembly versions were intentionally changed from 3.9.* to 1.0.0.0 when the v4 was released.

It probably was due to v4 ServiceStack.Interfaces.dll being changed to being strong-named and versioned 4.0. The 'bsd' 3.9.* version was rolled back to 1.0, probably to be clearly the oldest possible.

More detail in noted in this SO answer.

like image 184
Raul Nohea Goodness Avatar answered Oct 01 '22 23:10

Raul Nohea Goodness