Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISHRemote Compilation failed on Visual Studio 2022 #161

Closed
shrinidhijanaki opened this issue Jul 24, 2023 · 17 comments
Closed

ISHRemote Compilation failed on Visual Studio 2022 #161

shrinidhijanaki opened this issue Jul 24, 2023 · 17 comments

Comments

@shrinidhijanaki
Copy link

error MSB3073: The command "pwsh -NonInteractive -command "Import-Module D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin/Debug/net48/Trisoft.ISHRemote.dll -Force;$cmdletsToExport=(Get-Module -Name Trisoft.ISHRemote).ExportedCommands.Keys;New-ModuleManifest -Path 'D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin/Debug/ISHRemote/ISHRemote.psd1' -FormatsToProcess 'ISHRemote.Format.ps1xml' -FunctionsToExport @('Get-IshAuxSessionState', 'New-IshAuxCompletionResult', 'Register-IshAuxParameterCompleter') -RootModule 'ISHRemote.psm1' -ModuleVersion '7.1.0' -Prerelease 'preview001' -Guid '0314ffdb-6083-4c4d-aa01-8bfaac51a7e4' -Author 'RWS Group for and on behalf of its affiliates and subsidiaries' -CompanyName 'RWS Group for and on behalf of its affiliates and subsidiaries' -Copyright 'Copyright (c) 2023 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries.' -Description 'Business automation module on top of Tridion Docs Content Manager (Knowledge Center Content Manager, LiveContent Architect, Trisoft InfoShare)' -PowerShellVersion '5.1' -ClrVersion '4.0' -DotNetFrameworkVersion '4.8' -LicenseUri 'https://github.com/rws/ISHRemote/blob/master/LICENSE.TXT' -ProjectUri 'https://github.com/rws/ISHRemote/' -CmdletsToExport @($cmdletsToExport)"" exited with code 9009.

Code is taken from the GitHub Repository master branch and compiling directly on the Windows 11 machine

Appreciate any one with addresses this issue or suggestions here, what is going wrong in compiling the code on Windows 11 with dotnet version 7.0+

@ivandelagemaat
Copy link

ISHRemote requires net48 and net6.0 frameworks for a successful compilation. Are both frameworks available on your Windows 11 machine?

@shrinidhijanaki
Copy link
Author

yes both are available on windows 11. I verified both the versions using the below command

PS Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" -Name Version

Version : 4.8.04161
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
PSChildName : Full
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry

PS dotnet --version
7.0.304

@shrinidhijanaki
Copy link
Author

here is the complete compilation output for reference
Build started...
1>------ Build started: Project: Trisoft.ISHRemote, Configuration: Debug Any CPU ------
Restored D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\Trisoft.ISHRemote.csproj (in 229 ms).
1>Trisoft.ISHRemote -> D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll
1>AssemblyPath: D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll, OutputHelpFilePath: D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll-Help.xml, TreatWarningsAsErrors False
1>GenerateHelp completed with exit code 'Success'
1>'pwsh' is not recognized as an internal or external command,
1>operable program or batch file.
1>D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\Trisoft.ISHRemote.csproj(96,2): error MSB3073: The command "pwsh -NonInteractive -command "Import-Module D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll -Force;$cmdletsToExport=(Get-Module -Name Trisoft.ISHRemote).ExportedCommands.Keys;New-ModuleManifest -Path 'D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\ISHRemote\ISHRemote.psd1' -FormatsToProcess 'ISHRemote.Format.ps1xml' -FunctionsToExport @('Get-IshAuxSessionState', 'New-IshAuxCompletionResult', 'Register-IshAuxParameterCompleter') -RootModule 'ISHRemote.psm1' -ModuleVersion '7.1.0' -Prerelease 'preview001' -Guid '0314ffdb-6083-4c4d-aa01-8bfaac51a7e4' -Author 'RWS Group for and on behalf of its affiliates and subsidiaries' -CompanyName 'RWS Group for and on behalf of its affiliates and subsidiaries' -Copyright 'Copyright (c) 2023 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries.' -Description 'Business automation module on top of Tridion Docs Content Manager (Knowledge Center Content Manager, LiveContent Architect, Trisoft InfoShare)' -PowerShellVersion '5.1' -ClrVersion '4.0' -DotNetFrameworkVersion '4.8' -LicenseUri 'https://github.com/rws/ISHRemote/blob/master/LICENSE.TXT' -ProjectUri 'https://github.com/rws/ISHRemote/' -CmdletsToExport @($cmdletsToExport)"" exited with code 9009.
1>Done building project "Trisoft.ISHRemote.csproj" -- FAILED.
1>Trisoft.ISHRemote -> D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net6.0\Trisoft.ISHRemote.dll
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 7:30 PM and took 12.946 seconds ==========

@shrinidhijanaki
Copy link
Author

i could fix the owsh issue by updating the alias and proj file local to my system. now i see a difrferent problem

Build started...
1>------ Build started: Project: Trisoft.ISHRemote, Configuration: Debug Any CPU ------
Restored D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\Trisoft.ISHRemote.csproj (in 499 ms).
1>Trisoft.ISHRemote -> D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll
1>AssemblyPath: D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll, OutputHelpFilePath: D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll-Help.xml, TreatWarningsAsErrors False
1>GenerateHelp completed with exit code 'Success'
1>Trisoft.ISHRemote -> D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net6.0\Trisoft.ISHRemote.dll
1>New-ModuleManifest : A parameter cannot be found that matches parameter name 'Prerelease'.
1>At line:1 char:582
1>+ ... ootModule 'ISHRemote.psm1' -ModuleVersion '7.1.0' -Prerelease 'previe ...
1>+ ~~~~~~~~~~~
1> + CategoryInfo : InvalidArgument: (:) [New-ModuleManifest], ParameterBindingException
1> + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.New
ModuleManifestCommand
1>
1>D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\Trisoft.ISHRemote.csproj(96,2): error MSB3073: The command "powershell.exe -NonInteractive -command "Import-Module D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\net48\Trisoft.ISHRemote.dll -Force;$cmdletsToExport=(Get-Module -Name Trisoft.ISHRemote).ExportedCommands.Keys;New-ModuleManifest -Path 'D:\Cops-Projects\Repositories\GitHub\ISHRemote-TD15\Source\ISHRemote\Trisoft.ISHRemote\bin\Debug\ISHRemote\ISHRemote.psd1' -FormatsToProcess 'ISHRemote.Format.ps1xml' -FunctionsToExport @('Get-IshAuxSessionState', 'New-IshAuxCompletionResult', 'Register-IshAuxParameterCompleter') -RootModule 'ISHRemote.psm1' -ModuleVersion '7.1.0' -Prerelease 'preview001' -Guid '0314ffdb-6083-4c4d-aa01-8bfaac51a7e4' -Author 'RWS Group for and on behalf of its affiliates and subsidiaries' -CompanyName 'RWS Group for and on behalf of its affiliates and subsidiaries' -Copyright 'Copyright (c) 2023 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries.' -Description 'Business automation module on top of Tridion Docs Content Manager (Knowledge Center Content Manager, LiveContent Architect, Trisoft InfoShare)' -PowerShellVersion '5.1' -ClrVersion '4.0' -DotNetFrameworkVersion '4.8' -LicenseUri 'https://github.com/rws/ISHRemote/blob/master/LICENSE.TXT' -ProjectUri 'https://github.com/rws/ISHRemote/' -CmdletsToExport @($cmdletsToExport)"" exited with code 1.
1>Done building project "Trisoft.ISHRemote.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 7:55 PM and took 11.809 seconds ==========

@shrinidhijanaki
Copy link
Author

can anybody guide me here how to fix this manifest issue?

@shrinidhijanaki
Copy link
Author

i am getting this manifest issue for all V1.0.0, 7.0.0 and 7.1.0 versions. Is something is missing?

@shrinidhijanaki
Copy link
Author

1> Trisoft.ISHRemote.Objects.Public.IshUserRole:
1> No description comment found.
1>GenerateHelp completed with exit code 'Success'
1**>New-ModuleManifest : A parameter cannot be found that matches parameter name 'Prerelease'.
1>At line:1 char:278
1>+ ... ootModule 'ISHRemote.psm1' -ModuleVersion '1.0.0' -Prerelease 'previe ...
1>+ ~~~~~~~~~~~
1> + CategoryInfo : InvalidArgument: (:) [New-ModuleManifest], ParameterBindingException
1> + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.NewModuleManifestCommand
1>**
1>D:\Cops-Projects\Repositories\GitHub\ISHRemote-7.0-TD15\ISHRemote-1.0\ISHRemote-1.0\Source\ISHRemote\Trisoft.ISHRemote\Trisoft.ISHRemote.csproj(94,5): error MSB3073: The command "powershell.exe -NonInteractive -command "New-ModuleManifest -Path 'D:\Cops-Projects\Repositories\GitHub\ISHRemote-7.0-TD15\ISHRemote-1.0\ISHRemote-1.0\Source\ISHRemote\Trisoft.ISHRemote\bin/Debug/ISHRemote/ISHRemote.psd1' -FormatsToProcess 'ISHRemote.Format.ps1xml' -RootModule 'ISHRemote.psm1' -ModuleVersion '1.0.0' -Prerelease 'preview002' -Guid '0314ffdb-6083-4c4d-aa01-8bfaac51a7e4' -Author 'RWS Group for and on behalf of its affiliates and subsidiaries' -CompanyName 'RWS Group for and on behalf of its affiliates and subsidiaries' -Copyright 'Copyright © 2023 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries.' -Description 'Business automation module on top of Tridion Docs Content Manager (Knowledge Center Content Manager, LiveContent Architect, Trisoft InfoShare)' -PowerShellVersion '5.1' -ClrVersion '4.0' -DotNetFrameworkVersion '4.8' -LicenseUri 'https://github.com/rws/ISHRemote/blob/master/LICENSE.TXT' -ProjectUri 'https://github.com/rws/ISHRemote/' -NestedModules @('net48\Trisoft.ISHRemote.dll')"" exited with code 1.
1>Done building project "Trisoft.ISHRemote.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 8:41 PM and took 08.069 seconds ==========

@shrinidhijanaki
Copy link
Author

which is the correct version for which i can compile the code to Tridion Docs 15. We need to compile and integrate into our custom tools. This is somewhat like a blocker.

@ivandelagemaat
Copy link

Did you install PowerShell Core? https://github.com/PowerShell/PowerShell
You don't have to compile ISHRemote in order to use it, you can use the PowerShell Gallery to install ISHRemote https://www.powershellgallery.com/packages/ISHRemote/7.0.0

@shrinidhijanaki
Copy link
Author

Thanks for your inputs. I found that Powershell core was not installed on my system. Installing PS Core resolved the problem
Also i have one query, we are using ISHRemote Project internally in several other C# console projects by using ISHRemote.dll library. My Query is do we need to have PS Core installed on the system where we are deploying the ISHRemote library?

Did you install PowerShell Core? https://github.com/PowerShell/PowerShell You don't have to compile ISHRemote in order to use it, you can use the PowerShell Gallery to install ISHRemote https://www.powershellgallery.com/packages/ISHRemote/7.0.0

@ivandelagemaat
Copy link

I don't know how you are using the ISHRemote library in your project but probably you don't need PS Core when deploying your project on an other system. ISHRemote can be used with PowerShell and PowerShell Core and therefor it is compiled twice, one for the full framework net4.8 and once for .NET Core net6.0. Pick the right one for your project.

@ddemeyer
Copy link
Contributor

ddemeyer commented Jul 31, 2023

Quite confused why you are rebuilding the project - over a full C# project reference - instead of doing an Assembly reference. Are you "adapting ISHRemote code"?
An assembly reference allows you to reuse an earlier/tested/released build while the above feels like to attempts to just make it work.

Crosslinking to https://community.rws.com/product-groups/tridion/tridion-docs/f/forum/48323/what-is-the-correct-version-of-ishremote-do-we-need-to-consider-for-tridion-docs-15

If there are no further clarifications or justifications, we consider to close this issue.

@shrinidhijanaki
Copy link
Author

shrinidhijanaki commented Aug 23, 2023 via email

@ddemeyer
Copy link
Contributor

ddemeyer commented Sep 1, 2023

Hi Shrinidhi ... So ISHRemote is C# code that is delivered as a .NET Assembly complying with the PowerShell library standard. In turn the assembly library can be loaded (~ Import-Module) in a Windows PowerShell.exe or Pwsh.exe process so you can run its cmdlets (~ New-IshSession).

A. So based on the above you are wrapping the PowerShell executable again in a new C# program. Something along the lines of https://stackoverflow.com/questions/13251076/calling-powershell-from-c-sharp ? I'm still puzzled what business problem you are trying to solve.

B. Either you scenario above or what I will describe next is for me not the core purpose of ISHRemote, it is an edge case ... it is however open source so in a way you can have multiple attempts for whatever you desire :) Why not load the Trisoft.ISHRemote.dll directly into your C# project and run the necessary classes (~ IshSession) yourself. In the end it is open source so you can have a look what is happening inside New-IshSession.

Best wishes,
Dave

@shrinidhijanaki
Copy link
Author

shrinidhijanaki commented Sep 2, 2023 via email

@ddemeyer
Copy link
Contributor

ddemeyer commented Sep 5, 2023

Thanks for closing the loop, appreciated! Just as a reminder...

@shrinidhijanaki
Copy link
Author

shrinidhijanaki commented Sep 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants