Prepare Xamarin.Android for TFS
- PDF for offline use
Let us know how you feel about this
last updated: 2017-03
Xamarin.Android automatically regenerates the
/Resources/Resource.Designer.cs file every time the app is compiled, but because this file is included in version control, it's possible that it can be marked as read-only when TFS attempts to run a build. As a result, a build might fail.
Note: this is not a concern Team Foundation Server 2013 and 2015, which automatically check out files that are modified during a build. For earlier versions of TFS it is necessary to add a pre-build event to explicitly check out
Resource.Designer.cs and remove the read-only flag so the build can progress:
In Visual Studio, right click on the TaskyAndroid project in Solution Explorer, select Properties, and click the Build Events tab.
Click the Edit Pre-build… button, enter the following snippet, and press OK:
$(DevEnvDir)tf -checkout $(ProjectDir)Resources\Resource.Designer.cs attrib -r $(ProjectDir)Resources\Resource.Designer.cs
The project properties should now look like the following:
Save the TaskyAndroid project to complete the modification.