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

7z & amd64\msbuild.exe: Can not load 7-zip library or internal COM error #38

Closed
3F opened this issue Dec 6, 2016 · 1 comment
Closed
Labels
Milestone

Comments

@3F
Copy link
Owner

3F commented Dec 6, 2016

Found with Native scripting and GetNuTool project.

through this helper:

"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild" "gnt.sln" /v:m /m:4
...
MSBuild Tools: "C:\Program Files (x86)\MSBuild\14.0\bin\amd64\\msbuild.exe"
Compact version of `../gnt.core` has been created -> `gnt.core`
Executable version of `../minified/gnt.core` has been created -> `gnt.bat`
Generate minified version in D:\prg\projects\GetNuTool\GetNuTool\embedded\\gnt.core ...
MSBuild Tools: "C:\Program Files (x86)\MSBuild\14.0\bin\amd64\\msbuild.exe"
Core 1 'D:\prg\projects\GetNuTool\GetNuTool\embedded\\../minified/gnt.core'
Core 2 'D:\prg\projects\GetNuTool\GetNuTool\embedded\\gnt.core'
Compute SHA-1 ...
Core 1 == Core 2 :: Core 1 is completely identical Core 2
18:31:10.0157 [INFO]: [Pre] finished SBE: Building
18:31:10.0788 [INFO]: Launching action 'Binaries & tools ...' :: Configuration - 'Release|x86'
18:31:10.0788 [INFO]: Use Script Mode
18:31:10.1858 [INFO]: [Post] finished SBE: Binaries & tools ...
18:31:10.1858 [INFO]: Launching action 'Zip' :: Configuration - 'Release|x86'
18:31:10.1968 [INFO]: Use Script Mode
18:31:10.2409 [ERROR]: Post-Build error: Can not load 7-zip library or internal COM error! Message: failed to load library.

so yes, the detected above msbuild.exe is x64 and IntPtr now is 8 bytes !

SevenZipSharp.dll:

if ((_modulePtr = NativeMethods.LoadLibrary(libraryFileName)) == IntPtr.Zero)
{
    throw new SevenZipLibraryException("failed to load library.");
}

TODO: to consider Conari instead of omg SevenZipSharp -_-

How to fix temporarily (for current versions):

Firstly ! the Can not load 7-zip library it can also mean any problems for path to 7z.dll

If you are using something like:

msbuild "LunaRoad.sln" /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" ... <args>

try this:

"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild" "LunaRoad.sln" ... <args>

CI.MSBuild.bat is already stored with vssbe and contains:

msbuild %* /l:"%~dp0%cimdll%" /nologo

But if you have problem with architecture ~ Error 193 (0xC1) (SevenZipSharp lib can't manage this, but you can read here) - you need use x86 msbuild. For Visual Studio users shouldn't be problems because all versions of VS still is 32bit

Updated: temporarily you can use my msbuild-helper with -notamd64 option - https://github.com/3F/GetNuTool/blob/master/msbuild.bat

msbuild -notamd64 <args> - to select x86 instance instead of x64 if it's possible.
msbuild <args> - to select any available instance.

for example:

msbuild -notamd64 "gnt.sln" /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" /m:4
@3F 3F added the support label Dec 6, 2016
@3F
Copy link
Owner Author

3F commented Dec 6, 2016

Later I will distribute both versions x86 & x64 7z.Libs

@3F 3F changed the title 7z x64 & amd64\msbuild.exe: Can not load 7-zip library or internal COM error 7z & amd64\msbuild.exe: Can not load 7-zip library or internal COM error Dec 6, 2016
3F added a commit to 3F/GetNuTool that referenced this issue Dec 8, 2016
…onBuildEvent#38

also fixes `-unpack` & `-msbuild` commands for gnt.bat when using double quotes
3F added a commit to 3F/GetNuTool that referenced this issue Dec 8, 2016
    * NEW: Executable version. Implemented `-unpack` command.
           To generate minified version from executable.
           ```
           gnt -unpack
           ```

    * NEW: Executable version. Implemented `-msbuild` command.
           To use specific msbuild for executable version.
           ```
           gnt -msbuild "D:\MSBuild\bin\amd64\msbuild" /p:ngpackages="Conari"
           ```

    * NEW: Added ';' splitter for .config files.
           The `|` now is marked as obsolete and can be removed in new versions.

    * NEW: MSBuild-helper with `-notamd64` option.
           Related issue: 3F/vsSolutionBuildEvent#38

    * FIXED: Part of unhandled exceptions has been changed on messages to stderr:
            `The "PrepareList" task failed unexpectedly / FileNotFoundException`
             The "NGPack" task - DirectoryNotFoundException & The "NGDownload" task - WebException 404

    * CHANGED: Value of `ngconfig` property now is `packages.config` by default.
@3F 3F added this to the 0.12.12 milestone Aug 4, 2019
@3F 3F closed this as completed in de87032 Sep 23, 2019
3F added a commit that referenced this issue Sep 26, 2019
* NEW: Integration with MvsSln project. v2.4 PR #53.
       Replaces processing from IsolatedEnv/MSBuild/+ and fully removes our old parser.
       Finally it fixes lot of bugs (such as: #42, #41, #40,..) and also improves performance.
       https://github.com/3F/MvsSln

* NEW: Open Source independent script engines under the MIT License. Issue #55.

* NEW: Integration with E-MSBuild project. v1.14. Part of PR #56.
       Advanced Evaluator of MSBuild scripts with user-variables support through Varhead and more.
       https://github.com/3F/E-MSBuild

* NEW: Integration with SobaScript -- an Extensible Modular Scripting Programming Language.
       Part of PR #56.
       https://github.com/3F/SobaScript

* NEW: Included SobaScript Components:
       Z.Core: https://github.com/3F/SobaScript.Z.Core
        * ConditionComponent
        * EvMSBuildComponent
        * UserVariableComponent
        * TryComponent
        * CommentComponent
        * BoxComponent

       Z.Ext: https://github.com/3F/SobaScript.Z.Ext
        * SevenZipComponent
        * NuGetComponent
        * FileComponent
        * FunctionComponent

       Z.VS: https://github.com/3F/SobaScript.Z.VS
        * DTEComponent
        * OwpComponent
        * BuildComponent

* FIXED: Possible "Can not load 7-zip library or internal COM error"
         When using x64 instance. Issue #38.

* FIXED: Possible "An equivalent project is already present in the project collection."
         Issue #42.

* FIXED: Possible incorrect projects for MSBuild Properties
            ~ $(TargetFrameworkVersion:Metadata) Issue #41.

* FIXED: Failed getting project from EnvDTE. Issue #40.

* CHANGED: Increased performance when evaluating data and scripts.

* CHANGED: Updated 7z.Libs 19.0.1.

* CHANGED: Updated AvalonEdit 5.0.4

* CHANGED: Updated Microsoft.VisualStudio.Shell.15.0 15.9.28307

* CHANGED: SDK15 packages only:
           Updated Microsoft.Build & Microsoft.Build.Framework 16.0.461

* CHANGED: Updated EnvDTE 8.0.2

* CHANGED: Updated EnvDTE80 8.0.3

* CHANGED: Updated Newtonsoft.Json 12.0.2

* CHANGED: Updated Microsoft.VisualStudio.SDK.EmbedInteropTypes 15.0.27

* CHANGED: StreamJsonRpc 2.0.208

* CHANGED: System.ValueTuple 4.5.0

* CHANGED: NuGet package `vsSBE.CI.MSBuild` is obsolete. Please use new:
           https://www.nuget.org/packages/vsSolutionBuildEvent
           Also new 'tools\' folder instead of 'bin\'.

* KNOWN: Possible Failed Project.Pre/Post-binding: 'Object reference not set to an instance of an object.'
         Issue #43.
         Please enable debug mode, we're waiting for your reports.

* KNOWN: Known problem for VS2019. Build can be started before activation of our plugin.
         This is a feature of the modern VS platform with lazy loading of all plugins.
         Solution:
         Just attach once our [status panel] and this will always activate our plugin before start.

* KNOWN: Known problem when deactivated [Status Panel] from `View` - `Other Windows`.
         Incorrect identifier in previous version produces wrong tool.
         Solution:
         Just close this panel. Then, open it again from `View` - `Other Windows`.

* NOTE: Please note. New releases has been migrated from SourceForge to GitHub Release Page:
        https://github.com/3F/vsSolutionBuildEvent/releases
        https://vssbe.r-eg.net/Downloads/

* NOTE: Here is about SDK10 / SDK15 packages:
        https://vssbe.r-eg.net/doc/Usage/#sdk10--sdk15-versions
3F added a commit to 3F/vsCommandEvent that referenced this issue Oct 21, 2019
* NEW: Visual Studio 2019 full support. SDK15.

* NEW: Complete integration with VS2017. SDK15.

       For VS2017 will be also available old SDK10 package implementation.
       But SDK15 is recommended.

* NEW: Integration with MvsSln project. v2.5.
       Replaces processing for Advanced MSBuild.
       https://github.com/3F/MvsSln

* NEW: Integration with E-MSBuild project. v1.14.
       Advanced Evaluator of MSBuild scripts with user-variables support through Varhead and more.
       https://github.com/3F/E-MSBuild

* NEW: Integration with SobaScript -- an Extensible Modular Scripting Programming Language.
       https://github.com/3F/SobaScript

* NEW: Included SobaScript Components:
       Z.Core: https://github.com/3F/SobaScript.Z.Core
        * ConditionComponent
        * EvMSBuildComponent
        * UserVariableComponent
        * TryComponent
        * CommentComponent
        * BoxComponent

       Z.Ext: https://github.com/3F/SobaScript.Z.Ext
        * SevenZipComponent
        * NuGetComponent
        * FileComponent
        * FunctionComponent

       Z.VS: https://github.com/3F/SobaScript.Z.VS
        * DTEComponent
        * OwpComponent
        * BuildComponent

* FIXED: Fixed IEnvironment.ProjectsMBE implementations.

* FIXED: Possible "Can not load 7-zip library or internal COM error"
         When using x64 instance.
         Related Issue 3F/vsSolutionBuildEvent#38

* FIXED: Possible "An equivalent project is already present in the project collection."
         Related Issue 3F/vsSolutionBuildEvent#42.

* FIXED: Possible incorrect projects for MSBuild Properties
            ~ $(TargetFrameworkVersion:Metadata) Issue #41.

* FIXED: Failed getting project from EnvDTE.
         Related Issue 3F/vsSolutionBuildEvent#40.

* CHANGED: Increased performance when evaluating data and scripts due to new SobaScript and E-MSBuild.

* CHANGED: netfx target platform changes:

           * 4.0 only: VS2010, VS2012, VS2013, VS2015, VS2017
           * 4.6 only: VS2017, VS2019

* CHANGED: Replaced old msbuild helper on hMSBuild 2.2
           https://github.com/3F/hMSBuild

* CHANGED: Updated 7z.Libs 19.0.1.

* CHANGED: Updated AvalonEdit 5.0.4

* CHANGED: Updated Microsoft.VisualStudio.Shell.15.0 15.9.28307

* CHANGED: SDK15 packages only:
           Updated Microsoft.Build & Microsoft.Build.Framework 16.0.461

* CHANGED: Updated EnvDTE 8.0.2

* CHANGED: Updated EnvDTE80 8.0.3

* CHANGED: Updated Newtonsoft.Json 12.0.2

* CHANGED: Updated Microsoft.VisualStudio.SDK.EmbedInteropTypes 15.0.27

* CHANGED: StreamJsonRpc 2.0.208

* CHANGED: System.ValueTuple 4.5.0

* NOTE: Our new releases migrated from SourceForge to GitHub Release Page:
        https://github.com/3F/vsCommandEvent/releases

        Most actual information is still here: https://vsce.r-eg.net/Downloads/

* NOTE: Mirror src on bitbucket is obsolete now.
        Please use only GitHub: https://github.com/3F/vsCommandEvent

* NOTE: Here is about SDK10 / SDK15 packages:
        https://vssbe.r-eg.net/doc/Usage/#sdk10--sdk15-versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant