Bug 60753 - Cannot run C# program built with mkbundle unless mono is installed due to URL error
Summary: Cannot run C# program built with mkbundle unless mono is installed due to URL...
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: mkbundle ()
Version: 5.4 (2017-06)
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-18 21:41 UTC by Nicholas Deepizza
Modified: 2017-11-18 21:52 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 60753 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Nicholas Deepizza 2017-11-18 21:41:33 UTC
I am trying to build this C# program using MkBundle so that users can run it on Linux without having to install Mono. 


But I keep getting an error when trying to use the program that is built.

Steps to reproduce:

Git clone this project:

https://github.com/nddipiazza/Sharepoint-Exporter

Now download the DLL's in this:

https://www.microsoft.com/en-us/download/confirmation.aspx?id=35585 - SharePoint Server 2013 Client Components SDK

In Solution explorer, right click References -> Add reference -> Browse .NET assemblies -> Add the Microsoft sharepoint DLLs 

Microsoft.SharePoint.Client.dll
Microsoft.SharePoint.Client.Runtime.dll

Build the application.

Now run:

mkbundle --simple --static --deps -o ./SpFetcher bin/Release/SpPrefetchIndexBuilder.exe

It seems to run no problme:

ndipiazza@mate:~/lucidworks/Sharepoint-Exporter/SpCrawler (master)*$ mkbundle --simple --static --deps -o ./SpFetcher bin/Release/SpPrefetchIndexBuilder.exe
Using runtime: /usr/bin/mono
     Assembly: /home/ndipiazza/lucidworks/Sharepoint-Exporter/SpCrawler/bin/Release/SpPrefetchIndexBuilder.exe
       Config: /usr/bin/mono
     Assembly: /usr/lib/mono/4.5/mscorlib.dll
     Assembly: /usr/lib/mono/4.5/System.Net.Http.dll
     Assembly: /usr/lib/mono/4.5/System.dll
     Assembly: /usr/lib/mono/4.5/Mono.Security.dll
     Assembly: /usr/lib/mono/4.5/System.Configuration.dll
     Assembly: /usr/lib/mono/4.5/System.Xml.dll
     Assembly: /usr/lib/mono/4.5/System.Security.dll
     Assembly: /usr/lib/mono/4.5/System.Core.dll
     Assembly: /usr/lib/mono/4.5/Mono.Posix.dll
     Assembly: /usr/lib/mono/4.5/System.Web.Extensions.dll
     Assembly: /usr/lib/mono/4.5/System.Web.dll
     Assembly: /usr/lib/mono/4.5/System.Drawing.dll
     Assembly: /usr/lib/mono/4.5/System.Runtime.Serialization.Formatters.Soap.dll
     Assembly: /usr/lib/mono/4.5/System.Data.dll
     Assembly: /usr/lib/mono/4.5/System.Numerics.dll
     Assembly: /usr/lib/mono/4.5/System.Transactions.dll
     Assembly: /usr/lib/mono/4.5/Mono.Data.Tds.dll
     Assembly: /usr/lib/mono/4.5/System.EnterpriseServices.dll
     Assembly: /usr/lib/mono/4.5/System.Web.ApplicationServices.dll
     Assembly: /usr/lib/mono/4.5/System.ComponentModel.DataAnnotations.dll
     Assembly: /usr/lib/mono/4.5/Mono.Data.Sqlite.dll
     Assembly: /usr/lib/mono/4.5/System.Web.Services.dll
     Assembly: /usr/lib/mono/4.5/System.DirectoryServices.dll
     Assembly: /usr/lib/mono/4.5/Novell.Directory.Ldap.dll
     Assembly: /usr/lib/mono/4.5/System.Design.dll
     Assembly: /usr/lib/mono/4.5/System.Windows.Forms.dll
     Assembly: /usr/lib/mono/4.5/Accessibility.dll
     Assembly: /usr/lib/mono/4.5/Mono.WebBrowser.dll
     Assembly: /usr/lib/mono/4.5/System.Data.Linq.dll
     Assembly: /usr/lib/mono/4.5/System.Runtime.Serialization.dll
     Assembly: /usr/lib/mono/4.5/System.ServiceModel.Internals.dll
     Assembly: /usr/lib/mono/4.5/System.ServiceModel.dll
     Assembly: /usr/lib/mono/4.5/System.IdentityModel.dll
     Assembly: /usr/lib/mono/4.5/System.Messaging.dll
     Assembly: /usr/lib/mono/4.5/Mono.Messaging.dll
     Assembly: /usr/lib/mono/4.5/System.Configuration.Install.dll
     Assembly: /usr/lib/mono/4.5/System.IdentityModel.Selectors.dll
     Assembly: /usr/lib/mono/4.5/System.ServiceModel.Activation.dll
     Assembly: /home/ndipiazza/lucidworks/Sharepoint-Exporter/SpCrawler/Microsoft.SharePoint.Client.dll
     Assembly: /home/ndipiazza/lucidworks/Sharepoint-Exporter/SpCrawler/Microsoft.SharePoint.Client.Runtime.dll
     Assembly: /usr/lib/mono/4.5/System.Xml.Linq.dll
     Assembly: /usr/lib/mono/4.5/I18N.West.dll
     Assembly: /usr/lib/mono/4.5/I18N.dll
Generated ./SpFetcher

Now run: 

./SpFetcher

On the machine with Mono, it works fine.

On a machine without mono, you get the error:

 The URI prefix is not recognized.
  at System.Net.WebRequest.Create (System.Uri requestUri, System.Boolean useUriBase) [0x000ae] in <50d80b08c1a5449282b22aedf03ce925>:0 
  at System.Net.WebRequest.Create (System.String requestUriString) [0x00014] in <50d80b08c1a5449282b22aedf03ce925>:0 
  at Microsoft.SharePoint.Client.SPWebRequestExecutor..ctor (Microsoft.SharePoint.Client.ClientRuntimeContext context, System.String requestUrl) [0x0002e] in <c0e6dcb0d2c7447bb9d4f89eec39d654>:0 
  at Microsoft.SharePoint.Client.DefaultWebRequestExecutorFactory.CreateWebRequestExecutor (Microsoft.SharePoint.Client.ClientRuntimeContext context, System.String requestUrl) [0x00021] in <c0e6dcb0d2c7447bb9d4f89eec39d654>:0 
  at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate () [0x0000d] in <e2eb771f808b400bbe60d58b69acf7f0>:0 
  at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest () [0x0001f] in <e2eb771f808b400bbe60d58b69acf7f0>:0 
  at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery () [0x00008] in <e2eb771f808b400bbe60d58b69acf7f0>:0 
  at SpPrefetchIndexBuilder.SpPrefetchIndexBuilder.getSubWebs (System.String url, System.Collections.Generic.Dictionary`2[TKey,TValue] parentWebDict) [0x00266] in <8afd075a89d9457b827aef736e8e1c09>:0 
  at SpPrefetchIndexBuilder.SpPrefetchIndexBuilder.Main (System.String[] args) [0x00018] in <8afd075a89d9457b827aef736e8e1c09>:0 


That error is not expected.
Comment 1 Nicholas Deepizza 2017-11-18 21:44:27 UTC
Mono JIT compiler version 5.4.1.6 (tarball Wed Nov  8 20:37:08 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
Comment 3 Nicholas Deepizza 2017-11-18 21:52:04 UTC
My project is using .NET 4.6.1