Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.
Options

HoloToolkit build error (SessionManagerUniversal.UI post build)

Hi,

I'm trying to build HoloToolkit/Sharing using BuildAll.bat (on Windows), and I am always getting this post build error.

   "C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Solutions\VisualStudio\HoloToolkit.Sharing.sln" (rebuild target) (1) ->
   "C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj" (Rebuild target) (14) -> PostBuildEvent target) ->
     C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command "mkdir Appx\r [C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj]
   C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy ..\ClientUniversalCSharp\SharingClient.dll Appx\SharingClient.dll \r [C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj]
   C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: if Debug == Debug (\r [C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj]
   C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: copy ..\ClientUniversalCSharp\SharingClient.pdb Appx\SharingClient.pdb \r [C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj]
   C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: )" exited with code 1. [C:\projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj]

If I use Visual Studio, it does not show the error. But, the interesting thing is, either way, SharingClient.dll is never built. (Or, at least it's not created under ClientUniversalCSharp as far as I can tell.)

Any tips on how to fix this problem?

Thanks,
~h

Best Answers

Answers

  • Options

    Are you compiling the batch file from an admin VS developer command prompt?

  • Options

    Hi, @neerajwadhwa thanks for the suggestion. Running vsdevcmd with "Run as Administrator" did not help. The build failed at the same point.

  • Options
    AlexDAlexD ✭✭✭

    The ClientManagerUniversal.UI has a post build command to copy SharingClient.dll to the Appx folder. So if that files does not get created that step will fail. I would open the solution is visual studio and try to compile the ClientUniversalCSharp project and see why it does not build.

    A prerequisite to building the projects is to compile all the dependencies with the BuildDependencies.bat command.

  • Options

    @AlexD I don't seem to have problems building via Visual Studio. I can also separately run BuildDependencies with no issues. It's BuildSharingLib that causes problems. The original problem I reported here seems to be a CWD issue (because SharingClient.dll is actually created under Sharing/Src/bin/...). I temporarily commented out the post-build command, and tried running the BuildSharingLib script, and I got other errors (which again I didn't see when I used VS).

    At this point, I've sort of given up using the build scripts. New error, for instance:

      "c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Solutions\VisualStudio\HoloToolkit.Sharing.sln" (rebuild target) (1) ->
       "c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\SessionManagerUniversal.UI.csproj" (Rebuild target) (12) ->
       (XamlPreCompile target) ->
         GeneratedFiles\CSharpAPI\AnchorDownloadRequest.cs(58,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManager
       Universal.UI\SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\ImageTagManager.cs(45,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniver
       sal.UI\SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\NetworkInMessage.cs(77,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUnive
       rsal.UI\SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\NetworkOutMessage.cs(69,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniv
       ersal.UI\SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\RoomManager.cs(87,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.
       UI\SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\TagImage.cs(51,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUniversal.UI\
       SessionManagerUniversal.UI.csproj]
         GeneratedFiles\CSharpAPI\VisualPairConnector.cs(46,22): error CS0227: Unsafe code may only appear if compiling with /unsafe [c:\Projects\HoloSDK\HoloToolkit\Sharing\Src\Projects\SessionManagerUn
       iversal.UI\SessionManagerUniversal.UI.csproj]
    

    I checked the visual studio project settings for both Debug and Release, and the "Allow unsafe code" is properly checked. I have absolutely no idea why the build scripts cause this error when building inside the VS works just fine.

    Anyways, thanks for the help,
    ~h

  • Options

    @AlexD you are right. Apparently I missed one platform when I checked off "allow unsafe code" in release builds. (I do remember this was already set for debug builds.) I updated this setting, and now the build works. (I still have to figure out the post-build error though, but maybe later.) Thanks, ~h

  • Options
    AlexDAlexD ✭✭✭

    the post build should work if the SharingClient.dll exists. Let me know if you still have issues. The SharingManagerUniversal.UI won't work without that postbuild step (I was among the ones who contributed that piece to the repo).

Sign In or Register to comment.