Tahvohck / Planetbase-Mods

All of my mods, mostly as submodule references.
3 stars 2 forks source link

Build fails with "AssemblyVersions.cs" errors #3

Closed Zemogiter closed 2 years ago

Zemogiter commented 2 years ago

There are AssemblyVersions.tt files but renaming them only makes thinks worse. Trying to build: PBUtilities More Resources At Start Skip Intro Camera Overhaul Bigger Food Machines

NeoRider7 commented 2 years ago

@Zemogiter thanks for trying this! If you manage to do this, then it will be very cool! :-)

Zemogiter commented 2 years ago

Ok so I realized you need to right-click those .tt files in Visual Studio and select "Run custom tool" from the context menu. And while PBUtilities did compile (had to unlock the .t4 files in Properties), SkipIntro gives me these errors:

Compiling transformation: Invalid token 'this' in class, record, struct, or interface member declaration    
Compiling transformation: Method must have a return type    
Compiling transformation: 'GeneratedTextTransformation.GeneratedTextTransformation()' must declare a body because it is not marked abstract, extern, or partial 
Compiling transformation: Identifier expected

All from SkipIntro C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_SkipIntro\Properties\version.t4 line 1. No idea what is wrong.

UPDATE: I did the "copy&paste raw file" method from https://www.teamdevelopmentforsitecore.com/Blog/t4-transform-file-problems-code-gen and now the error is gone. The only issue is powershell scripts failing:

Severity    Code    Description Project File    Line    Suppression State
Error       The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_SkipIntro\bin\Debug\' -TargetFileName 'JPF_SkipIntro' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'SkipIntro' -BuildConfig 'Debug'"" exited with code 1.   SkipIntro           

Error is the same across all projects in the solution. Output from build:

Rebuild started...
1>------ Rebuild All started: Project: SkipIntro, Configuration: Debug Any CPU ------
2>------ Rebuild All started: Project: PBModBuildHelper, Configuration: Debug Any CPU ------
3>------ Rebuild All started: Project: _Utilities, Configuration: Debug Any CPU ------
4>------ Rebuild All started: Project: UnityModManagerTest, Configuration: Debug Any CPU ------
2>  PBModBuildHelper -> C:\Users\Jonasz\Downloads\Planetbase-Mods\PBModBuildHelper\bin\Debug\PBModBuildHelper.exe
4>  UnityModManagerTest -> C:\Users\Jonasz\Downloads\Planetbase-Mods\UnityModManagerTest\bin\Debug\UnityModManagerTest.dll
3>  _Utilities -> C:\Users\Jonasz\Downloads\Planetbase-Mods\_Utilities\bin\Debug\PBUtilities.dll
1>  SkipIntro -> C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_SkipIntro\bin\Debug\JPF_SkipIntro.dll
3>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
3>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
3>  At line:1 char:3
3>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
3>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
3>      + FullyQualifiedErrorId : UnauthorizedAccess
1>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
1>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
1>  At line:1 char:3
1>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
1>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
1>      + FullyQualifiedErrorId : UnauthorizedAccess
3>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\_Utilities\bin\Debug\' -TargetFileName 'PBUtilities' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project '_Utilities' -BuildConfig 'Debug'"" exited with code 1.
5>------ Rebuild All started: Project: CameraOverhaul, Configuration: Debug Any CPU ------
6>------ Rebuild All started: Project: AutoConnections, Configuration: Debug Any CPU ------
7>------ Rebuild All started: Project: BiggerFoodMachines, Configuration: Debug Any CPU ------
8>------ Rebuild All started: Project: MoreResourcesAtStart, Configuration: Debug Any CPU ------
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_SkipIntro\bin\Debug\' -TargetFileName 'JPF_SkipIntro' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'SkipIntro' -BuildConfig 'Debug'"" exited with code 1.
6>  AutoConnections -> C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_AutoConnections\bin\Debug\AutoConnections.dll
6>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
6>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
6>  At line:1 char:3
6>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
6>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
6>      + FullyQualifiedErrorId : UnauthorizedAccess
6>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_AutoConnections\bin\Debug\' -TargetFileName 'AutoConnections' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'AutoConnections' -BuildConfig 'Debug'"" exited with code 1.
8>  MoreResourcesAtStart -> C:\Users\Jonasz\Downloads\Planetbase-Mods\MoreResourcesAtStart\bin\Debug\MoreResourcesAtStart.dll
7>  BiggerFoodMachines -> C:\Users\Jonasz\Downloads\Planetbase-Mods\BiggerFoodMachines\bin\Debug\BiggerFoodMachines.dll
5>  CameraOverhaul -> C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_CameraOverhaul\bin\Debug\CameraOverhaul.dll
7>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
7>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
7>  At line:1 char:3
7>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
7>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
7>      + FullyQualifiedErrorId : UnauthorizedAccess
8>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
8>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
8>  At line:1 char:3
8>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
8>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
8>      + FullyQualifiedErrorId : UnauthorizedAccess
7>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\BiggerFoodMachines\bin\Debug\' -TargetFileName 'BiggerFoodMachines' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'BiggerFoodMachines' -BuildConfig 'Debug'"" exited with code 1.
8>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\MoreResourcesAtStart\bin\Debug\' -TargetFileName 'MoreResourcesAtStart' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'MoreResourcesAtStart' -BuildConfig 'Debug'"" exited with code 1.
5>  & : File C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1 cannot be loaded because running scripts is disabled o
5>  n this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
5>  At line:1 char:3
5>  + & 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDi ...
5>  +   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5>      + CategoryInfo          : SecurityError: (:) [], PSSecurityException
5>      + FullyQualifiedErrorId : UnauthorizedAccess
5>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(5710,5): error MSB3073: The command "powershell -noprofile "& 'C:\Users\Jonasz\Downloads\Planetbase-Mods\PackFiles.ps1' -OutputDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\JPF_CameraOverhaul\bin\Debug\' -TargetFileName 'CameraOverhaul' -SolutionDir 'C:\Users\Jonasz\Downloads\Planetbase-Mods\' -Project 'CameraOverhaul' -BuildConfig 'Debug'"" exited with code 1.
========== Rebuild All: 2 succeeded, 6 failed, 0 skipped ==========
Zemogiter commented 2 years ago

OK I managed to fix it by changing security priorities for execution of PowerShell scripts. In PowerShell window write the following:

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser

and press enter. Once that's done you can change it back by replacing Bypass with Default. Proper mod files now generate in the Output folder inside the repo.

Tahvohck commented 2 years ago

Glad you guys got this worked out. It's been ages since I've had the drive to mess with planetbase, so I was roughly as lost as you all were. For what it's worth, consider this project fully released to the public, as I'll probably not be able/have the drive to work on it myself any time soon. I can attempt to provide feedback as needed, though!

NeoRider7 commented 2 years ago

Thank you for your great work! But one caveat remained :-) The fact is that there are a huge number of messages from players that they do not understand at all how to install the engine and mods from Tahvohck. For example, see what people write in the comments here: Example-1: https://forums.nexusmods.com/index.php?showtopic=8777488/#entry96049513 Example-2: https://forums.nexusmods.com/index.php?showtopic=8777488/#entry89437523 Example-3: https://forums.nexusmods.com/index.php?showtopic=8777488/#entry87279838 Example-4: https://forums.nexusmods.com/index.php?showtopic=8777488/#entry82867548 Example-5: https://forums.nexusmods.com/index.php?showtopic=8777488/#entry82479628 Example-6: https://forums.nexusmods.com/index.php?showtopic=8827683/#entry87327203 ... It will be very cool if you reply to people on their messages :-) Ideally, all gamers would like a video to be created showing how the engine is installed and then how mods are installed.

If you do not make the installation instructions understandable to ordinary players, then no one will ever be able to play your mods. :-(