VSCode-EmmyLua-Unity icon indicating copy to clipboard operation
VSCode-EmmyLua-Unity copied to clipboard

右键pull unity api报错:Try Location MSBuild ... Unhandled exception. System.InvalidOperationException: No instances of MSBuild could be detected. Try calling RegisterInstance or RegisterMSBuildPath to manually register one.

Open LikeScientist opened this issue 4 months ago • 4 comments

Image

如图的附加命令添加和不添加都是一样的报错,命令如何运行日志如下: PS A:\Project\XXX> c:\Users\XXX.vscode\extensions\cppcxy.emmylua-unity-2.0.2-win32-x64\cli\win32-x64\EmmyLua.Unity.Cli.exe -s "a:\Project\XXX\EggPartyRun.sln" -o .EmmyLuaUnity -b XLua -n UnityEngine -p emmylua-unity.msbuildPath=B:/Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe Try Location MSBuild ... Unhandled exception. System.InvalidOperationException: No instances of MSBuild could be detected. Try calling RegisterInstance or RegisterMSBuildPath to manually register one. at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults() at Program.<Main>$(String[] args) in D:\a\EmmyLua-Unity-LS\EmmyLua-Unity-LS\EmmyLua.Unity.Cli\Program.cs:line 6 PS A:\Project\XXX> c:\Users\XXX.vscode\extensions\cppcxy.emmylua-unity-2.0.2-win32-x64\cli\win32-x64\EmmyLua.Unity.Cli.exe -s "a:\Project\XXX\EggPartyRun.sln" -o .EmmyLuaUnity -b XLua -n UnityEngine Try Location MSBuild ... Unhandled exception. System.InvalidOperationException: No instances of MSBuild could be detected. Try calling RegisterInstance or RegisterMSBuildPath to manually register one. at Microsoft.Build.Locator.MSBuildLocator.RegisterDefaults() at Program.<Main>$(String[] args) in D:\a\EmmyLua-Unity-LS\EmmyLua-Unity-LS\EmmyLua.Unity.Cli\Program.cs:line 6 PS A:\Project\XXX>

LikeScientist avatar Aug 08 '25 17:08 LikeScientist

我也是,我只装了vs2022,vs2022选了net桌面和unity开发的

CengJia avatar Sep 26 '25 01:09 CengJia

你需要装dotnet8

CppCXY avatar Sep 26 '25 01:09 CppCXY

装了dotnet8可以了。不过大佬,CS.UnityEngine智能提示只有Object的。其他好像都没有呢

CengJia avatar Sep 26 '25 03:09 CengJia

装了dotnet8可以了。不过大佬,CS.UnityEngine智能提示只有Object的。其他好像都没有呢

导出所用的命令行工具, 你可以自己修改下: https://github.com/[CppCXY/EmmyLua-Unity-LS

CppCXY avatar Sep 26 '25 03:09 CppCXY