Fail to create an F# project under Monodevelop on OSX - macos

I get the following error from MonoDevelop
System.TypeLoadException: A type load exception has occurred.
at MonoDevelop.Projects.DotNetProject.CreateConfiguration (System.String name) [0x000cc] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:753
at MonoDevelop.Projects.DotNetProject..ctor (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation projectCreateInfo, System.Xml.XmlElement projectOptions) [0x0011f] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs:120
at MonoDevelop.Projects.DotNetAssemblyProject..ctor (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation projectCreateInfo, System.Xml.XmlElement projectOptions) [0x00000] in <filename unknown>:0
at MonoDevelop.Projects.DotNetProjectBinding.CreateProject (System.String languageName, MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs:51
at MonoDevelop.Projects.DotNetProjectBinding.CreateProject (MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x0000c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectBinding.cs:46
at MonoDevelop.Projects.ProjectService.CreateProject (System.String type, MonoDevelop.Projects.ProjectCreateInformation info, System.Xml.XmlElement projectOptions) [0x00033] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs:498
at MonoDevelop.Ide.Templates.ProjectDescriptor.CreateItem (MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage) [0x00036] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs:116
at MonoDevelop.Ide.Templates.SolutionDescriptor.CreateEntry (MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage) [0x001bc] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SolutionDescriptor.cs:152
at MonoDevelop.Ide.Templates.ProjectTemplate.CreateWorkspaceItem (MonoDevelop.Projects.ProjectCreateInformation cInfo) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplate.cs:232
at MonoDevelop.Ide.Projects.NewProjectDialog.CreateProject () [0x001ef] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs:432
If I try to load an existing F# project then I get the error
Error while trying to load the project
'/Users/bradphelan/workspace/myfirstfsharp/myfirstfsharp/myfirstfsharp.fsproj':
Could not load type 'MonoDevelop.FSharp.FSharpCompilerParameters'
from assembly 'FSharpBinding, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Note that I can create a C# project.
* EDIT UPDATE *
Got errors rebuilding the fsharp bindings
Errors:
/Users/bradphelan/workspace/fsharpbinding/monodevelop/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.local.fsproj (default targets) ->
/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/4.0/Microsoft.Common.targets (ResolveProjectReferences target) ->
/Users/bradphelan/workspace/fsharpbinding/FSharp.CompilerBinding/FSharp.CompilerBinding.fsproj (default targets) ->
/Users/bradphelan/workspace/fsharpbinding/lib/fsharp/Microsoft.FSharp.Targets (CoreCompile target) ->
: error : Error initializing task ItemGroup: Not registered task ItemGroup.
/Users/bradphelan/workspace/fsharpbinding/monodevelop/MonoDevelop.FSharpBinding/MonoDevelop.FSharp.local.fsproj (default targets) ->
/Users/bradphelan/workspace/fsharpbinding/lib/fsharp/Microsoft.FSharp.Targets (CreateManifestResourceNames target) ->
: error : Error initializing task ItemGroup: Not registered task ItemGroup.

Related

Xamarin.Android.Targets fails with error "Input string was not in a correct format."

The error below contains "Input string was not in a correct format.", and I can't figure out what may be causing this issue.
I can post more complete project / logs if necessary. The project builds fine on iOS
Target _CreateBaseApk:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : Input string was not in a correct format.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x0005f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/number.cs:1077
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00013] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/number.cs:745
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Int32.Parse (System.String s) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/int32.cs:120
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.ManifestDocument.CalculateVersionCode (System.String currentAbi, System.String versionCodePattern, System.String versionCodeProperties) [0x000bb] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands (System.String ManifestFile, System.String currentAbi, System.String currentResourceOutputFile) [0x000d7] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.Aapt.ProcessManifest (Microsoft.Build.Framework.ITaskItem manifestFile) [0x0017d] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass32_0`2[TSource,TLocal].<ForEachWorker>b__0 (System.Int32 i) [0x00000] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x000db] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : --- End of stack trace from previous location where exception was thrown ---
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error :
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x001f1] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs:123
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs:78
Done building target "_CreateBaseApk" in project "WebOfTrust.Android.csproj" -- FAILED.
Done building project "WebOfTrust.Android.csproj" -- FAILED.
Build FAILED.
ViewModels/Client/WalletViewModel.cs(42,13,42,38): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
ViewModels/PurchaseInApp/ItemCatalogViewModel.cs(97,30,97,32): warning CS0168: The variable 'ex' is declared but never used
ViewModels/PurchaseInApp/ItemCatalogViewModel.cs(202,30,202,32): warning CS0168: The variable 'ex' is declared but never used
ViewModels/Client/TrustAnchorListViewModel.cs(16,28,16,46): warning CS0169: The field 'TrustAnchorListViewModel._navigationService' is never used
ViewModels/ChildViewModelBase.cs(31,35,31,50): warning CS0067: The event 'ChildViewModelBase.IsActiveChanged' is never used
ViewModels/Client/PrivacyScenarioListViewModel.cs(15,28,15,46): warning CS0169: The field 'PrivacyScenarioListViewModel._navigationService' is never used
/Library/Frameworks/Mono.framework/Versions/5.16.0/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(2127,5): warning MSB3277: Found conflicts between different versions of "System.Net.Http" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : Input string was not in a correct format.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x0005f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/number.cs:1077
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00013] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/number.cs:745
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Int32.Parse (System.String s) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/int32.cs:120
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.ManifestDocument.CalculateVersionCode (System.String currentAbi, System.String versionCodePattern, System.String versionCodeProperties) [0x000bb] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.Aapt.GenerateCommandLineCommands (System.String ManifestFile, System.String currentAbi, System.String currentResourceOutputFile) [0x000d7] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at Xamarin.Android.Tasks.Aapt.ProcessManifest (Microsoft.Build.Framework.ITaskItem manifestFile) [0x0017d] in <83926d11b31545cc8ffa045c79833692>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass32_0`2[TSource,TLocal].<ForEachWorker>b__0 (System.Int32 i) [0x00000] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x000db] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : --- End of stack trace from previous location where exception was thrown ---
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error :
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[TLocal].<ForWorker>b__1 (System.Threading.Tasks.RangeWorker& currentWorker, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x001f1] in <0242286efc4a47b69b5a84e828f56ef8>:0
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs:123
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2246,3): error : at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-06/external/bockbuild/builds/mono-x64/external/corefx/src/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/TaskReplicator.cs:78
7 Warning(s)
1 Error(s)
Time Elapsed 00:00:18.87
---------------------- Done ----------------------
Build: 1 error, 7 warnings
Mainfest.xml
The manifest uses a "normal" build number and version.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1.0" android:versionName="1.0" package="ZeroPKI.WebOfTrust">
<uses-sdk android:minSdkVersion="24" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:label="WebOfTrust Preview" android:icon="#mipmap/ic_launcher"></application>
</manifest>
You need to change android:versionCode="1.0" in Mainfest.xml file to
android:versionCode="1"
It only accepts int and 1.0 would not be an int. and in versionName you can put incremented versions like 1.1 , 1.2, 1.3 and so on as this accepts string
I had the same issue.
In my case it was different, I was designing a RelativeLayout, and mistakenly I assigned the Factor of one of the views as text instead of an integer.
Strangely Xamarin compiler was not able to figure out which line has the issue, it was pointing at the top of the view.
This could happen for any Xaml value which should accept an integer and you are assigning it with different values.

Xamarin: Internal Error in the activation system when "Build All"

I'm getting an Unhandled Exception Error when "Build All" in Xamarin starts as below:
Xamarin.Components.Ide.ApiClients.XamarinStoreException: No user found.
at Xamarin.Components.Ide.ApiClients.XamarinStore.<StartTrial>m__0 (System.Threading.Tasks.Task`1 t) [0x00049] in /Users/builder/data/lanes/2508/0b60eecd/source/md-addins/Xamarin.Ide/Xamarin.Components.Ide/ApiClients/XamarinStore.cs:80
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2[TAntecedentResult,TResult].InnerInvoke () [0x00027] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/mscorlib/system/threading/Tasks/TaskContinuation.cs:207
at System.Threading.Tasks.Task.Execute () [0x00016] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/external/referencesource/mscorlib/system/threading/Tasks/Task.cs:2523

Error on opening MainStoryBoard.storyboard in Xamarin studio 5.7.2 (build 7)

Am getting the below error on opening the empty(default template) single view application with the system configuration Xcode 6.3.2 (7718),Xamarin.iOS Version: 8.6.2.26 (Enterprise Edition),Mac OS X 10.10.3. Is there any solution?
System.AggregateException: One or more errors occurred. ---> System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000f1] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:1251
at Mono.Unix.UnixClient.Connect (Mono.Unix.UnixEndPoint remoteEndPoint) [0x00006] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/Mono.Posix/Mono.Unix/UnixClient.cs:170
at (wrapper remoting-invoke-with-check) Mono.Unix.UnixClient:Connect (Mono.Unix.UnixEndPoint)
at MonoTouch.Design.Client.Mac.MacServerProcessConnection.SendRequestImpl (System.Action1 send) [0x0002b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/dcf3f486/source/md-addins/Xamarin.Designer.iOS/MonoTouch.Design.Client.Mac/MacServerProcessConnection.cs:115
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest (System.Action1 send, System.Action1 recv, Boolean throwIfNotRunning) [0x0001b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/dcf3f486/source/md-addins/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:278
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x000f1] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:1251
at Mono.Unix.UnixClient.Connect (Mono.Unix.UnixEndPoint remoteEndPoint) [0x00006] in /private/tmp/source-mono-mac-4.0.0-branch/bockbuild-mono-4.0.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.0.0/mcs/class/Mono.Posix/Mono.Unix/UnixClient.cs:170
at (wrapper remoting-invoke-with-check) Mono.Unix.UnixClient:Connect (Mono.Unix.UnixEndPoint)
at MonoTouch.Design.Client.Mac.MacServerProcessConnection.SendRequestImpl (System.Action1 send) [0x0002b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/dcf3f486/source/md-addins/Xamarin.Designer.iOS/MonoTouch.Design.Client.Mac/MacServerProcessConnection.cs:115
at MonoTouch.Design.Client.ServerProcessConnection.SendRequest (System.Action1 send, System.Action1 recv, Boolean throwIfNotRunning) [0x0001b] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-5.7-branch/dcf3f486/source/md-addins/Xamarin.Designer.iOS/MonoTouch.Design.Client/Connection/ServerProcessConnection.cs:278 <---
As per the Xamarin support team suggestion I have downloaded the latest Xamarin Studio 5.9.3(build 1) and everything is working fine.

configuring a MVC3 site on mod-mono, now getting exceptions while running code

Let's see if anyone here can help with a problem deploying a MVC3 site on apache using mod_mono.
My mono installation is 3.10.1 (exactly the same thing happens on 3.10.0) and latest mod_mono and xsp. I installed mono from source that I got from a git branch.
Problem is an exception I get when trying to authenticate a user. The exception happens when I call Membership.Validate and is:
System.InvalidOperationException
Failed to map path '/'
at System.Web.HttpRequest.MapPath (System.String virtualPath, System.String baseVirtualDir, Boolean allowCrossAppMapping) [0x001a4] in /usr/local/src/mono/mcs/class/System.Web/System.Web/HttpRequest.cs:1563
at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x0000d] in /usr/local/src/mono/mcs/class/System.Web/System.Web/HttpRequest.cs:1520
at System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00042] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs:156
at System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists (System.String virtualDir) [0x00016] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Hosting/DefaultVirtualPathProvider.cs:59
at System.Web.Configuration.WebConfigurationManager.FindWebConfig (System.String path, System.Boolean& inAnotherApp) [0x0001a] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:592
at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration (System.String path, System.String site, System.String locationSubPath, System.String server, System.String userName, System.String password, Boolean fweb) [0x00026] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:360
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x0000d] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:456
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/WebConfigurationManager.cs:435
at System.Web.Security.SqliteMembershipProvider.Initialize (System.String name, System.Collections.Specialized.NameValueCollection config) [0x0028b] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Security/SqliteMembershipProvider.cs:143
at System.Web.Configuration.ProvidersHelper.InstantiateProvider (System.Configuration.ProviderSettings providerSettings, System.Type providerType) [0x00069] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs:61
at System.Web.Configuration.ProvidersHelper.InstantiateProviders (System.Configuration.ProviderSettingsCollection configProviders, System.Configuration.Provider.ProviderCollection providers, System.Type providerType) [0x0003e] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs:72
at System.Web.Security.Membership..cctor () [0x0001a] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Security/Membership.cs:107
I tried a site that uses a custom membership provider, and another site that uses default one, both display the same issue.
I tried these on 2 different servers, on mono 3.10.1 and 3.10.0.
I configured the site using the automated configuration tool: http://go-mono.com/config-mod-mono/ and using the default configuration it gave as such:
Alias /boacommander "/var/www/html/boacommander"
MonoServerPath boacommander "/usr/bin/mod-mono-server4"
MonoDebug boacommander true
MonoSetEnv boacommander MONO_IOMAP=all
MonoApplications boacommander "/boacommander:/var/www/html/boacommander"
<Location "/boacommander">
Allow from all
Order allow,deny
MonoSetServerAlias boacommander
SetHandler mono
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
</Location>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
</IfModule>
The following dlls are copied along the site:
EntityFramework.dll
Microsoft.Web.Infrastructure.dll
MVC3.dll
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.Services.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
The exception happens in System.Web, so if I copy a System.Web.dll along, I get this exception before even getting onto the logon page:
Could not find method 'Void SetHostingEnvironment()' in type 'System.Web.Hosting.ApplicationHost'
at (wrapper xdomain-invoke) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at (wrapper remoting-invoke-with-check) System.AppDomain:DoCallBack (System.CrossAppDomainDelegate)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x002fb] in /usr/local/src/mono/mcs/class/System.Web/System.Web.Hosting/ApplicationHost.cs:241
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00048] in /usr/local/src/xsp/src/Mono.WebServer/VPathToHost.cs:143
at Mono.WebServer.Apache.Server.RealMain (System.String[] args, Boolean root, IApplicationHost ext_apphost, Boolean v_quiet) [0x00277] in /usr/local/src/xsp/src/Mono.WebServer.Apache/main.cs:161
at (wrapper remoting-invoke-with-check) Mono.WebServer.Apache.Server:RealMain (string[],bool,Mono.WebServer.IApplicationHost,bool)
at Mono.WebServer.Apache.Server.Main (System.String[] args) [0x00034] in /usr/local/src/xsp/src/Mono.WebServer.Apache/main.cs:58
[ERROR] FATAL UNHANDLED EXCEPTION: System.Runtime.Serialization.SerializationException: Could not find method 'Void SetHostingEnvironment()' in type 'System.Web.Hosting.ApplicationHost'
Server stack trace:
at System.Reflection.MemberInfoSerializationHolder.GetRealObject (StreamingContext context) [0x00215] in /usr/local/src/mono/mcs/class/corlib/System.Reflection/MemberInfoSerializationHolder.cs:158
at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager manager, ISurrogateSelector selector, StreamingContext context) [0x00133] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization/ObjectManager.cs:596
at System.Runtime.Serialization.ObjectManager.DoFixups () [0x00074] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization/ObjectManager.cs:85
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader reader) [0x0000f] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:141
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (BinaryElement elem, System.IO.BinaryReader reader, Boolean readHeaders, System.Object& result, System.Runtime.Remoting.Messaging.Header[]& headers) [0x0004d] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs:107
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream serializationStream, System.Runtime.Remoting.Messaging.HeaderHandler handler) [0x0007a] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:177
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream serializationStream) [0x00000] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs:134
at System.Runtime.Remoting.RemotingServices.DeserializeCallData (System.Byte[] array) [0x0000f] in /usr/local/src/mono/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs:794
at (wrapper xdomain-dispatch) System.AppDomain:DoCallBack (object,byte[]&,byte[]&)
Damned if you do, damned if you don't, so what can I do to fix this problem?
EDIT with additional information: The same thing happens while using mono 3.12.0 (git branch)

Mono completely ignores app.config

I've added an app.config file to my project by right-clicking on the solution => Add => New File => Misc => Application Configuration File, and named it "LightmapUpdater.exe.config". "LightmapUpdater.exe" is the name of my executable. Here's what the config file has inside:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<dllmap dll="libIL" target="/opt/local/lib/libil.dylib" />
</configuration>
No matter what mistakes I intentionally make in the file, it keeps ignoring them, not giving me even a single warning. Is it supposed to be that way? Why is it ignoring everything I type in there? How can I make sure that mono looks inside of my config file before compiling? I must be missing some step.
It does work for me. With executable file Test773.exe the file is named Test773.exe.config and the dll mapping specified takes place. Is the file in the same directory as the exe file? Is it marked with a "Copy to output" option in MonoDevelop?
The source code of the application:
using System;
using System.Runtime.InteropServices;
namespace Test773
{
class MainClass
{
public static void Main(string[] args)
{
Funkcja();
}
[DllImport("libIL")]
public static extern void Funkcja();
}
}
The content of the config file is copy pasted from your question. The effect of the execution:
Unhandled Exception:
System.DllNotFoundException: /opt/local/lib/libil.dylib
at (wrapper managed-to-native) Test773.MainClass:Funkcja ()
at Test773.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: /opt/local/lib/libil.dylib
at (wrapper managed-to-native) Test773.MainClass:Funkcja ()
at Test773.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0
EDIT:
To trace/debug this you can use MONO_LOG_LEVEL. For example:
MONO_LOG_LEVEL=debug mono Test773.exe | grep config
results in:
Mono: Config attempting to parse: '/usr/lib/mono/4.5/mscorlib.dll.config'.
Mono: Config attempting to parse: '/usr/etc/mono/assemblies/mscorlib/mscorlib.config'.
Mono: Config attempting to parse: '/usr/etc/mono/config'.
Mono: Config attempting to parse: '/home/konrad/.mono/config'.
Mono: Config attempting to parse: '/home/konrad/eksperymenty/Test773/Test773/bin/Debug/Test773.exe.config'.
Mono: Config attempting to parse: '/usr/etc/mono/assemblies/Test773/Test773.config'.

Resources