I'm trying to build an Xamarin.Forms Android project from within another visualstudio project.
My idea was to do that by executing a cmd command, or a .bat file.
I tested the msbuild command that builds the Xamarin.Forms.Android project:
MSBuild /t:SignAndroidPackage /p:Configuration=Release C:\Users\...\...\...\MyApp.Android.csproj
this command is working in the "Developer command prompt for VS 2017"
If I execute this in cmd.exe I get errors:
what I want is to get the command working in cmd.exe, or open the dev cmd vs2017 from a script.
I learned that the dev cmd vs 2017 is just a batfile that gets called before cmd.exe, so I did the same in my build.bat:
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" MSBuild /t:SignAndroidPackage /p:Configuration=Release C:\Users\...\...\...\MyApp.Android.csproj pause
But this still results in an error, I tried different bat files: vsvars32.bat, VsDevCmd.bat, as admin, added my MSBuild line directly in these files, It all ends with multiple errors:
The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstand
ard, Version=22.214.171.124, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
this error repeats a few times with different types. But I don't think the error is the problem cause my Xamarin.Forms.Android project build fine if I open the Dev cmd vs2017 manual, and enter the same MSBuild command.
Anyone who knows more about this problem, or can help me solve it?