R3 icon indicating copy to clipboard operation
R3 copied to clipboard

Fails to build VSCode lightweight MSbuild

Open studentutu opened this issue 4 months ago • 1 comments

When using a default (working on all other Unity Projects) build of the project ( to check fo compilation errors): .vscode/tasks.json

...
"tasks": [
		{
			"type": "dotnet",
			"task": "build",
			"group": "build",
			"problemMatcher": [],
			"label": "dotnet: build"
		},
		{
			"label": "Build Unity Solution",
			"type": "process",
			"command": "dotnet",
			"args": [
				"build",
				"my_custom_project_unity.sln"
			],
			"group": "build",
			"problemMatcher": "$msCompile"
		},
   ....

When running from from VSCode task - Build Unity Solution - will fail, with the following compilation errors:

C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\NuspecFile.cs(197,34): error CS0103: The name 'ZipFile' does not exist in the current context [C:\Users\admin\Documents\UnityProjects\rebornech 
os\rebornecho_unity\NuGetForUnity.csproj]
C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\Helper\CredentialProviderHelper.cs(262,38): error CS0103: The name 'ZipFile' does not exist in the current context [C:\Users\admin\Documents\Un 
ityProjects\rebornechos\rebornecho_unity\NuGetForUnity.csproj]
C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\PackageContentManager.cs(333,23): error CS1061: 'ZipArchiveEntry' does not contain a definition for 'ExtractToFile' and no accessible extension 
 method 'ExtractToFile' accepting a first argument of type 'ZipArchiveEntry' could be found (are you missing a using directive or an assembly re 
ference?) [C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\NuGetForUnity.csproj]
C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\PackageContentManager.cs(344,23): error CS1061: 'ZipArchiveEntry' does not contain a definition for 'ExtractToFile' and no accessible extension 
 method 'ExtractToFile' accepting a first argument of type 'ZipArchiveEntry' could be found (are you missing a using directive or an assembly re 
ference?) [C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\NuGetForUnity.csproj]
C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\InstalledPackagesManager.cs(189,34): error CS0103: The name 'ZipFile' does not exist in the current context [C:\Users\admin\Documents\UnityProj 
ects\rebornechos\rebornecho_unity\NuGetForUnity.csproj]
C:\Users\admin\Documents\UnityProjects\rebornechos\rebornecho_unity\Library\PackageCache\com.github-glitchenzo.nugetforunity@b8a65750503c\Editor 
\NugetPackageInstaller.cs(217,38): error CS0103: The name 'ZipFile' does not exist in the current context [C:\Users\admin\Documents\UnityProject 
s\rebornechos\rebornecho_unity\NuGetForUnity.csproj]
    26 Warning(s)
    6 Error(s)

Time Elapsed 00:00:06.33

This makes UniRx unusable outside of the Rider / Unity Editor (cannot be used with VSCode agentic plugins), are there any options to remove dependency on NugetForUnity?

studentutu avatar Sep 06 '25 22:09 studentutu

@neuecc when NugetForUnity is removed as a package, lightweight build becomes succesfull, but I'm not sure if we can build without NugetForUnity (we need someone to test it on Mobile/Mac builds). I've also filed this exact issue into the NugerForUnity repo https://github.com/GlitchEnzo/NuGetForUnity/issues/730

studentutu avatar Sep 06 '25 22:09 studentutu