Dragos Stoica
Dragos Stoica

Reputation: 1935

Xamarin and .NET2 Shared project

I have 1 project which may run as Winforms App(.NET 2) or as a Xamarin App or as WPF app. The business logic is the same and I would like to share the code between the Xamarin App and the Winforms App. In .NET 2.0 I don't have portable class libraries and in Xamarin I cannot add .NET 2.0 project.

I thought it would be a chance to use an API and use it as shared code(WCF not available in 2.0). Any other ideas? Thanks!

Upvotes: 0

Views: 70

Answers (1)

Michael Mairegger
Michael Mairegger

Reputation: 7301

You have to extract the code that is used by mulitple project into a Shared Project. In the other projects you have to reference this Shared Project.

The solution should look like

enter image description here

The last project is the Shared Project

The project's references should look like:

Right click on References and click Add Reference and the select Shared Projects tab and select the shared project you created

enter image description here

Upvotes: 2

Related Questions