Thanks to visit codestin.com
Credit goes to github.com

Skip to content

shimgen errors causing successful package installation to fail #115

@sseebald

Description

@sseebald

We're installing some software that is being installed via chocolatey/powershell as part of our Packer build process. While the software is being completely and successfully installed, shimgen is throwing some errors that ultimately get reported back to packer as exit 1 causing the whole build to fail. Here's a sample of the error:

Calling command ['"C:\ProgramData\chocolatey\tools\shimgen.exe" --path="..\\lib\xboxgdk\tools\Installers\powershellStub.exe" --output="C:\ProgramData\chocolatey\bin\powershellStub.exe"  --iconpath="C:\ProgramData\chocolatey\lib\xboxgdk\tools\Installers\powershellStub.exe"']
2021-03-17 14:34:53,513 5004 [DEBUG] -  [ShimGen] [WARN ] Could not extract icon from associated program. Using default. Error:
2021-03-17 14:34:53,513 5004 [DEBUG] -  [ShimGen]   Selected Icon is invalid
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] Microsoft (R) Visual C# Compiler version 4.8.3761.0
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] for C# 5
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] Copyright (C) Microsoft Corporation. All rights reserved.
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(6,29,6,43): error CS1026: ) expected
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(7,2,7,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(7,31,7,32): error CS0116: A namespace cannot directly contain members such as fields or methods
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(7,35,7,49): error CS1026: ) expected
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(8,2,8,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(9,2,9,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(10,2,10,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(11,2,11,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(12,2,12,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(13,2,13,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(14,2,14,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(15,2,15,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(17,2,17,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(18,2,18,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] c:\ProgramData\shimgen\generatedfiles\20210317_143453_3570\Assembly.cs(19,2,19,10): error CS1730: Assembly and module attributes must precede all other elements defined in a file except using clauses and extern alias declarations
2021-03-17 14:34:53,700 5004 [DEBUG] -  [ShimGen] [ERROR] ShimGen had an issue creating 'C:\ProgramData\chocolatey\bin\powershellStub.exe'. Please check the logs above.

We're using choco 0.10.15, software is being installed on WS2019. Let me know if you need any more info!

┆Issue is synchronized with this Gitlab issue by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    0 - Waiting on UserWaiting on a response from either a commenter or ticket creator.Pending ClosureThis issue has been marked as having no response or is stale and will soon be closed.shimgen

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions