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.
'UnityGenerated' does not exist in the namespace 'Unity'
I have been scanning the general Net for answers to this:- Error CS0234. I really think it must be something extremely obvious or my set up is not correct. I recently updated and downloaded some stuff. I am using Unity version 5.5.0b-7 (Personal) to get the use of 'WorldAnchorStore' features. I just downloaded the latest HoloToolkit-Unity and reimported it also. The problem comes when Unity creates an App.cs script which it seems to automatically generate or modify when it launches from Unity using the 'Build Settings/Build' key. This is the problematical code which it creates:-
private void SetupOrientation() { Unity.UnityGenerated.SetupDisplay(); }
What am I doing incorrectly here?
Best Answer
-
Thank you for that. Yes this was the reason I was confused about the process - this UnityGenerated.cs was missing. I found the answer finally after much prodding. I changed the name of this project and realized that the the name of the solution also changed. However the old name appeared also and it was not clear where the assets were. This is some action I would not recommend people do as the parts to your new named project are also shared with your old one and indeed the .sln file is in the App directory of the old named solution directory. If I choose the NEW .sln name and launch that then everything appears to be ok and this file is included in this build. So I think this clears it up for me.
5
Answers
UnityGenerated.cs is a class that Unity will create for you under UWP\ProjectName
Thank you for that. Yes this was the reason I was confused about the process - this UnityGenerated.cs was missing. I found the answer finally after much prodding. I changed the name of this project and realized that the the name of the solution also changed. However the old name appeared also and it was not clear where the assets were. This is some action I would not recommend people do as the parts to your new named project are also shared with your old one and indeed the .sln file is in the App directory of the old named solution directory. If I choose the NEW .sln name and launch that then everything appears to be ok and this file is included in this build. So I think this clears it up for me.
Looks like this error is back again.
You can update App.cs to have a:
using Unity;
and then remove Unity as qualification level on the SetupDisplay() statement:
private void SetupOrientation()
{
UnityGenerated.SetupDisplay();
}
it happens when you Project end with "Unity" then your root namespace will be a distraction to compiler
for example your root namespace is "FPMV.Unity" (my case now) , compiler cannot find "UnityGenerated" in "FPMV.Unity"