Build error with Postsharp 4.3.26 on fresh computer with VS 2017 and Xamarin

geir.ludvigsen's Avatar


27 Aug, 2018 02:22 PM


We have recently formatted our computers and installed VS 2017 with Xamarin. But now we cannot build our Xamarin.Android projects anymore if they are using Postsharp. Those not using any PS build fine.
Our old computers built perfectly in VS 2017. On those computers we also had VS 2015 installed.

I guess there is something we need to install to make it work again, could you please give us any clues.

Attached is a snapshot of the postsharpdata folder, as you can see it contains no bindingmaps folder.
The postsharpdata folder on my old computer contained much more, for instance the BindingMaps folder.

We are 4 users that need to get this working. I guess you still can help us with this for PS 4.3.26 since you still support this version of PS according to what Gael states here:

We have tried to install MS Build tools for 2015 and for 2013. But no luck. So we don't know what we are missing. We are hoping that we don't have to install VS 2015. As I mentioned we have been building this successfully in VS 2017 on or old computers, but there we also had VS 2015 installed even if we didn't use it.

Attached is also a dump of the systeminfo from VS 2017, there you can see amongst other info which Xamarin version that is installed.

The bug we get is this one:
1>"C:\Work\Sourcecode\VSTS\MonoSource-OldUI\AnPocketPlatform\AnPocketPlatform.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
1>(PostSharp30Core target) ->
1> POSTSHARP : postsharp error PS0257: An error occured while generating and loading binding maps for the current compilation. The cache may be corrupted. Please try cleaning "c:\work\PostSharpData" directory to force complete recreation of binding maps.

  1. Support Staff 1 Posted by PostSharp Techn... on 28 Aug, 2018 10:27 AM

    PostSharp Technologies's Avatar


    According to the error message PostSharp fails when trying to generate the binding maps. Could you please run the build with the following parameters and send us the new build log?

    • MSBuild log verbosity level set to detailed
    • MSBuild property PostSharpTrace set to BindingMapBuilder

    For example, on the command line:

    msbuild MyProject.csproj /v:d /p:PostSharpTrace=AssemblyBinder > build.log

    Please send us the content of the PostSharpData\InstalledFrameworks directory as well.

    We suspect the issue may also be related to the version of Xamarin you're using. Did you install a different Xamarin version after reformatting your computers?


  2. 2 Posted by geir.ludvigsen on 30 Aug, 2018 07:53 AM

    geir.ludvigsen's Avatar

    Hi again. We have managed to solve this ourselves.
    We know what to do to make it work. But we don't understand why.. ;-) Maybe you could shed some light upon to the 'why' part?

    Copy the content of packages.config temporarily to a notepad window or similar just to know which ones were added.
    Open Manage Nuget-packages for each project.
    Remove ALL Nuget packages in the project. This will also remove the packages.config when the last package is removed.
    Set Tools | Options | Nuget Package Manager | Default package management format: to "PackageReference".
    Now add all necessary packages again. This should now add package references to the project file and not create any packages.config.

    Now we can build without the error described. And deploy and it all works fine.

  3. Support Staff 3 Posted by PostSharp Techn... on 30 Aug, 2018 09:20 AM

    PostSharp Technologies's Avatar


    The described behavior certainly looks very strange and we actually can't explain it without further investigation. There are a couple of important notes to keep in mind however.

    First of all, the build 4.3.26 is already quite old and we recommend upgrading to the latest 4.3 build if you encounter any bugs (4.3.44 as of today).

    Second, PostSharp 4.3 does not support VS 2017. So, while everything works fine now, you may eventually run into bugs that cannot be fixed in version 4.3.


  4. Support Staff 4 Posted by PostSharp Techn... on 11 Sep, 2018 03:47 PM

    PostSharp Technologies's Avatar


    We are going to close this request as there have not been any further updates. Please feel free to reopen the discussion if you need more help.

    PostSharp Team

  5. PostSharp Technologies closed this discussion on 11 Sep, 2018 03:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac