simple switching between current repo and official-release-PCL

What would be the best practice to use current repo of CocosSharp in my project? I would like to be able to switch (realtively easily) between the last "official" release (CocosSharp.PCL.Shared package) and the current repo version. Is it best to remove PCL package every time when I want to switch to current repo version? Or is ti possible just to switch just CocosSharp.dll?

Best Answer


  • kjpou1kjpou1 LUMember, Xamarin Team Xamurai

    If anybody is getting an error like the following when following the instructions for installing NAnt:

    Failed to initialize the 'Mono 3.5 Profile' (mono-3.5) target framework.
       Function call failed.
    Expression: ${not pkg-config::exists('mono')}
           'pkg-config' failed to start.

    @René Ruppert has confirmed that the following will work:

    You can either add this to /etc/paths or keep the export:

  • bryancbryanc USMember, Xamarin Team, XamUProfessors Xamurai

    I had to modify my nant batch file to have:

    export PATH
    exec mono /usr/local/bin/nant-0.92/bin/NAnt.exe "[email protected]"
  • JeffAdamsJeffAdams USMember
    edited August 2015

    I am new to CocosSharp and also trying to use it exclusively on an OS X machine. I am making progress on building CocosSharp from source on an OS X machine...

    Nant is now building and working on OS X (resolved):

    While it is documented on github, I failed to initially see that before I could just issue 'nant' above on the sources I had to do 'mono Protobuild.exe' in the dir MonoGame/ first.

    I think the entire build is progressing up to the very last build target, but on OS X I get an error in buildXStemplates with:

         [copy] Copying 1 file to '/Users/jeff/Developer/SDKs/CocosSharp/ProjectTemplates/XamarinStudio/Packages'.
         [exec] Xamarin Studio Add-in Setup Utility
         [exec] Creating package MonoDevelop.CocosSharp.Templates_1.5.0.1.mpack
         [exec] FATAL ERROR [2015-08-02 08:38:59Z]: System.IO.FileNotFoundException: Could not find file "/Users/jeff/Developer/SDKs/CocosSharp/ProjectTemplates/XamarinStudio/Packages/CocosSharp.PCL.Shared.".
    External Program Failed: /Applications/Xamarin (return code was 255)

    When I check /Users/jeff/Developer/SDKs/CocosSharp/ProjectTemplates/XamarinStudio/Packages/ the only file in this directory at the time of the build is: CocosSharp.PCL.Shared.MacOS.
    and I notice all the NuGets that got built in NuGet/bin all use the version number.

    Is there something I needed to do to bump and fix the and discrepancy? I also notice I ended up with a MacOS version and not a generic version of CocosSharp.PCL.Shared.

    Is it at least safe to assume that I now have complete and working local NuGets in NuGet/bin at this stage even if the buildXStemplates target failed if I don't really need the new project templates?

  • kjpou1kjpou1 LUMember, Xamarin Team Xamurai


    The MG Protobuild steps throws everyone the first time out.

    Yes you can use the the PCL's that are generated on the Mac with no problem. They will only contain the Android, iOS and Mac versions though. The only way to get the generic version which contains all platforms is to compile on windows and move the generated windows version that does contain all the generic versions. This is what the build is telling you is that this generic .nupkg does not exist. You can still use the templates that are delivered you will just need to change out the .nupkg to point to the locally built versions.

    You can update the versions by modifying the .nuget packages with the new version if you would like.

    You can modify those from the NuGet directory.

    Change the version in each package definition that you want to update locally.




    I usually change this myself locally because it sometimes get's confusing which one you are using. The version or locally built.

    The mac specific versions are appended with .Mac. The reason for the differences is that each platform has it's own separators and build specs.

    Since you are using a Mac let me warn you that sometimes when switching the NuGet packages in and out to test different scenarios you may think that they are getting updated but that may not be the case especially if you have multiple XS applications running. If this seems to be happening make sure you Clean, remove all NuGet packages, remove all bin directories, shut down ALL instances of XS and restart by adding the NuGet packages from the local package directory again. We have been bitten a couple of times with this especially with multiple XS apps open at the same time.

  • JohannesSjokvistJohannesSjokvist NOMember ✭✭

    I used Windows 8.1 with VS 2013 and VS 2015 installed to successfully build CocosSharp.

    But since I had some trouble getting it to build without error, I thougt maybe someone find this usefull:

    After installing NAnt, executed prototype.exe, and running nant in the directory from VS 2013 Dev CMD, it starts to build! But I got this error:

    target) (3:2) ->
    [exec] (_GenerateProjectPriFileCore target) ->
    [exec] MakePri : error 0x80004005: Initializing Indexer [D:\CocosSharp\box2d\box2d.Windows8.csproj]
    [exec] MakePRI : error 0xdef00501: Schema Validation Failed. Attributtet
    targetOsVersion på elementet resources er ikke definert i DTD/skjema. [D:\CocosSharp\box2d\box2d.Windows8.csproj]
    [exec] 130 Warning(s)
    [exec] 2 Error(s)
    [exec] Time Elapsed 00:00:05.96


    Doing the same from VS 2015 CMD, I finally got:

    Not sure if it should work with VS 2013, but for me it worked with VS 2015 without errors...

  • ShermanUitzetterShermanUitzetter USMember ✭✭
    edited September 2015

    FYI, the whole nant thing is nice, but it doesn't quite work with Indie Xamarin licenses.

    error: The Indie Edition of Xamarin.Mac does not support building outside of Xamarin Studio. Please go to to upgrade to the Business Edition.

    After I got this error, I had to manually open the MacOS solution in XS to build it. That's not such a big deal, but then, of course I didn't get the benefit of the remainder of the nant script - namely, creating the nice nuget package. So there's another pain point to deal with for us (albeit few) MacOS CocosSharpers.

  • kjpou1kjpou1 LUMember, Xamarin Team Xamurai


    Humm, did not know that. You can build nugets by issuing nant buildnugets at the command line.

    • nant buildios
    • nant buildandroid
    • nant buildmacos
    • nant buildnugets
Sign In or Register to comment.