I am not able to build an update with Electron-Builder and Squirrel for a test application. The problem I think Wine does not find the 7z.exe file. Here's a part of the error that I think is the main problem:
Utility: Failed to extract file /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.0-full.nupkg to /Users/<user>/.local/share/SquirrelTemp/tempa
wine: cannot find L"C:\\windows\\system32\\.7z.exe"
I tried installing 7-Zip x64 and x86. I even tried to install it in c:/ windows/system32/.
Building for Windows on macOS.
package.json
{
"name": "electronquickstart",
"version": "1.0.1",
"description": "A minimal Electron application",
"main": "./app/main.js",
"scripts": {
"start": "electron .",
"dist": "build -w --x64"
},
"repository": "",
"keywords": [
"Electron",
"quick",
"start",
"tutorial",
"demo"
],
"author": "GitHub",
"license": "CC0-1.0",
"devDependencies": {
"electron": "~1.7.8",
"electron-builder": "^19.49.2",
"electron-builder-squirrel-windows": "^19.49.0"
},
"build": {
"appId": "com.domain.test",
"copyright": "Copyright © 2017 Company",
"productName": "Teste",
"electronVersion": "1.7.8",
"win": {
"target": [
"squirrel"
],
"certificateFile": "./certificate/certificate.pfx",
"certificatePassword": "password00",
"icon": "./build/icon.ico"
},
"squirrelWindows": {
"remoteReleases": "http://example.com/installer/",
"iconUrl": "http://example.com/favicon.ico",
"useAppIdAsId": false
}
},
"dependencies": {
}
}
Complete log:
Error: Exit code: 255. Command failed: mono /Users/<user>/Library/Caches/electron-builder/Squirrel.Windows/Squirrel.Windows-1.7.8/Update-Mono.exe --releasify /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.1-full.nupkg --releaseDir /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows
2017-12-27 16:45:21> Utility: Failed to extract file /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.0-full.nupkg to /Users/<user>/.local/share/SquirrelTemp/tempa
wine: cannot find L"C:\\windows\\system32\\.7z.exe"
2017-12-27 16:45:21> Unhandled exception: System.AggregateException: One or more errors occurred. ---> System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <6e9b92f0d119424382ef180639777acb>:0
at Squirrel.DeltaPackageBuilder.CreateDeltaPackage (Squirrel.ReleasePackage basePackage, Squirrel.ReleasePackage newPackage, System.String outputFile) [0x000e9] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00110] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x004c4] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00097] in <6dfa1b8045584e6384eb68e7d588f716>:0
---> (Inner Exception #0) System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0 <---
System.AggregateException: One or more errors occurred. ---> System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <6e9b92f0d119424382ef180639777acb>:0
at Squirrel.DeltaPackageBuilder.CreateDeltaPackage (Squirrel.ReleasePackage basePackage, Squirrel.ReleasePackage newPackage, System.String outputFile) [0x000e9] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00110] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x004c4] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.main (System.String[] args) [0x000bb] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.Main (System.String[] args) [0x00006] in <6dfa1b8045584e6384eb68e7d588f716>:0
---> (Inner Exception #0) System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0 <---
2017-12-27 16:45:13> Program: Starting Squirrel Updater: --releasify /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.1-full.nupkg --releaseDir /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows
2017-12-27 16:45:14> DeltaPackageBuilder: Extracting /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.0-full.nupkg and /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.1-full.nupkg into /Users/<user>/.local/share/SquirrelTemp/tempb
2017-12-27 16:45:21> Utility: Failed to extract file /Users/<user>/developer/electron-examples/installer-and-auto-update/dist/squirrel-windows/electronquickstart-1.0.0-full.nupkg to /Users/<user>/.local/share/SquirrelTemp/tempa
wine: cannot find L"C:\\windows\\system32\\.7z.exe"
2017-12-27 16:45:21> Unhandled exception: System.AggregateException: One or more errors occurred. ---> System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <6e9b92f0d119424382ef180639777acb>:0
at Squirrel.DeltaPackageBuilder.CreateDeltaPackage (Squirrel.ReleasePackage basePackage, Squirrel.ReleasePackage newPackage, System.String outputFile) [0x000e9] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00110] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x004c4] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00097] in <6dfa1b8045584e6384eb68e7d588f716>:0
---> (Inner Exception #0) System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0 <---
System.AggregateException: One or more errors occurred. ---> System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <6e9b92f0d119424382ef180639777acb>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <6e9b92f0d119424382ef180639777acb>:0
at Squirrel.DeltaPackageBuilder.CreateDeltaPackage (Squirrel.ReleasePackage basePackage, Squirrel.ReleasePackage newPackage, System.String outputFile) [0x000e9] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00110] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x004c4] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.main (System.String[] args) [0x000bb] in <6dfa1b8045584e6384eb68e7d588f716>:0
at Squirrel.Update.Program.Main (System.String[] args) [0x00006] in <6dfa1b8045584e6384eb68e7d588f716>:0
---> (Inner Exception #0) System.Exception: wine: cannot find L"C:\\windows\\system32\\.7z.exe"
at Squirrel.Utility+<ExtractZipToDirectory>d__22.MoveNext () [0x000ff] in <6dfa1b8045584e6384eb68e7d588f716>:0 <---
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/builder-util/src/util.ts:109:16
at ChildProcess.exithandler (child_process.js:279:5)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
From previous event:
at exec (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/builder-util/src/util.ts:77:3)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/src/squirrelPack.ts:109:24
at Generator.next (<anonymous>)
From previous event:
at SquirrelBuilder.releasify (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/out/squirrelPack.js:277:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/src/squirrelPack.ts:88:16
From previous event:
at SquirrelBuilder.buildInstaller (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/out/squirrelPack.js:258:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/src/SquirrelWindowsTarget.ts:35:27
at Generator.next (<anonymous>)
From previous event:
at SquirrelWindowsTarget.build (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js:82:11)
at taskManager.addTask.default.map.it (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/platformPackager.ts:120:85)
From previous event:
at WinPackager.packageInDistributableFormat (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/platformPackager.ts:120:41)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/platformPackager.ts:116:10
at Generator.next (<anonymous>)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
at WinPackager.pack (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/out/platformPackager.js:195:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/packager.ts:345:24
at Generator.next (<anonymous>)
at xfs.stat (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:167:5)
From previous event:
at Packager.doBuild (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/out/packager.js:407:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/packager.ts:289:52
From previous event:
at Packager._build (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/out/packager.js:351:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/src/packager.ts:259:23
at Generator.next (<anonymous>)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
at Packager.build (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder-lib/out/packager.js:311:11)
at /Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/src/builder.ts:287:40
at Generator.next (<anonymous>)
From previous event:
at _build (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/out/builder.js:61:21)
at build (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/src/builder.ts:257:10)
at then (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/src/cli/cli.ts:49:4)
at runCallback (timers.js:800:20)
at tryOnImmediate (timers.js:762:5)
at processImmediate [as _immediateCallback] (timers.js:733:5)
From previous event:
at Object.args [as handler] (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/src/cli/cli.ts:49:4)
at Object.runCommand (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/yargs/lib/command.js:228:22)
at Object.parseArgs [as _parseArgs] (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/yargs/yargs.js:1041:24)
at Object.get [as argv] (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/yargs/yargs.js:957:21)
at Object.<anonymous> (/Users/<user>/developer/electron-examples/installer-and-auto-update/node_modules/electron-builder/src/cli/cli.ts:43:15)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I've spent a lot of hours debugging this issue...
I have feeling that Squirell and electron-builder are poorly made
Were able to workaround this by coping 7z.exe into ~/.cache/electron-builder/Squirrel.Windows/Squirrel.Windows-1.7.8/ (on linux)
Update-Mono.exe is launched from there, so then it able to find 7z.exe
UPD: for mac os dir should be /Users/<user>/Library/Caches/electron-builder/Squirrel.Windows/Squirrel.Windows-1.7.8/Update-Mono.exe
Related
I need to launch an .exe executable, so I installed monodevelop:
Mono JIT compiler version 6.8.0.105 (Debian 6.8.0.105+dfsg-2 Wed Feb 26 23:23:50 UTC 2020)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: hybrid
GC: sgen (concurrent by default)
with all its dependancies.
Monodevelop can be opened from the App manager, but when I try to execute the app that I want with:
sudo mono UnigeGpioBoard.exe
I obtain the following Unhandled Exception error, which I cannot understand.
Unhandled Exception:
System.IO.DirectoryNotFoundException: Could not find a part of the path "/home/lorenzo/T2K-uniGe/FEB_GPIO/FEB-GPIO_firmware/UT_60charge/etc/FrontEnd/Crash_4/12/2022_2:52:34_PM.log".
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001ac] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00061] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.StreamWriter..ctor (System.String path) [0x00008] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
at System.IO.File.WriteAllText (System.String path, System.String contents) [0x0002c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at UnigeGpioBoard.App.MainClass.Main (System.String[] args) [0x000e1] in <c165a6db1da14092976c38f3925fcc71>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.DirectoryNotFoundException: Could not find a part of the path "/home/lorenzo/T2K-uniGe/FEB_GPIO/FEB-GPIO_firmware/UT_60charge/etc/FrontEnd/Crash_4/12/2022_2:52:34_PM.log".
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001ac] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00061] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.StreamWriter..ctor (System.String path) [0x00008] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
at System.IO.File.WriteAllText (System.String path, System.String contents) [0x0002c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at UnigeGpioBoard.App.MainClass.Main (System.String[] args) [0x000e1] in <c165a6db1da14092976c38f3925fcc71>:0
Any help is appreciated, I work with Ubuntu 20.04.4
I have an application that is made by .NET and i use mono 6.4.0.198 (i use the newest mono so the app is compatible with Catalina MacOS) to run it on the Mac machine, on my machine the mono is installed so the app works fine, but when i run the app on other Macs it return the following exception
[ERROR] FATAL UNHANDLED EXCEPTION: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'System.Diagnostics.SystemDiagnosticsSection' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Diagnostics.AssertSection' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ComponentModel.TypeDescriptor' threw an exception. ---> System.DllNotFoundException: /libmono-native-compat.dylib assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.GetNonCryptographicallySecureRandomBytes(byte*,int)
at Interop.GetRandomBytes (System.Byte* buffer, System.Int32 length) [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Guid.NewGuid () [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.ComponentModel.TypeDescriptor..cctor () [0x00034] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
--- End of inner exception stack trace ---
at System.Configuration.ConfigurationProperty..ctor (System.String name, System.Type type, System.Object defaultValue, System.Configuration.ConfigurationPropertyOptions options) [0x00000] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Diagnostics.AssertSection..cctor () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
at System.Diagnostics.SystemDiagnosticsSection..cctor () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in <b814b509d4ad406fb40c6c93e38929e7>:0
--- End of inner exception stack trace ---
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x0001a] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00095] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.RuntimeType.CreateInstanceSlow (System.Boolean publicOnly, System.Boolean wrapExceptions, System.Boolean skipCheckThis, System.Boolean fillCache) [0x00009] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.RuntimeType.CreateInstanceDefaultCtor (System.Boolean publicOnly, System.Boolean skipCheckThis, System.Boolean fillCache, System.Boolean wrapExceptions, System.Threading.StackCrawlMark& stackMark) [0x00027] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00020] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Activator.CreateInstance (System.Type type, System.Boolean nonPublic) [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Configuration.ConfigInfo.CreateInstance () [0x00026] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.SectionInfo.CreateInstance () [0x00000] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, System.Boolean createDefaultInstance) [0x0001c] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x0002c] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.Configuration.GetSection (System.String sectionName) [0x00016] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00006] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00005] in <181a8ffed1274b05b3ed7ea8bc6e1333>:0
at System.Configuration.PrivilegedConfigurationManager.GetSection (System.String sectionName) [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.DiagnosticsConfiguration.Initialize () [0x0002a] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.DiagnosticsConfiguration.get_IndentSize () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.TraceInternal.InitializeSettings () [0x0004e] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.TraceInternal.get_Listeners () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at System.Diagnostics.Trace.get_Listeners () [0x00000] in <6aa0b19d109a447c94d1b43ec4471dc6>:0
at Zoolz.Program.Main (System.String[] args) [0x00040] in <d6a87962027b42c6878475ce75623731>:0
clearly its a missing dll libmono-native-compat.dylib i added this dll at the application resources alongside other dlls but the app still returning the same missing dll exception, how i can direct mono to dll so i would fix this problem
I had many errors when I installed the macOS Catalina until I decide to give permission to my /private/tmp folder. It seems all apps work now. I don't know if it's your case but just in case try this:
sudo chmod 777 /private/tmp
I solved this issue by
creating a file called fix.config and it contains the following XML
<configuration>
<dllmap dll="System.Native" target="libmono-native-compat.dylib" os="!windows" />
<dllmap dll="System.Net.Security.Native" target="libmono-native-compat.dylib" os="!windows" />
<dllmap dll="System.Security.Cryptography.Native.Apple" target="libmono-native-compat.dylib" os="osx" />
</configuration>
the i copied the three dylibs that are mentioned in the XML to the path Application/MyApp.app/Contents/lib
then in the in the building script i added to the tool mkbundle the following command
--config $SETUP_DIR/fix.config and setup path is the path where im creating my .pkg file
NOTE: im using mono version 6.4.0.198
When I run my ASP.NET MVC 4 website on my Fedora 20 workstation with xsp4 (from MonoDevelop or directly) I'm getting the following exception:
System.Web.HttpRuntime.FinishWithException (wr={Mono.WebServer.XSPWorkerRequest}, e={System.Web.HttpException: ---> System.Web.HttpException: The pre-application start initialization method Start on type System.Web.WebPages.PreApplicationStartCode threw an exception with the following error message: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for <Module> ---> System.Security.SecurityException: No access to the given key ---> System.UnauthorizedAccessException: Access to the path "/etc/mono/registry" is denied.
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00064] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:113
at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:80
at System.IO.DirectoryInfo.Create () [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/DirectoryInfo.cs:141
at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00039] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:98
at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.IO/Directory.cs:80
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x0004a] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:136
--- End of inner exception stack trace ---
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x00057] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:138
at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:116
at Microsoft.Win32.KeyHandler.Lookup (Microsoft.Win32.RegistryKey rkey, Boolean createNonExisting) [0x000cc] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:412
at Microsoft.Win32.UnixRegistryApi.OpenSubKey (Microsoft.Win32.RegistryKey rkey, System.String keyname, Boolean writable) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:836
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name, Boolean writable) [0x0001e] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:278
at Microsoft.Win32.RegistryKey.OpenSubKey (System.String name) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/Microsoft.Win32/RegistryKey.cs:262
at (wrapper remoting-invoke-with-check) Microsoft.Win32.RegistryKey:OpenSubKey (string)
at Microsoft.Web.Infrastructure.RegistryKeyWrapper.OpenSubKey (System.String name) [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.GetKillBittedVersions () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.IsThisAssemblyKillBitted () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.KillBitHelper.ThrowIfKillBitIsSet () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer+CriticalInitializer.CheckKillBit () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer+CriticalInitializer.Initialize () [0x00000] in <filename unknown>:0
at Microsoft.Web.Infrastructure.ModuleInitializer.Initialize () [0x00000] in <filename unknown>:0
at <Module>..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Web.WebPages.PreApplicationStartCode.Start () [0x0002b] in /builddir/build/BUILD/mono-3.4.0/external/aspnetwebstack/src/System.Web.WebPages/PreApplicationStartCode.cs:40
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:230
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:238
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MethodBase.cs:114
at System.Web.Compilation.BuildManager.CallPreStartMethods () [0x0004f] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:561
--- End of inner exception stack trace ---
at System.Web.Compilation.BuildManager.CallPreStartMethods () [0x0007e] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:564
at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00059] in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web/HttpApplicationFactory.cs:408
--- End of inner exception stack trace ---}) in /builddir/build/BUILD/mono-3.4.0/mcs/class/System.Web/System.Web/HttpRuntime.cs:674
I've checked it and there is no registry file or folder in /etc/mono/. I also can't find it in any subfolder, how can I resolve this question?
I'm running Fedora 20 with the latest 3.15.6 kernel
$ mono --version
Mono JIT compiler version 3.4.0 (tarball Fri Jun 27 17:26:36 UTC 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
$ xsp4 --version
xsp4.exe 3.0.0.0
Copyright (C) 2002-2011 Novell, Inc.
Minimalistic web server for testing System.Web
I have another setup in Ubuntu 14.04 LTS and that one works, so it might be something with the mono version, or maybe I'm missing some library?
Turns out simply creating the folder using mkdir
sudo mkdir /etc/mono/registry
and setting the right permissions using chmod
sudo chmod uog+rw /etc/mono/registry
does the trick.
However I still don't understand where such a folder is hidden in Ubuntu and why it doesn't need to be created there, as well as why it isn't created automatically during the installation.
You can set MONO_REGISTRY_PATH to point to a directory that you control:
bash
mkdir my-registry
MONO_REGISTRY_PATH=`pwd`/my-registry
xsp4
I am using ubuntu 13.04, I installed mono-3.1.2 on Ubuntu-13.04 successfully.
Now i am trying to run C# .exe from windows visual studio.
$ mono WindowsFormsApplication1.exe
I am getting the following :-
Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /usr/local/lib/libgdiplus.so
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0
at WindowsFormsApplication1.Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Drawing.GDIPlus ---> System.DllNotFoundException: /usr/local/lib/libgdiplus.so
at (wrapper managed-to-native) System.Drawing.GDIPlus:GdiplusStartup (ulong&,System.Drawing.GdiplusStartupInput&,System.Drawing.GdiplusStartupOutput&)
at System.Drawing.GDIPlus..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Drawing.Graphics.FromHdcInternal (IntPtr hdc) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00000] in <filename unknown>:0
at WindowsFormsApplication1.Program.Main () [0x00000] in <filename unknown>:0
How to remove this exception , please help me.
Thanks in advance.
As #knocte pointed out, you should
Install Mono via apt-get such as sudo apt-get install mono-complete, so that libgdiplus is installed as well,
Or compile both libgdiplus and Mono from source code.
raffamaiden's answer worked for me, but there's a small spelling mistake in the answer:
dnf install libgdiplus-devel
I fixed the problem on Fedora 23 by installing libgdiplus-devel as follows:
dnf install libgdiplus-devel
When I compile Monodevelop 3.1.0 for macosx from source in terminal,it failed.But when I open the 'MonoDevelop.mdw' using Monodevelo 2.8.2,using 'Run' function to build it,then it runs.But why?
Errors As follows:
Last login: Tue Jun 12 09:22:05 on console
starmatoMacBook-Pro:~ star$ cd /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop
starmatoMacBook-Pro:monodevelop star$ make runcd main && make run
PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin" PKG_CONFIG_PATH="/Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/local-config:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:" LD_LIBRARY_PATH="" DYLD_FALLBACK_LIBRARY_PATH="" MONO_GAC_PREFIX="/usr/local:" MONODEVELOP_LOCALE_PATH="./build/locale" MONO_ADDINS_REGISTRY="./build/bin" UBUNTU_MENUPROXY=0 exec -a "monodevelop" /usr/bin/mono --debug ./build/bin/MonoDevelop.exe
ERROR [2012-06-12 10:18:40Z]: Error setting process name
System.DllNotFoundException: libc.dylib
at (wrapper managed-to-native) MonoDevelop.Core.Runtime:prctl (int,byte[],intptr,intptr,intptr)
at MonoDevelop.Core.Runtime.unixSetProcessName (System.String name) [0x00000] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:257
at MonoDevelop.Core.Runtime.SetProcessName (System.String name) [0x00010] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs:240
ERROR [2012-06-12 10:18:41Z]: Error initialising GLib logging.
System.DllNotFoundException: libglib-2.0.0.dylib
at (wrapper managed-to-native) GLib.Marshaller:g_malloc (uintptr)
at GLib.Marshaller.StringToPtrGStrdup (System.String str) [0x00000] in <filename unknown>:0
at GLib.Log.SetLogHandler (System.String logDomain, LogLevelFlags flags, GLib.LogFunc logFunc) [0x00000] in <filename unknown>:0
at MonoDevelop.Ide.Gui.GLibLogging.set_Enabled (Boolean value) [0x00030] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/GLibLogging.cs:50
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x00056] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:88
FATAL ERROR [2012-06-12 10:18:41Z]: MonoDevelop failed to start. Some of the assemblies required to run MonoDevelop (for example gtk-sharp, gnome-sharp or gtkhtml-sharp) may not be properly installed in the GAC.
System.TypeInitializationException: An exception was thrown by the type initializer for Gtk.Application ---> System.DllNotFoundException: glibsharpglue-2
at (wrapper managed-to-native) GLib.Thread:glibsharp_g_thread_supported ()
at GLib.Thread.get_Supported () [0x00000] in <filename unknown>:0
at Gtk.Application..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at MonoDevelop.Ide.IdeStartup.Run (MonoDevelop.Ide.MonoDevelopOptions options) [0x0007e] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:95
at MonoDevelop.Ide.IdeStartup.Main (System.String[] args) [0x0004f] in /Users/star/Surer/DevKits/Mono/mono-monodevelop-git/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs:503
make[1]: *** [runmd] Error 255
make: *** [run] Error 2
starmatoMacBook-Pro:monodevelop star$
Your DYLD_LIBRARY_FALLBACK_PATH environment variable is broken. You can fix it with:
export DYLD_LIBRARY_FALLBACK_PATH="/Library/Frameworks/Mono.framework/Versions/Current/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"