This is the error I get when I start my ASP.NET application in Mono:
System.InvalidOperationException: The process must exit before getting the requested information.
at System.Diagnostics.Process.get_ExitCode () [0x00044] in /usr/src/mono-2.6.3/mcs/class/System/System.Diagnostics/Process.cs:149
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:get_ExitCode ()
at Mono.CSharp.CSharpCodeCompiler.CompileFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x001ee] in /usr/src/mono-2.6.3/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:267
at Mono.CSharp.CSharpCodeCompiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00011] in /usr/src/mono-2.6.3/mcs/class/System/Microsoft.CSharp/CSharpCodeCompiler.cs:156
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00014] in /usr/src/mono-2.6.3/mcs/class/System/System.CodeDom.Compiler/CodeDomProvider.cs:119
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x0022f] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:804
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00000] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/AssemblyBuilder.cs:730
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00254] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:624
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x0011c] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:411
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00050] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:356
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x0003a] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:803
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web.VirtualPath virtualPath, System.Type requiredBaseType) [0x0000c] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.Compilation/BuildManager.cs:500
at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x0001c] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.UI/PageParser.cs:161
at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web.UI/PageHandlerFactory.cs:45
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00055] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1643
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1624
at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x0075f] in /usr/src/mono-2.6.3/mcs/class/System.Web/System.Web/HttpApplication.cs:1259
I checked the source code indicated by the stacktrace, namely :CSharpCodeCompiler.cs:267
mcs.WaitForExit();
result.NativeCompilerReturnValue = mcs.ExitCode; //this throws the exception
I have no ideea if this is a bug in Mono, or if my App is doing something it shoudn't.
A simple "Hello World" application indicates that Mono is properly installed and working, It is just my app that is causing this exception to be thrown.
Hoping some enlighted minds have more on the issue
I'm runing Apache + mod_mono 2.6.3 on a CentOS 5.4 server.
What seems to make the difference between a simple "Hello World" and my application, is that there is a TON of stuff going on in Global.asax's Application_Start(). There are TCP sockets opened (and closed), tens of new threads spawned (arround 80) and various services started and closed. In a normal Windows + IIS server, the App would take up to 30 seconds to start. Why would this make a difference in Mono though ?
Edit:
Interestingly enough, one way to circumvent this problem is to move ALL the code from Application_Start into a separate async process:
void Application_Start()
{
var t = new System.Threading.Thread(new ThreadStart(this.Async_Application_Start));
t.Start();
}
void Async_Application_Start()
{
... Lots of stuff going on here..
log('Async Application Start is done!'); // this actually gets logged, so the code DOES execute and end
}
Try to look at this post.
Related
StackTrace:
NavigationRenderer+ParentingViewController.Dispose (System.Boolean disposing)
NSObject.Dispose ()
NavigationRenderer.Dispose (System.Boolean disposing)
NSObject.Dispose ()
DisposeHelpers.DisposeModalAndChildRenderers (Xamarin.Forms.Element view)
IDisposable.Dispose ()
FormsApplicationDelegate.UpdateMainPage ()
FormsApplicationDelegate.ApplicationOnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs args)
BindableObject.OnPropertyChanged (System.String propertyName)
Element.OnPropertyChanged (System.String propertyName)
Application.set_MainPage (Xamarin.Forms.Page value)
PageModelCoreMethods.SwitchOutRootNavigation (System.String navigationServiceName)
BasePageModel.<NavigateToLoginPage>b__74_0 () // I think the problem is in this method
NSAsyncActionDispatcher.Apply ()
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate)
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
Application.Main (System.String[] args)
This is the stack trace for a SIGABRT crash I'm getting in my iOS app using Xamarin.Forms 4.4.
I think the issue is coming from this method:
async protected virtual Task<bool> NavigateToLoginPage()
{
await LoginProvider.Clear();
Platform.BeginInvokeOnMainThread( () =>
{
CoreMethods.SwitchOutRootNavigation(CoreApp.LoginNavigationStack);
});
return true;
}
because it's the last method that was called before the crashing II'm assuming but I'm not sure how to fix it. I've looked at some solutions online like:
MonoTouch SIGSEGV crash using navigationcontroller and searchdisplaycontroller and https://forums.xamarin.com/discussion/6546/finding-the-cause-of-sigsegv which I think are related, but they don't match my case exactly..
Does anybody know what to do about this?
Thanks!
I'm running apache server on Ubuntu, and I'm trying to get a asp site to run. When I go into a page I get a 404 with the following stack trace:
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0021a] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0
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 <dca3b561b8ad4f9fb10141d81b39ff45>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName () [0x00019] in <fa43aae1d96f44db88d3b8a258fd9425>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00168] in <fa43aae1d96f44db88d3b8a258fd9425>:0
at Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00048] in <fa43aae1d96f44db88d3b8a258fd9425>:0
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile (System.CodeDom.Compiler.CompilerParameters options, System.String[] fileNames) [0x00014] in <59be416de143456b88b9988284f43350>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath, System.CodeDom.Compiler.CompilerParameters options) [0x002f5] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath) [0x00008] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, System.Boolean debug) [0x00264] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, System.Boolean debug) [0x0011c] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00063] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00040] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web.VirtualPath virtualPath, System.Type requiredBaseType) [0x00012] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00024] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, System.Boolean ignoreContextHandler) [0x00065] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <d3ba84a338d241e2ab5397407351c9cd>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x0086b] in <d3ba84a338d241e2ab5397407351c9cd>:0
This stack trace doen't really help me - there is no data as to what line, what parameters where send to the function, and in total - I don't know what resource is missing.
How can I get a better stack trace?
Try to look at the Mono Project.
They have a module for the Apache server called «mod_mono».
Hope this helps.
Try the Mod.Mono
This handles ASP.NET 4.0 (with the exception of Entity Framework).
See the compatibility for more information on what Mono is compatible with.
I deployed a Asp.Net Web API project onto my CentOS server running mono 4.3.0 (compiled from mono-4.2.1.36 branch released 2 days ago). I built the project using VS2015 enpty web api template and added owin authentication in an attempt to get a web api working with authentication using bearer tokens.
I'm hosting the project on apache server using mod_mono.
When running the project locally on my windows machine, everything works perfectly. On Linux, when I send a http POST to the /token endpoint, the server returns a 200 OK, but without any response payload (which would include the bearer token the client needs to authenticate subsequent requests). At the same time, the server logs an exception (following).
System.MissingMethodException: Method 'HttpRequestBase.GetBufferlessInputStream' not found.
at Microsoft.Owin.Host.SystemWeb.CallStreams.InputStream.get_Stream () <0xb0e339b8 + 0x00013> in <filename unknown>:0
at Microsoft.Owin.Host.SystemWeb.CallStreams.DelegatingStream.get_CanRead () <0xb0e45eb0 + 0x00013> in <filename unknown>:0
at System.IO.StreamReader..ctor (System.IO.Stream stream, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean leaveOpen) <0xb0e5d790 + 0x0005f> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (System.IO.Stream,System.Text.Encoding,bool,int,bool)
at Microsoft.Owin.OwinRequest+<ReadFormAsync>d__0.MoveNext () <0xb0e33510 + 0x000f3> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb0e34a68 + 0x0002b> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0xb0e346d0 + 0x000bb> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0xb0e34588 + 0x0007f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0xb270df98 + 0x00033> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0xb270e1d0 + 0x00017> in <filename unknown>:0
at Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler+<InvokeTokenEndpointAsync>d__22.MoveNext () <0xb0e2f118 + 0x00463> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb0e34a68 + 0x0002b> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0xb0e346d0 + 0x000bb> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0xb0e34588 + 0x0007f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0xb270df98 + 0x00033> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0xb270df70 + 0x00013> in <filename unknown>:0
at Microsoft.Owin.Security.OAuth.OAuthAuthorizationServerHandler+<InvokeAsync>d__0.MoveNext () <0xb270e790 + 0x007a7> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb0e34a68 + 0x0002b> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0xb0e346d0 + 0x000bb> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0xb0e34588 + 0x0007f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0xb270df98 + 0x00033> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0xb270f5b0 + 0x00013> in <filename unknown>:0
at Microsoft.Owin.Security.Infrastructure.AuthenticationMiddleware`1+<Invoke>d__0[TOptions].MoveNext () <0xb270b2a0 + 0x0030f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0xb0e34a68 + 0x0002b> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0xb0e346d0 + 0x000bb> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0xb0e34588 + 0x0007f> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0xb270df98 + 0x00033> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0xb270df70 + 0x00013> in <filename unknown>:0
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage+<RunApp>d__5.MoveNext () <0xb270aa98 + 0x00173> in <filename unknown>:0
After googling I found that this exception has been fixed in another namespace, but note this originates in Microsoft.Owin.Host.SystemWeb.
Is there a workaround to get rid of the exception, and does anyone have information on if that exception is the reason for the behavior I'm facing or is there something else I can try in order to get bearer token based authentication working?
In my AuthorizationServerProvider I implement the following methods:
(also, when running on Linux the response headers do not include Access-Control-Allow-Origin like they do on Windows)
public override Task ValidateClientAuthentication(OAuthValidateClientAuthenticationContext context)
{
context.OwinContext.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });
context.Validated();
return Task.FromResult<object>(null);
}
public override async Task GrantResourceOwnerCredentials(OAuthGrantResourceOwnerCredentialsContext context)
{
//check credentials
var identity = new ClaimsIdentity(context.Options.AuthenticationType);
identity.AddClaim(new Claim(ClaimTypes.Name, context.UserName)); //etc
var props = new AuthenticationProperties(new Dictionary<string, string>
{
{ "as:client_id", (context.ClientId == null) ? string.Empty : context.ClientId },
{ "userName", context.UserName }
});
var ticket = new AuthenticationTicket(identity, props);
context.Validated(ticket);
}
public override Task TokenEndpoint(OAuthTokenEndpointContext context)
{
foreach (KeyValuePair<string, string> property in context.Properties.Dictionary)
{
context.AdditionalResponseParameters.Add(property.Key, property.Value);
}
return Task.FromResult<object>(null);
}
My Startup.cs looks like this:
public void Configuration(IAppBuilder app)
{
ConfigureOAuth(app);
HttpConfiguration config = new HttpConfiguration();
config.Filters.Add(new AuthorizeAttribute());
WebApiConfig.Register(config);
GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
GlobalConfiguration.Configuration.Filters.Add(new AuthorizeAttribute());
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
app.UseWebApi(config);
}
public void ConfigureOAuth(IAppBuilder app)
{
OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
{
AllowInsecureHttp = true,
TokenEndpointPath = new PathString("/token"),
AccessTokenExpireTimeSpan = TimeSpan.FromMinutes(15),
Provider = new BoaAuthorizationServerProvider(),
RefreshTokenProvider = new BoaRefreshTokenProvider(),
ApplicationCanDisplayErrors = true,
};
// Enable the application to use bearer tokens to authenticate users
app.UseOAuthBearerTokens(OAuthServerOptions);
}
EDIT:
Some more information on this:
I tried the old remove-the-problematic-dll -trick, and I no longer get that exception, but however I do get a 500 Internal Server Error, when sending a http POST to the token endpoint (the same that works on windows).
This is the exception:
System.Web.HttpException
Method 'POST' is not allowed when accessing file '/webapitest/token'
Description: HTTP 500.Error processing request.
Details: Error processing request.
Exception stack trace:
at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) in <filename unknown>:line 0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () in <filename unknown>:line 0
at System.Web.HttpApplication.Tick () in <filename unknown>:line 0
Note the Startup configuration above, is there anything there that mono does not support? If not, this seems like either a configuration problem or a bug in mono as someone previously commented that they get the same MissingMethodException about GetBufferlessInputStream that happens on Ubuntu. That comment has then been removed.
This error is still reproduced on mono builds downloaded from official repos(seems like correct GetBufferlessInputStream & GetBufferedInputStream were implemented in that commit:
303d876370017774445c71736cf34e851e5cb037).
The easiest way for me was to update dependent libraries from nightlybuild repo(not need to compile whole project and to update only required libraries for disk space saving).
Update instructions for Debian:
echo "deb http://download.mono-project.com/repo/debian nightly main" | sudo tee /etc/apt/sources.list.d/mono-nightly.list
sudo apt-get update
sudo apt-get install libmono-system-net-http-webrequest4.0-cil
(any other libmono http library should work too, list of needed packages will be composed automatically)
I just upgraded to the just released Mono version 4.0.1 on my ubuntu machines. The previous installed version of mono was 3.2.7 (if I remember correctly).
Now the issue:
My first issue is regarding SignalR and self-hosting. I have a .NET 4.5.1 console application in which I self host NancyFx, Web Api and SignalR using OWIN. When running on mono 3.2.7 there was no issues to my knowledge but when I try to start the application on mono 4.0.1 I get the following stack trace:
Unhandled Exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidProgramException: Invalid IL code in (wrapper delegate-invoke) <Module>:invoke_callvirt_CancellationTokenRegistration_CancellationToken&_Action`1<object>_object (System.Threading.CancellationToken&,System.Action`1<object>,object): IL_0057: castclass 0x00000007
at Microsoft.AspNet.SignalR.Infrastructure.CancellationTokenExtensions.SafeRegister (CancellationToken cancellationToken, System.Action`1 callback, System.Object state) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeResolverDispose (IDependencyResolver resolver, CancellationToken hostShutdownToken) [0x00000] in <filename unknown>:0
at Microsoft.AspNet.SignalR.Hosting.HostDependencyResolverExtensions.InitializeHost (IDependencyResolver resolver, System.String instanceName, CancellationToken hostShutdownToken) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions.UseSignalRMiddleware[HubDispatcherMiddleware] (IAppBuilder builder, System.Object[] args) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions.RunSignalR (IAppBuilder builder, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions+<>c__DisplayClass1.<MapSignalR>b__0 (IAppBuilder subApp) [0x00000] in <filename unknown>:0
at Owin.MapExtensions.Map (IAppBuilder app, PathString pathMatch, System.Action`1 configuration) [0x00000] in <filename unknown>:0
at Owin.MapExtensions.Map (IAppBuilder app, System.String pathMatch, System.Action`1 configuration) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions.MapSignalR (IAppBuilder builder, System.String path, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions.MapSignalR (IAppBuilder builder, Microsoft.AspNet.SignalR.HubConfiguration configuration) [0x00000] in <filename unknown>:0
at Owin.OwinExtensions.MapSignalR (IAppBuilder builder) [0x00000] in <filename unknown>:0
I have no clue to what this error could mean and I'm greatful for all assistance. I'm using Microsoft ASP.NET SignalR Self Host package version 2.2.0.
And as a side note, I've compiled all my assemblies on the new mono version.
Kind regards,
Simon
This turned out to be a Mono issue which was recently fixed: https://bugzilla.xamarin.com/show_bug.cgi?id=29665
I installed mono from source on a Centos 6.4 to test a msc asp web site.
It seems to work fine all but
some pages return this error
System.InvalidOperationException
Failed to map path '/'
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object):
System.Web.
at System.Web.HttpRequest.MapPath (System.String virtualPath, System.String baseVirtualDir, Boolean allowCrossAppMapping) [0x00000] in <filename unknown>:0
at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists (System.String virtualDir) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.FindWebConfig (System.String path, System.Boolean& inAnotherApp) [0x00000] in <filename unknown>:0
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) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0
at System.Web.Security.SqliteMembershipProvider.Initialize (System.String name, System.Collections.Specialized.NameValueCollection config) [0x00000] in <filename unknown>:0
at System.Web.Configuration.ProvidersHelper.InstantiateProvider (System.Configuration.ProviderSettings providerSettings, System.Type providerType) [0x00000] in <filename unknown>:0
at System.Web.Configuration.ProvidersHelper.InstantiateProviders (System.Configuration.ProviderSettingsCollection configProviders, System.Configuration.Provider.ProviderCollection providers, System.Type providerType) [0x00000] in <filename unknown>:0
at System.Web.Security.Membership..cctor () [0x00000] in <filename unknown>:0
I did the same thing on a debian and It works fine.
Do you have any suggestions?
Find all your Server.MapPaths and change from
Server.MapPaths(#"\")
to
Server.MapPaths(Path.DirectorySeparatorChar)
Have you checked the paths in your view files? Just as a reminder:
'/' like in <script src="/myScript.js"></script> maps to the DocumentRoot folder defined on your /sites-available/.conf, it may be something like /var/www
'~/' like in <script src="#Url.Content("~/scripts/script1.js")"></script> maps to the path where your mvc application is, it may be somethin like /var/www/site1
'../' would try to access one folder above the DocumentRoot folder. This may actually be forbbiden by your apache site configuration (recommended).
Also note that if your run your mvc app from monodevelop/xspServer the document root and the mvc application path are actually the same but if you install your mvc app on apache they may not be the same path.
This error occurs because there is a bug in mono System.Web
It contain this check (https://github.com/mono/mono/blob/mono-3.2.1-branch/mcs/class/System.Web/System.Web/HttpRequest.cs#L1565)
if (!isAppVirtualPath && !virtualPath.StartsWith (appVirtualPath, RuntimeHelpers.StringComparison))
throw new InvalidOperationException (String.Format ("Failed to map path '{0}'", virtualPath));
To fix this, you can comment those lines in Mono surce code and re-compile Mono.
This bug is in latest Mono also.
Links:
https://bugzilla.xamarin.com/show_bug.cgi?id=24457
I had the same error, with exactly the same stacktrace.
It only occured on the first request when apache was just started. The error did not occur after the first request.
I solved this by removing WebMatrix.WebData.dll
This will probably have some consequences when you use SimpleMembershipProvider and it might affect OpenAuth functionality on MVC4.