This article has the goal to expose a sample for adding a SDK Extension to a project from a specific folder.
Motivation
Sometimes developers need to:
Then go to that path and you see something like it.
In the project you should create a folder for the SDK Extensions and inside it add a folder with the same tree as we saw before as in the following:
Windows Phone\v8.0\ExtensionsSDKs\SQLite.WP80
For help, we can see the result in the
Xamarin.Forms.Labs project:
Note: The folder SDKs were created in the same
root as the solution. And if you get the repository then you will see that there is a folder for
samples and another for
source code and the solution and SDKs folder are inside the src folder.
After the
SDKs folder is created we need to add a configuration to the
Windows Phone Project (the project that uses this SDK Extension). In the cproj file add:
- <PropertyGroup>
- <SDKReferenceDirectoryRoot>$(SolutionDir)\Sdks;$(SDKReferenceDirectoryRoot)</SDKReferenceDirectoryRoot>
- </PropertyGroup>
In Xamarin.Forms.Labs you can find this in the
Xamarin.Forms.Labs.Sample.WP.csproj file.
With the solution opened, select the project then select Add reference -> Windows Phone SDK 8.0 and with mouse you can see the path for the SDK Extension.
Conclusion
In conclusion, adding a especific SDK Extension folder to a project, without installing the SDK Extension in the PC, is very simple and can help to manage the various versions of the SDK Extension and can be useful for building servers with continuous integration.