OmniSharp.MSBuild.ProjectManager Failed to load project on Linux - linux

I am learning C# on my Manjaro Linux Notebook. I tried to install the ms-vscode.csharp extension, but when opening any .NET Core project I get the following Error Message:
Some Projects have trouble loading. Please review the output for more
information.
I tried to set the "omnisharp.path" option in the VS Code settings to "latest" but it did not change anything.
I am using version 1.21.8 of the extension and version 1.40.2 of VS Code.
Any ideas how to solve the issue?
VS Code Error Log:
Starting OmniSharp server at 12/3/2019, 1:16:18 PM
Target: /home/marco/dev/big-number
OmniSharp server started.
Path: /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/run
PID: 9119
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on manjaro 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/marco/.vscode/extensions/ms-vscode.csharp-1.21.8/.omnisharp/1.34.8/omnisharp/.msbuild
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/marco/dev/big-number'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/marco/dev/big-number/big-number.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/marco/dev/big-number'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/marco/dev/big-number/big-number.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/marco/dev/big-number' on host 9016.
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/marco/dev/big-number/big-number.csproj'.
/home/marco/dev/big-number/big-number.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /home/marco/dev/big-number/big-number.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <b695b16788dd418cbe8b4d98f7a92ff3>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <d71b11425cc74bd5a2cb9780240c3208>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.<LoadProject>b__0 () [0x00000] in <d71b11425cc74bd5a2cb9780240c3208>:0
at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult()
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loader) [0x0001b] in <d71b11425cc74bd5a2cb9780240c3208>:0
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/marco/dev/big-number/big-number.csproj

I solved this by adding a omnisharp.json file with following content:
{
"MSBuild": {
"UseLegacySdkResolver": true
}
}
Source

This seem to have done it for me
code -> preferences -> settings -> click this
;/ wish i had at least 10 reputation to post a picture here but it's the first icon in the top right looks like a lil piece of paper.
Then..
copy pasta this into settings.json
{
"explorer.compactFolders": false,
"update.mode": "none",
"workbench.iconTheme": "vscode-icons",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"omnisharp.path": "latest",
"omnisharp.monoPath": "auto",
"csharp.semanticHighlighting.enabled": true,
"editor.formatOnType": true,
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
"settingsSync.ignoredExtensions": [],
"window.zoomLevel": 0
}
that ^
"[csharp]": {
"editor.defaultFormatter": "ms-dotnettools.csharp"
},
"[xml]": {
"editor.defaultFormatter": "DotJoshJohnson.xml"
},
but i think this is what did the trick for me ^ specifically the [csharp]

Part of the reasons why you get this error is, .vscode is missing in your project. The path where Omnisharp is looking for the .Net SDK version is wrong, this is because Omnisharp looks for the required SDK in the path where Visual Studio saves its resources. to resolve this, update your visual studio so that it has the latest SDK version you are working with. and this should resolve the error and the project you're running on Visual Studio code will have the.VSCode folder.
To update Visual Studio, Open Visual Studio and select help on the top menu, look for "check for update" and then update.
IF you already did all this then, a simple Vs Code restart MAY be the answer.

From reviewing the startup log, I saw a message that says I need .NET Developer Pack 4.7.1.
Downloading and Installing the .NET Framework 4.7.1 (Developer Pack) from https://learn.microsoft.com/de-de/dotnet/framework/install/guide-for-developers solved the problem for me.

Related

AutoMapper Mapper.Initialize causing ArgumentNullException in System.Linq.Expressions (Xamarin.iOS)

I am trying to integrate AutoMapper into my Xamarin Forms application. It successfully works in Android both device and simulator but in iOS I can only get it to work in the simulator. Running it on a real device cause System.ArgumentNullException.
Here is my Mapper.Initialize code that is in my App.xaml.cs OnStart method:
// AutoMapper config
Mapper.Initialize(cfg =>
{
cfg.AddProfile<MappingProfile>();
});
Here is the stack trace:
System.ArgumentNullException: Value cannot be null.
Parameter name: method
at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0) [0x0003e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.0.0.0/src/mono/external/corefx/src/System.Linq.Expressions/src/System/Linq/Expressions/MethodCallExpression.cs:879
at AutoMapper.Mappers.ConvertMapper.ConvertExpression (System.Type sourceType, System.Type destinationType) [0x00040] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Mappers.ConvertMapper+<>c__DisplayClass1_1.<GetConverters>b__4 () [0x00000] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at System.Lazy`1[T].CreateValue () [0x00081] in <6314851f133e4e74a2e96356deaa0c6c>:0
at System.Lazy`1[T].LazyInitValue () [0x0000c] in <6314851f133e4e74a2e96356deaa0c6c>:0
at System.Lazy`1[T].get_Value () [0x0003a] in <6314851f133e4e74a2e96356deaa0c6c>:0
at AutoMapper.Mappers.ConvertMapper.MapExpression (AutoMapper.IConfigurationProvider configurationProvider, AutoMapper.ProfileMap profileMap, AutoMapper.PropertyMap propertyMap, System.Linq.Expressions.Expression sourceExpression, System.Linq.Expressions.Expression destExpression, System.Linq.Expressions.Expression contextExpression) [0x00021] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.ObjectMapperExpression (AutoMapper.IConfigurationProvider configurationProvider, AutoMapper.ProfileMap profileMap, AutoMapper.TypePair typePair, System.Linq.Expressions.Expression sourceParameter, System.Linq.Expressions.Expression contextParameter, AutoMapper.PropertyMap propertyMap, System.Linq.Expressions.Expression destinationParameter) [0x0000b] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.MapExpression (AutoMapper.IConfigurationProvider configurationProvider, AutoMapper.ProfileMap profileMap, AutoMapper.TypePair typePair, System.Linq.Expressions.Expression sourceParameter, System.Linq.Expressions.Expression contextParameter, AutoMapper.PropertyMap propertyMap, System.Linq.Expressions.Expression destinationParameter) [0x0006d] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.MapExpression (AutoMapper.TypePair typePair, System.Linq.Expressions.Expression sourceParameter, AutoMapper.PropertyMap propertyMap, System.Linq.Expressions.Expression destinationParameter) [0x00011] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc (AutoMapper.PropertyMap propertyMap, System.Linq.Expressions.Expression destination) [0x000de] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.CreatePropertyMapFunc (AutoMapper.PropertyMap propertyMap) [0x00000] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.TryPropertyMap (AutoMapper.PropertyMap propertyMap) [0x00000] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.CreateAssignmentFunc (System.Linq.Expressions.Expression destinationFunc, System.Boolean constructorMapping) [0x00044] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Execution.TypeMapPlanBuilder.CreateMapperLambda (System.Collections.Generic.HashSet`1[T] visitedTypeMaps) [0x000bb] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.TypeMap.Seal (AutoMapper.IConfigurationProvider configurationProvider, System.Collections.Generic.HashSet`1[T] visitedTypeMaps) [0x00088] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.MapperConfiguration.Seal () [0x001f8] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.MapperConfiguration..ctor (AutoMapper.Configuration.MapperConfigurationExpression configurationExpression) [0x00177] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.MapperConfiguration..ctor (System.Action`1[T] configure) [0x00007] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at AutoMapper.Mapper.Initialize (System.Action`1[T] config) [0x00000] in <0cc4ddabcc77416ea712cf2d35abef51>:0
at Mobile.App.OnStart () [0x0002c]
I have ensured that Xcode, NuGet packages and Visual Studio are all up to date.
Any help appreciated!
The answer is that you need to include a LinkDescription.xml in the root inside your project with build settings set to LinkDescription and the following content:
<linker>
<assembly fullname="mscorlib">
<type fullname="System.Convert" preserve="All" />
</assembly>
</linker>
Side note:
I've tried to add this line to the Additional mtouch arguments --linkskip System.Convert as described on https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/linker but it did not work.
Only the LinkDescription.xml worked. A reference on how the LinkDescription.xml works can be found here: https://learn.microsoft.com/en-us/learn/modules/prepare-to-publish-your-xamarin-application/5-preserve-critical-code
There is also a closed issue on GitHub for this problem which suggests the same solution: https://github.com/AutoMapper/AutoMapper/issues/2272
Right click on iOS project > property > set Linker Behavior to Don't Link

Can't run fsharpi in Arch Linux

I have installed the fsharp package and mono using sudo pacman -S fsharp mono but when running fsharpi in terminal i get the following error message.
Exception by fsi.exe:
System.TypeInitializationException: The type initializer for 'Microsoft.FSharp.Compiler.AbstractIL.IL' threw an exception. ---> System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-Compiler>.$Microsoft.FSharp.Compiler.AbstractIL.IL' threw an exception. ---> System.InvalidTimeZoneException: TZ file too big for the buffer
at System.TimeZoneInfo.BuildFromStream (System.String id, System.IO.Stream stream) [0x00022] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) [0x00015] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.TimeZoneInfo.CreateLocal () [0x000cc] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.TimeZoneInfo.get_Local () [0x00009] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.TimeZoneInfo.GetDateTimeNowUtcOffsetFromUtc (System.DateTime time, System.Boolean& isAmbiguousLocalDst) [0x00000] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at System.DateTime.get_Now () [0x00008] in <73ee1b14c2fa4d61b481096ff3d8d6d7>:0
at <StartupCode$FSharp-Compiler>.$Microsoft.FSharp.Compiler.AbstractIL.IL..cctor () [0x0028c] in <5920c30f7f81fe20a74503830fc32059>:0
--- End of inner exception stack trace ---
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_generic_class_init (intptr)
at Microsoft.FSharp.Compiler.AbstractIL.IL..cctor () [0x00000] in <5920c30f7f81fe20a74503830fc32059>:0
--- End of inner exception stack trace ---
at Microsoft.FSharp.Compiler.Interactive.Shell+FsiEvaluationSession..ctor (Microsoft.FSharp.Compiler.Interactive.Shell+FsiEvaluationSessionHostConfig fsi, System.String[] argv, System.IO.TextReader inReader, System.IO.TextWriter outWriter, System.IO.TextWriter errorWriter) [0x00010] in <5920c329046a099ca745038329c32059>:0
at Microsoft.FSharp.Compiler.Interactive.Shell.evaluateSession#2897 (System.String[] argv, Microsoft.FSharp.Core.Unit unitVar0) [0x0010d] in <5920c329046a099ca745038329c32059>:0
Please, take a look at https://bbs.archlinux.org/viewtopic.php?id=210401.
You may need to recreate proper link for configured timezone.
# rm /etc/localtime
# ln -s /usr/share/zoneinfo/America/Sao_Paulo //change the zone for your region

Intu Avatar won't connect: No connection could be made because the target machine actively refused it

I am trying to setup a INTU connections using the avatar.
I have the avatar running:
I have copied the credential information in the m_variables section in the config.json
The Intu Manager keeps trying to connect to parent
Below is the log from the avatar:
<RI> Initialized touch support.
UnloadTime: 2.382588 ms
[STATUS][Widget]: Auto-Connecting SelfDisplayGesture(Clone) (DocumentModel) -> DocumentManager.Document Input (DocumentModel)
Platform assembly: D:\Software\IoT\GoPiGo\Self-Avatar-Win64\intu_avatar_Data\Managed\Mono.Security.dll (this message is harmless)
[STATUS][Widget]: Auto-Connecting TextToSpeechWidget(Clone) (DisableMicData) -> MicWidget(Clone).Disable (DisableMicData)
[STATUS][Widget]: Auto-Connecting AvatarWidget (DisableMicData) -> MicWidget(Clone).Disable (DisableMicData)
[WARNING][AvatarWidget]: Mood not defined for NONE.
[WARNING][AvatarWidget]: Mood not defined for NONE.
[STATUS][Widget]: Auto-Connecting MicWidget(Clone) (AudioData) -> SelfMicrophoneSensor(Clone).Audio (AudioData)
[STATUS][Widget]: Auto-Connecting SelfSpeechGesture(Clone) (TextToSpeechData) -> TextToSpeechWidget(Clone).Text (TextToSpeechData)
[STATUS][GestureManager]: Gesture update_status/e83cb44b-644d-4b82-a5f7-86b6886bc3c6 added.
[STATUS][Widget]: Auto-Connecting TextToSpeechWidget(Clone) (SpeakingStateData) -> SelfSpeechGesture(Clone).Speaking Input (SpeakingStateData)
[STATUS][GestureManager]: Gesture tts/dee17c80-8474-4343-b961-602c0f169459 added.
[STATUS][GestureManager]: Gesture display/9c3e0b2c-48c3-45d9-a546-3794b9632d45 added.
[STATUS][Widget]: Auto-Connecting SelfStatusGesture(Clone) (StatusData) -> AvatarWidget.Status (StatusData)
[STATUS][Widget]: Auto-Connecting TextToSpeechWidget(Clone) (LevelData) -> AvatarWidget.Level (LevelData)
[STATUS][Widget]: Auto-Connecting MicWidget(Clone) (LevelData) -> AvatarWidget.Level (LevelData)
[STATUS][AvatarWidget]: Starting avatar.
[WARNING][AvatarWidget]: Mood not defined for NONE.
Setting up 2 worker threads for Enlighten.
Thread -> id: 2660 -> priority: 1
Thread -> id: 256c -> priority: 1
12/16/2016 2:07:03 PM|Fatal|WebSocket.connect|System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it.
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
[STATUS][TopicClient]: OnSocketClosed: An exception has occurred while connecting.No connection could be made because the target machine actively refused it.
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPAddress[] ipAddresses, Int32 port) [0x00000] in <filename unknown>:0
[STATUS][TopicClient]: Reconnecting in 5 seconds.
[STATUS][SensorManager]: Sensor aae9e913-13b6-4cb0-aad7-a57d594224ff added.
[STATUS][TopicClient]: Reconnecting in 5 seconds.
Does your computer sit behind a proxy?
Have you also tried updating your m_variables in the config file recently, in my investigations it seems this is a token which will expire.

Error: This module requires Ninject.Web.WebAPI extension

I'm using Ninject.Web.WebApi.OwinHost v3.2.4 and I get this error the first time you hit a page. Then it works from then on:
This module requires Ninject.Web.WebAPI extension
The stacktrace is:
[InvalidOperationException: This module requires Ninject.Web.WebAPI extension]
Ninject.Web.WebApi.OwinHost.OwinWebApiModule.VerifyRequiredModulesAreLoaded() +202
Ninject.Modules.NinjectModule.OnVerifyRequiredModules() +10
Ninject.KernelBase.Load(IEnumerable``1 m) +419
Ninject.Web.Common.OwinHost.OwinBootstrapper.CreateKernel() +30
Ninject.Web.Common.Bootstrapper.Initialize(Func`1 createKernelCallback) +16
Ninject.Web.Common.OwinHost.d__1.MoveNext() +189
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__5.MoveNext() +187
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.d__2.MoveNext() +185
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +69
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar) +64
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +380
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
How do I fix this?
This occurs when you create your kernel without scanning the DLLs for Ninject modules, for example:
var kernel = new StandardKernel(new NinjectSettings
{
LoadExtensions = false
});
The way to fix this is to manually load the modules that Ninject.Web.WebApi.OwinHost needs
kernel.Load(typeof(Ninject.Web.WebApi.WebApiModule).Assembly);

MonoTouch 'could not AOT the assembly'

I'm using MonoTouch 6.2 and I have an app that builds and runs fine on the simulator, but gets a "Could not AOT the assembly" error when I build for the actual device.
Has anyone seen this before?
Here's the compiler output:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -miphoneos-version-min=4.3 -arch armv7 -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -x assembler-with-cpp -c /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/GoogleAnalytics.dll.armv7.s -o /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/GoogleAnalytics.dll.armv7.o
AOT Compilation exited with code 134, command:
MONO_PATH=/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app /Developer/MonoTouch/usr/bin/arm-darwin-mono --debug --aot=mtriple=armv7-darwin,full,static,asmonly,direct-icalls,soft-debug,no-direct-calls,iphone-abi,outfile=/var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/MyApp.exe.armv7.s "/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe"
Mono Ahead of Time compiler - compiling assembly /Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe
* Assertion at ../../../../../mono/mono/metadata/marshal.c:8613, condition `sig->param_count == invoke_sig->param_count + 1' not met
Mono Ahead of Time compiler - compiling assembly /Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/mscorlib.dll
Code: 1337720 Info: 35037 Ex Info: 487954 Unwind Info: 8707 Class Info: 22674 PLT: 3057 GOT Info: 65112 GOT: 22092 Offsets: 31427
Output file: '/var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.s'.
Linking symbol: '_mono_aot_module_mscorlib_info'.
Compiled 6288 out of 6288 methods (100%)
Methods without GOT slots: 4052 (64%)
Direct calls: 246 (2%)
JIT time: 1134 ms, Generation time: 1793 ms, Assembly+Link time: 203 ms.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++ -miphoneos-version-min=4.3 -arch armv7 -std=c99 -I/Developer/MonoTouch/SDKs/MonoTouch.iphoneos.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -x assembler-with-cpp -c /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.s -o /var/folders/rw/m66cxvf16kq37jjxdt0d99580000gn/T/tmpc3662b4.tmp/mscorlib.dll.armv7.o
error MT3001: Could not AOT the assembly '/Users/me/dev/MyApp/Src/Plat/iOS/bin/iPhone/Debug/MyApp.app/MyApp.exe'
at MTouch.GetObjectFileForAssembly (System.String assemblyName, Abi abi) [0x00000] in <filename unknown>:0
at MTouch+<CompileAssemblies>c__AnonStorey10.<>m__1A (System.String s) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey36`1[System.String].<>m__34 (System.String e, System.Threading.Tasks.ParallelLoopState s, System.Object l) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Parallel+<ForEach>c__AnonStorey35`2[System.String,System.Object].<>m__32 () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.TaskActionInvoker+ActionInvoke.Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0
at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0
Fixed.. the problem was I had a MonoPInvokeCallbackAttribute with a delegate type that didn't match the signature of the function. For example:
delegate int SomeDelegate();
[ MonoPInvokeCallbackAttribute ( typeof( SomeDelegate ) ) ]
static void MyCallback( int x )
{
}
So the signature of SomeDelegate doesn't match the signature of MyCallback.

Resources