Unable to start omnisharp-server on osx - macos

Trying to work with the new omnisharp using vim.
My current setup is vim with omnisharp-vim.
The github pages for those direct toward initiating the omnisharp-server client manually in the project directory (so it can index all the .cs files), and then attempting to use vim.
Problem is I can't start the omnisharp-server.
After following the steps on the github page: https://github.com/OmniSharp/omnisharp-server
I get the following error (running from the vim bundle directory or just a newly cloned and xbuilt directory)
HelloMvc>$ mono ~/.vim/bundle/Omnisharp/server/OmniSharp/obj/Debug/OmniSharp.exe -s .
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Nancy.Hosting.Self,
Version=0.22.2.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'Nancy.Hosting.Self, Version=0.22.2.0, Culture=neutral, PublicKeyToken=null'
at OmniSharp.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly
'Nancy.Hosting.Self, Version=0.22.2.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies.
File name: 'Nancy.Hosting.Self, Version=0.22.2.0, Culture=neutral, PublicKeyToken=null'
at OmniSharp.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
So it appears that mono doesn't have the Nancy.Hosting.Self assembly?
So I manually downloaded the Nancy project and attempted to build it and got this error:
/Users/me/seesharp/Nancy/src/Nancy.sln (default targets) ->
(Build target) ->
/Users/me/seesharp/Nancy/src/Nancy.Hosting.Wcf/Nancy.Hosting.Wcf.csproj (default targets) ->
/usr/local/Cellar/mono/3.10.0/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
NancyWcfGenericService.cs(65,31): error CS1061: Type `System.ServiceModel.Web.WebOperationContext'
does not contain a definition for `CreateStreamResponse' and no extension method
`CreateStreamResponse' of type `System.ServiceModel.Web.WebOperationContext' could be found. Are you
missing an assembly reference?
ok that's weird since the github page says it's building, so let's see the code that's failing:
[WebInvoke(UriTemplate = "*", Method = "*")]
public Message HandleRequests(Stream requestBody)
{
var webContext = WebOperationContext.Current;
var nancyRequest =
CreateNancyRequestFromIncomingWebRequest(webContext.IncomingRequest, requestBody, OperationContext.Current);
var nancyContext =
engine.HandleRequest(nancyRequest);
SetNancyResponseToOutgoingWebResponse(webContext.OutgoingResponse, nancyContext.Response);
return webContext.CreateStreamResponse(
stream =>
{
nancyContext.Response.Contents(stream);
nancyContext.Dispose();
},
nancyContext.Response.ContentType ?? string.Empty);
}
and at the top of the file
using System.ServiceModel.Web;
The reference is also present in the projects .csproj file.
So what is going on, and if I've gone too far in the wrong direction, how can I get omnisharp-server to work while I wait for a fix in either the omnisharp-vim or youcompleteme plugins that take care of this?
edit:
Ok so after trying out the mvcmusicstore app and loading that, I see that the way vim says it's running mono is like this:
mono '/Users/me/.vim/bundle/Omnisharp/server/OmniSharp/bin/Debug/OmniSharp.exe' -p 2000 -s .
but this is giving me the following error:
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at OmniSharp.Solution.CSharpProject.AddReference (IAssemblyReference reference) [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpProject.AddMsCorlib () [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpProject..ctor (ISolution solution, OmniSharp.Logger logger, System.String folderPath) [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpFolder.LoadSolution () [0x00000] in <filename unknown>:0
at OmniSharp.Program.StartServer (System.String solutionPath, System.String clientPathMode, Int32 port, Verbosity verbosity, System.String configLocation) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
at OmniSharp.Solution.CSharpProject.AddReference (IAssemblyReference reference) [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpProject.AddMsCorlib () [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpProject..ctor (ISolution solution, OmniSharp.Logger logger, System.String folderPath) [0x00000] in <filename unknown>:0
at OmniSharp.Solution.CSharpFolder.LoadSolution () [0x00000] in <filename unknown>:0
at OmniSharp.Program.StartServer (System.String solutionPath, System.String clientPathMode, Int32 port, Verbosity verbosity, System.String configLocation) [0x00000] in <filename unknown>:0

Turns out that this is an issue with omnisharp-vim.
Downloading, building, and running the omnisharp-server solution fixed this issue for me
Edit: This has been fixed in the omnisharp-vim plugin. Pull latest and rebuild and you should be fine. Thanks to the maintainer.

Related

Updating Xamarin studio to Visual Studio 2017 code giving error in Xamarin form Android

After Updating Xamarin studio to Visual Studio 2017 code giving error in Xamarin form Android (IOS code work fine in VS2017) ?
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2): Error MSB4018: The Resolve Library Project Imports task failed unexpectedly.
This is an unhandled exception from a task -- PLEASE OPEN A BUG AGAINST THE TASK OWNER.
System.IO.FileNotFoundException: Could not load assembly 'Crashlytics.Droid, Version=0.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Crashlytics.Droid.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x000c2] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:225
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName, Mono.Cecil.ReaderParameters parameters) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:170
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (System.String fullName) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:165
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.GetAssembly (System.String fileName) [0x00001] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/external/Java.Interop/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs:160
at Xamarin.Android.Tasks. Resolve Library Project Imports.Extract (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res, System.Collections.Generic.ICollection1[T] jars, System.Collections.Generic.ICollection1[T] resolvedResourceDirectories, System.Collections.Generic.ICollection1[T] resolvedAssetDirectories, System.Collections.Generic.ICollection1[T] resolvedEnvironments) [0x001f2] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/Resolve Library ProjectImports .cs:197
at Xamarin.Android.Tasks. Resolve Library Project Imports.Execute () [0x000e7] in /Users/builder/data/lanes/4695/9dbc4c53/source/xamarin-android/src/Xamarin.Android.Build.Tasks/Tasks/Resolve Library Project Imports.cs:76
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x0002a] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/XMakeBuildEngine/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632
at Microsoft.Build.BackEnd.TaskBuilder+d__26.MoveNext () [0x002bf] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/XMakeBuildEngine/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 (MSB4018) (DMS-Live.Droid)

Service Missing for type 'Microsoft.Framework.Runtime.IApplicationEnvironment

So right now trying to test out the new Visual Studio Code on OS X, but running into a myriad of issues.
Right now been sort out the issue with the dnu command, but now having issues with:
dnx . kestrel
This would be in relation to the Commands with Ease section from the Visual Studio Code and having the following error message shown in my terminal. So far followed everything step by step and still having issues.
System.InvalidOperationException: No service for type 'Microsoft.Framework.Runtime.IApplicationEnvironment' has been registered.
at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService (IServiceProvider provider, System.Type serviceType) [0x00000] in <filename unknown>:0
at Microsoft.Framework.DependencyInjection.ServiceProviderExtensions.GetRequiredService[IApplicationEnvironment] (IServiceProvider provider) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Hosting.HostingEngine..ctor (IServiceProvider fallbackServices) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
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) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args) [0x00000] in <filename unknown>:0
Hope you guys can help.
I had a similar issue when trying to run from the \samples\latest folder instead of \samples\1.0.0-beta4 folder. Simply trying again from where I was supposed to be worked.
If you are using a runtime version which is still using IApplicationEnvironment instead of only IHostingEnvironment, than the problem is DNVM can not find the default runtime.
It can be because the runtime is not installed, or Visual Studio is not configured correctly by global.json file.
Solution:
to make sure the targeted runtime version has been installed, type into terminal:
dnvm list
if the runtime has not been listed (not on the list), install it with
dnvm install <runtime> -a <architecture> -r <runtime>
(for example:
dnvm install 1.0.0-rc1-update2 -a x64 would install an x64 version of the specified runtime
or dnvm install 1.0.0-rc1-update2 -r clr would install the clr version of the runtime)
You can also set the specified runtime as default, active, and make your settings persistent.
in this phase you can probably run your application from cmd
in order to be able to run it from Visual Studio, you have to specify the correct runtime version in the global.json file, which must be located 2 nodes above the project's folder: (../GlobalJsonPlace/src/ProjectFolder/..)
If you do not have the global.json file, create it. It should be something like:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update2"
}
}
Note: src is the name of the folder, which contains the project's folder.
reload your VS instance, and it should be able to run your application.

Xamarin crashing on build with Compiler crashed code 1

I have installed Xamarin and am trying to build my first solution.
So far I have created the new solution, then tried to build and run it. It's blank so I would expect it to at least compile.
Unfortunately I'm getting the error 'Compiler crashed code 1'.
So far I have reinstalled the Mono Framework and changed the MCS file to reference versions/current as found here.
The full error is:
Project "/Users/bwashbourn/Projects/Who'sKeen/Who'sKeen.csproj" (Build target(s)):
Target PrepareForBuild:
Configuration: Debug Platform: AnyCPU
Target GenerateSatelliteAssemblies:
No input files were specified for target GenerateSatelliteAssemblies, skipping.
Target _CoreXamlG:
No input files were specified for target _CoreXamlG, skipping.
Target GenerateTargetFrameworkMonikerAttribute:
Skipping target "GenerateTargetFrameworkMonikerAttribute" because its outputs are up-to-date.
Target CoreCompile:
Tool /Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:"obj/Debug/Who'sKeen.dll" Properties/AssemblyInfo.cs "Who'sKeen.cs" /target:library /define:DEBUG /nostdlib /reference:packages/Xamarin.Forms.1.3.3.6323/lib/portable-win+net45+wp80+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Xamarin.Forms.Core.dll /reference:packages/Xamarin.Forms.1.3.3.6323/lib/portable-win+net45+wp80+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Xamarin.Forms.Xaml.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/Microsoft.CSharp.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Collections.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ComponentModel.EventBasedAsync.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ComponentModel.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Core.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Diagnostics.Contracts.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Diagnostics.Debug.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Diagnostics.Tools.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Dynamic.Runtime.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Globalization.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.IO.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Linq.Expressions.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Linq.Queryable.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Linq.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Net.NetworkInformation.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Net.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Net.Requests.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Net.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ObjectModel.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Reflection.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Reflection.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Reflection.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Resources.ResourceManager.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.InteropServices.WindowsRuntime.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.Serialization.Json.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.Serialization.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.Serialization.Xml.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.Serialization.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Runtime.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Security.Principal.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ServiceModel.Http.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ServiceModel.Primitives.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ServiceModel.Security.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ServiceModel.Web.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.ServiceModel.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Text.Encoding.Extensions.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Text.Encoding.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Text.RegularExpressions.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Threading.Tasks.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Threading.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Windows.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.Linq.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.ReaderWriter.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.Serialization.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.XDocument.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.XmlSerializer.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.Xml.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/System.dll /reference:/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/xbuild-frameworks/.NETPortable/v4.5/Profile/Profile78/mscorlib.dll /warn:4
Unhandled Exception:
System.IO.FileLoadException: I/O Error
at IKVM.Reflection.AssemblyName..ctor (System.String assemblyName) [0x00000] in <filename unknown>:0
at Mono.CSharp.AssemblyDefinition.CreateAssemblyName () [0x00000] in <filename unknown>:0
at Mono.CSharp.AssemblyDefinitionStatic.Create (IKVM.Reflection.Universe domain) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileLoadException: I/O Error
at IKVM.Reflection.AssemblyName..ctor (System.String assemblyName) [0x00000] in <filename unknown>:0
at Mono.CSharp.AssemblyDefinition.CreateAssemblyName () [0x00000] in <filename unknown>:0
at Mono.CSharp.AssemblyDefinitionStatic.Create (IKVM.Reflection.Universe domain) [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0
/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.
Task "Csc" execution -- FAILED
Done building target "CoreCompile" in project "/Users/bwashbourn/Projects/Who'sKeen/Who'sKeen.csproj".-- FAILED
Done building project "/Users/bwashbourn/Projects/Who'sKeen/Who'sKeen.csproj".-- FAILED
Build FAILED.
Errors:
/Users/bwashbourn/Projects/Who'sKeen/Who'sKeen.csproj (Build) ->
/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
/Library/Frameworks/Mono.framework/Versions/4.0.0/lib/mono/4.5/Microsoft.CSharp.targets: error : Compiler crashed with code: 1.
0 Warning(s)
1 Error(s)`
/Users/bwashbourn/Projects/Who'sKeen/Who'sKeen.csproj
Without looking into this too much, the apostrophe in the project name is probably causing an issue, can you try a project and folder without that in the name?

No embedded resource found

I have a xamarin forms application where the very first page has a image control which displays a embedded resource. Often, when i run the application, it fails during start-up with following error:
[libc] WARNING: generic atexit() called from legacy shared library
[monodroid-gc] GREF GC Threshold: 46800
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[MonoDroid] at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0
[MonoDroid] at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0
[MonoDroid] at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0
[MonoDroid] at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0
[MonoDroid] at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0
[MonoDroid] at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0
[mono]
[mono] Unhandled Exception:
[mono] Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[mono] at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0
[mono] at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0
[mono] at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0
[mono] at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0
[mono] at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0
[mono] at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0
[mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: Xamarin.Forms.Xaml.XamlParseException: No embeddedresources found for SeeVee.StartPage
[mono-rt] at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.BindableObject view, System.Type callingType) [0x00000] in <filename unknown>:0
[mono-rt] at Xamarin.Forms.Xaml.Extensions.LoadFromXaml[StartPage] (SeeVee.StartPage view, System.Type callingType) [0x00000] in <filename unknown>:0
[mono-rt] at SeeVee.StartPage.InitializeComponent () [0x00000] in <filename unknown>:0
[mono-rt] at SeeVee.StartPage..ctor () [0x00000] in <filename unknown>:0
[mono-rt] at SeeVee.App.GetMainPage () [0x00000] in <filename unknown>:0
[mono-rt] at SeeVee.Android.MainActivity+<OnCreate>d__0.MoveNext () [0x00000] in <filename unknown>:0
I have to rebuild the app in xamarin studio and re-run and it works. Phew! this gets very tiring sometimes. I hope xamarin is aware of this silly bug and will fix it.
It's a bug. For some reason its status is RESOLVED FIXED, but it doesn't seem fixed at all. On XS on mac anyway.
As a workaround, the file that the exception is thrown in, SomeClass.g.cs, just make an edit to that one generated file, save it, and build again. A bit faster than rebuilding everything.
Of course this means every time you change a .xaml file, you have to build twice.
The fix that worked for me was the following
In the main project .csproj file, I found that all my .xaml files where formatted like this :
<EmbeddedResource Include="Source\Home\HomeContentView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
Except one, the one that was failing had an extra line which looked like this
<LogicalName>MyProject.Home.HomeContentView.xaml</LogicalName>
Removing this line fixed the issue. I also saved my files, cleaned and rebuilt the project.
I had a similar error and fixed it by correcting the class name in my xaml file.
I mean in the x:Class attribute of my page.
I'm using Visual Studio Community 2017 for Mac. I changed my quote char from double quotes (") to single quotes (') and formatted my files. Suddenly I started to get this error whenever the formatted ContentPage was Initialised.
I went back into:
'Visual Studio Community' -> 'Preferences' -> 'Source Code' -> 'Code Formatting' -> 'XML document' -> 'XML Format' -> Quote char
changed it back to double quotes, formatted the documents that I had formatted with the single quotes back to double quotes ('Edit'->'Format'->'Format Document') and now it is working perfectly again.
This fixed my problem with:
'Xamarin.Forms.Xaml.XamlParseException has been thrown'
'No embeddedresource found for YourNamespace.YourContentPageName'
Hope it helps!
After upgrading to visual studio 2017 and latest version of Xamarin this happened to me no matter what I tried. It was the correct class name. Nothing changed in the XAML for this to make sense and to keep getting kicked out of the ios build and android build with the embedded resource not found error. The only solution is to save your xaml and code behind in a notepad then delete that class permanently from your project. Add a new ContentPage to your Xamarin.Forms portable project and name it something different. Paste your code back in and save. Update your project to look for that new ContentPage name. Then it will work for you again.
Another option is to check whether the item is in the Remove list in an ItemGroup which could have been excluded in the past:

Template Error asp

I finally made my monodevelop to create an mvc3 razor project, but not everything works. When I try to create a view, it says it can not find a template. Also, when I try to create the project, it says this:
System.IO.FileNotFoundException: Could not find file "/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml".
File name: '/usr/lib/monodevelop/AddIns/MonoDevelop.AspNet.Mvc/Templates/Common/Index.cshtml'
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x0032f] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:320
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/FileStream.cs:132
at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
at System.IO.File.OpenRead (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:341
at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x00077] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:189
at System.IO.StreamReader..ctor (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/StreamReader.cs:165
at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
at System.IO.File.ReadAllText (System.String path) [0x00000] in /build/mono/src/mono-3.2.3/mcs/class/corlib/System.IO/File.cs:537
at MonoDevelop.Ide.Templates.TextFileDescriptionTemplate.CreateContent (System.String language) [0x00027] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/TextFileDescriptionTemplate.cs:77
at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateContent (MonoDevelop.Projects.Project project, System.Collections.Generic.Dictionary`2 tags, System.String language) [0x00003] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:311
at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.CreateFileContent (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String fileName, System.String identifier) [0x0001a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:264
at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.SaveFile (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String baseDirectory, System.String entryName) [0x0006b] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:204
at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddFileToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x0000a] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:113
at MonoDevelop.Ide.Templates.SingleFileDescriptionTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00009] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs:108
at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102
at MonoDevelop.Ide.Templates.DirectoryTemplate.AddToProject (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.Project project, System.String language, System.String directory, System.String name) [0x00068] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/DirectoryTemplate.cs:102
at MonoDevelop.Ide.Templates.ProjectDescriptor.InitializeItem (MonoDevelop.Projects.SolutionItem policyParent, MonoDevelop.Projects.ProjectCreateInformation projectCreateInformation, System.String defaultLanguage, MonoDevelop.Projects.SolutionEntityItem item) [0x00224] in /build/monodevelop/src/monodevelop-4.0.13/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectDescriptor.cs:162
I have to create the view because it doesnt make one at the start.
I tried to find a template for the razorview engine, but I can't find them.
I just had this problem myself. I'm using arch linux.
After I got the error I uninstalled monodevelop, but not the dependencies. I then went to:
https://github.com/mono/monodevelop
and followed the instructions there. I used
git clone https://github.com/mono/monodevelop.git
cd monodevelop
git submodule update --init --recursive
./configure --profile=stable ; make ; sudo make install
I then went into monodevelop and created a MVC 3 project with razor and it snapped right open. No issues at all.

Resources