After assembly failure on Xamarin iOS, assembly assembly failed

I just upgraded to the latest Xamarin build, and although all my libraries are referenced, I keep getting these errors:

Error CS0012: type ServiceStack.ServiceHost.IReturn 1 'is defined in an assembly that is not referenced. Consider adding a reference to the assembly `ServiceStack.Interfaces, Version = 3.9.55.0, Culture = neutral, PublicKeyToken = null '(CS0012) (Place.Logic)

Error CS0012: type ServiceStack.ServiceHost.IReturn' is defined in an assembly that is not referenced. Consider adding a reference to assembly ServiceStack.ServiceHost.IReturn' is defined in an assembly that is not referenced. Consider adding a reference to assembly ServiceStack.Interfaces, Version = 3.9.55.0, Culture = neutral, PublicKeyToken = null '(CS0012) (Place.Logic)

(The monotouch libraries have incorrect version numbers in releases that I think)

**** UPDATE

From comments and links of this one too : Build build error of iOS Xamarin Studio

It seems that the DLLs need to be recompiled from the source if you do not use a specific command line.

Unfortunately, the source files on the monotouch Servicestack source files are incomplete and continue to say: Servicestack.Text.Monotouch (Download error). Has anyone managed to recompile them and publish them for public use?

*** UPDATE

Adding a version of the monotouch source file causes Xamarin Studio to complain that the files are incompatible, i.e. Monotouch v1.0 when trying to select them as a link in a single solution file.

*** DECISION

My DTO DLL referenced the ServiceStack DLL and raised issues with version control, etc. Thus, I ended up duplicating the DTO source files in my Xamarin projects with server-side logic. Works for now, although I'm not happy, I have duplicates of the same code :(

+4
source share
1 answer

In general, MonoTouch projects can only reference other MonoTouch projects or MonoTouch builds. (You could make exceptions for the corresponding target portable class classes.)

Thus, even if your application refers to ServiceStack MonoTouch assemblies, but your DTO project refers to non-MonoTouch ServiceStack assemblies, and your application refers to this DTO project, it will fail in the description.

So, yes, as you already mentioned, the common practice is the MonoTouch project on the side of a standard project with the same source. A MonoTouch project is just a wrapper that references files in a standard project. (There are many methods for synchronizing these projects, and this is an area of ​​continuous development. For example, one trick is to use wildcards in the .csproj file.)

Finally, it is worth noting that the version of ServiceStack that you reference in your client application does not have to match the version of ServiceStack specified in the server project. The conventions by which ServiceStack resolves service URLs and serializes / deserializes DTOs are fairly stable. This way you can update ServiceStack on your server without updating your client.

+1
source

Source: https://habr.com/ru/post/1493511/


All Articles