Open kobechenyang opened 5 years ago
Interesting. Looking at the constructor for UnityProjectInstance,, my guess is that it's failing to parse either ProjectSettings\ProjectVersion.txt or ProjectSettings\ProjectSettings.asset.
Does your Unity project have it's Asset Serialization Mode set as 'Force Text'? Text assets are expected by UnitySetup.
If that isn't the issue, would you mind taking a snip of your folder hierarchy and dropping your copies of the above two files into the issue?
Thanks for your answer ! But it didn't fix the problem. My project is empty unity project. But it was created with different version. I don't know if that matters. Also I notice when I call
Select-UnitySetupInstance -Project '.\build-machine-setup'
Also getting an error
At line:1 char:27
+ Select-UnitySetupInstance -Project 'C:\Users\kobec\build-machine-setu ...
+ ~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Select-UnitySetupInstance], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Select-UnitySetupInstance```
Select-UnitySetupInstance
doesn't have a Project
parameter so that error makes sense. That cmdlet is for filtering the results of Get-UnitySetupInstance
which finds installs of Unity on your machine. Highly recommend reading the README and running help <command>
, e.g. help Select-UnitySetupInstance
to learn more about the API.
Get-UnityProjectInstance -Recurse
will find unity projects recursively under a folder. If .\build-machine-setup
is the root of a Unity project it should find it, detect the version, and print out the details. Start-UnityEditor -Project <path to project>
will either launch the right version of Unity or complain that it can't find it (it uses the *-UnitySetupInstance
cmdlets for this).
Can you post your ProjectSettings\ProjectVersion.txt and ProjectSettings\ProjectSettings.asset? These are the only files relied upon by UnitySetup and if it's a clean Unity project shouldn't have any private information in it. With those I should be able to reproduce your issue and give further guidance.
You are right, Get-UnitySetupInstance
doesn't have a project parameter. After I did Get-UnityProjectInstance -Recurse
I was able to do a Start-UnityEditor -Project <path to project>
. This Get-UnitySetupInstance | Select-UnitySetupInstance -Project '.\MyUnityProject'
command inside README file is outdated then. Thanks. Can you modified README file?
Reopening under new title to capture these doc issues.
When calling
Start-UnityEditor -Project .\build-machine-setup
I am getting this error:Any idea what is happening ?