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.
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
-
OptionsAlexD ✭✭✭
@holodoctor looking at the build script I can see that it tried to build the project in multiple configurations - debug/release and architectures ARM/x86/x64. You need to check that all those configurations have the allow unsafe code flag set.
It's weird because I can compile on my end and looking at my git status it looks like I'm up to date with the origin.5 -
Optionsholodoctor ✭✭
I finally fixed the problem, after painful process of trials and errors of repeating the builds again and again (after incrementally modifying the post-build script each time).
First, this is such a weird error. If you look at the error message included in my original question, the error message appears to suggest that the build script treats the Windows eol (\r\n) as a path segment "\r" (file or folder named "r") plus a new line (\n). So bizarre... I replaced all line endings to Unix style.
Second, there was also a simple error. I just included the source file path (which includes "..\") in double quotes.
Now BuildSharingLib.bat runs without errors.
Here's my modified version of the post build script:
if not exist Appx mkdir Appx copy /b/y "..\ClientUniversalCSharp\SharingClient.dll" Appx\SharingClient.dll if $(ConfigurationName) == Debug ( copy /b/y "..\ClientUniversalCSharp\SharingClient.pdb" Appx\SharingClient.pdb )
Thanks for the help, @AlexD.
5
Answers
Are you compiling the batch file from an admin VS developer command prompt?
Hi, @neerajwadhwa thanks for the suggestion. Running vsdevcmd with "Run as Administrator" did not help. The build failed at the same point.
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.
Toronto-HoloLens | Blog | @alexdrenea
@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:
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
@holodoctor looking at the build script I can see that it tried to build the project in multiple configurations - debug/release and architectures ARM/x86/x64. You need to check that all those configurations have the allow unsafe code flag set.
It's weird because I can compile on my end and looking at my git status it looks like I'm up to date with the origin.
Toronto-HoloLens | Blog | @alexdrenea
@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
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).
Toronto-HoloLens | Blog | @alexdrenea
I finally fixed the problem, after painful process of trials and errors of repeating the builds again and again (after incrementally modifying the post-build script each time).
First, this is such a weird error. If you look at the error message included in my original question, the error message appears to suggest that the build script treats the Windows eol (\r\n) as a path segment "\r" (file or folder named "r") plus a new line (\n). So bizarre... I replaced all line endings to Unix style.
Second, there was also a simple error. I just included the source file path (which includes "..\") in double quotes.
Now BuildSharingLib.bat runs without errors.
Here's my modified version of the post build script:
Thanks for the help, @AlexD.