How to get usefull stack trace from apache mod_mono? - asp.net

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.

Related

Problem while enabling Migration ASP.NET MVC5 on MAC

I'm trying to enable migration on my ASP.net project on Rider.
when I click on Enable Migration the Migration folder is created the configuration.cs file is also created but i get this message:
11:42:16.760 |I| EntityFrameworkRunnerProgram | :1 | Using EntityFramework 6.3.0
11:42:17.674 |E| ScaffoldInitialMigrationRunner| :1 | Inner exception stack trace: System.ArgumentException: Invalid value for key 'attachdbfilename'. at System.Data.SqlClient.SqlConnectionString..ctor (System.String connectionString) [0x00408] in <151ba4fcafea4819819d3594ece183c3>:0 at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions (System.String connectionString, System.Data.Common.DbConnectionOptions previous) [0x00000] in <151ba4fcafea4819819d3594ece183c3>:0 at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup (System.Data.Common.DbConnectionPoolKey key, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolOptions, System.Data.Common.DbConnectionOptions& userConnectionOptions) [0x0003e] in <151ba4fcafea4819819d3594ece183c3>:0 at System.Data.SqlClient.SqlConnection.ConnectionString_Set (System.Data.Common.DbConnectionPoolKey key) [0x00008] in <151ba4fcafea4819819d3594ece183c3>:0 at System.Data.SqlClient.SqlConnection.set_ConnectionString (System.String value) [0x00042] in <151ba4fcafea4819819d3594ece183c3>:0 at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher+<>c.<SetConnectionString>b__8_0 (System.Data.Common.DbConnection t, System.Data.Entity.Infrastructure.Interception.DbConnectionPropertyInterceptionContext`1[TValue] c) [0x00007] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1[TInterceptor].Dispatch[TTarget,TInterceptionContext] (TTarget target, System.Action`2[T1,T2] operation, TInterceptionContext interceptionContext, System.Action`3[T1,T2,T3] executing, System.Action`3[T1,T2,T3] executed) [0x0000f] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString (System.Data.Common.DbConnection connection, System.Data.Entity.Infrastructure.Interception.DbConnectionPropertyInterceptionContext`1[TValue] interceptionContext) [0x00044] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.SqlConnectionFactory.CreateConnection (System.String nameOrConnectionString) [0x00096] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.LocalDbConnectionFactory.CreateConnection (System.String nameOrConnectionString) [0x00077] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Internal.LazyInternalConnection.Initialize () [0x000bd] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Internal.LazyInternalConnection.get_Connection () [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Internal.LazyInternalContext.get_Connection () [0x00024] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType, System.Data.Entity.Infrastructure.DbProviderInfo modelProviderInfo, System.Data.Entity.Internal.AppConfig config, System.Data.Entity.Infrastructure.DbConnectionInfo connectionInfo, System.Func`1[TResult] resolver) [0x000c8] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType, System.Func`1[TResult] resolver) [0x00012] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType) [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Migrations.DbMigrator..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration configuration, System.Data.Entity.DbContext usersContext, System.Data.Entity.Internal.DatabaseExistenceState existenceState, System.Boolean calledByCreateDatabase) [0x0006e] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Migrations.DbMigrator..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration configuration) [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration migrationsConfiguration) [0x00012] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Migrations.Design.ToolingFacade+ScaffoldRunner.RunCore () [0x00006] in <222b71ed74914d6ebbdbc2b580446023>:0 at System.Data.Entity.Migrations.Design.ToolingFacade+BaseRunner.Run () [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0
--- EXCEPTION #1/1 [LoggerException]
Message = “
Inner exception stack trace: System.ArgumentException: Invalid value for key 'attachdbfilename'.
at System.Data.SqlClient.SqlConnectionString..ctor (System.String connectionString) [0x00408] in <151ba4fcafea4819819d3594ece183c3>:0
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions (System.String connectionString, System.Data.Common.DbConnectionOptions previous) [0x00000] in <151ba4fcafea4819819d3594ece183c3>:0
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup (System.Data.Common.DbConnectionPoolKey key, System.Data.ProviderBase.DbConnectionPoolGroupOptions poolOptions, System.Data.Common.DbConnectionOptions& userConnectionOptions) [0x0003e] in <151ba4fcafea4819819d3594ece183c3>:0
at System.Data.SqlClient.SqlConnection.ConnectionString_Set (System.Data.Common.DbConnectionPoolKey key) [0x00008] in <151ba4fcafea4819819d3594ece183c3>:0
at System.Data.SqlClient.SqlConnection.set_ConnectionString (System.String value) [0x00042] in <151ba4fcafea4819819d3594ece183c3>:0
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher+<>c.<SetConnectionString>b__8_0 (System.Data.Common.DbConnection t, System.Data.Entity.Infrastructure.Interception.DbConnectionPropertyInterceptionContext`1[TValue] c) [0x00007] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1[TInterceptor].Dispatch[TTarget,TInterceptionContext] (TTarget target, System.Action`2[T1,T2] operation, TInterceptionContext interceptionContext, System.Action`3[T1,T2,T3] executing, System.Action`3[T1,T2,T3] executed) [0x0000f] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString (System.Data.Common.DbConnection connection, System.Data.Entity.Infrastructure.Interception.DbConnectionPropertyInterceptionContext`1[TValue] interceptionContext) [0x00044] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.SqlConnectionFactory.CreateConnection (System.String nameOrConnectionString) [0x00096] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.LocalDbConnectionFactory.CreateConnection (System.String nameOrConnectionString) [0x00077] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Internal.LazyInternalConnection.Initialize () [0x000bd] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Internal.LazyInternalConnection.get_Connection () [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Internal.LazyInternalContext.get_Connection () [0x00024] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType, System.Data.Entity.Infrastructure.DbProviderInfo modelProviderInfo, System.Data.Entity.Internal.AppConfig config, System.Data.Entity.Infrastructure.DbConnectionInfo connectionInfo, System.Func`1[TResult] resolver) [0x000c8] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType, System.Func`1[TResult] resolver) [0x00012] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Infrastructure.DbContextInfo..ctor (System.Type contextType) [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.DbMigrator..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration configuration, System.Data.Entity.DbContext usersContext, System.Data.Entity.Internal.DatabaseExistenceState existenceState, System.Boolean calledByCreateDatabase) [0x0006e] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.DbMigrator..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration configuration) [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor (System.Data.Entity.Migrations.DbMigrationsConfiguration migrationsConfiguration) [0x00012] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.Design.ToolingFacade+ScaffoldRunner.RunCore () [0x00006] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.Design.ToolingFacade+BaseRunner.Run () [0x00000] in <222b71ed74914d6ebbdbc2b580446023>:0
”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.Util.ILoggerEx.LogMessage (JetBrains.Util.ILogger this, JetBrains.Diagnostics.LoggingLevel level, System.String message) [0x00000] in <37ed49b15eea41448b14c541f9d5975f>:0
at JetBrains.Util.ILoggerEx.Error (JetBrains.Util.ILogger this, System.String message) [0x00000] in <37ed49b15eea41448b14c541f9d5975f>:0
at JetBrains.EntityFramework.Runner620.CommandRunnerBase`2[TIn,TOut].JetBrains.EntityFramework.Runner620.ICommandRunner<TIn>.Run (TIn command) [0x00000] in <f05235a6a61b4a789b03405b09b6d17a>:0
at System.Reflection.RuntimeMethodInfo.InternalInvoke (System.Reflection.RuntimeMethodInfo , System.Object , System.Object[] , System.Exception& ) [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <b814b509d4ad406fb40c6c93e38929e7>:0
at JetBrains.EntityFramework.Runner620.EntityFrameworkRunnerProgram.Main (System.String[] args) [0x00000] in <f05235a6a61b4a789b03405b09b6d17a>:0
”
11:42:17.753 |E| EntityFrameworkRunnerProgram | :1 | Exception has been thrown by the target of an invocation. Invalid value for key 'attachdbfilename'.
--- EXCEPTION #1/3 [ToolingException]
Message = “Invalid value for key 'attachdbfilename'.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.Data.Entity.Migrations.Design.ToolingException
HResult = COR_E_EXCEPTION=80131500
Source = EntityFramework
SafeSerializationManager.m_serializedStates.#0 = System.Data.Entity.Migrations.Design.ToolingException+ToolingExceptionState
CLR_SafeSerializationManager_RealType.Data = System.Data.Entity.Migrations.Design.ToolingException
CLR_SafeSerializationManager_RealType.UnityType = 4
CLR_SafeSerializationManager_RealType.AssemblyName = “EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”
StackTraceString = “
at System.Data.Entity.Migrations.Design.ToolingFacade.Run (System.Data.Entity.Migrations.Design.ToolingFacade+BaseRunner runner) [0x00097] in <222b71ed74914d6ebbdbc2b580446023>:0
at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldInitialCreate (System.String language, System.String rootNamespace) [0x0001b] in <222b71ed74914d6ebbdbc2b580446023>:0
at JetBrains.EntityFramework.Runner620.ScaffoldInitialMigrationRunner.DoRun (JetBrains.EntityFramework.Features.Commands.EnableMigrationsCommand command) [0x00011] in <f05235a6a61b4a789b03405b09b6d17a>:0
at JetBrains.EntityFramework.Runner620.CommandRunnerBase`2[TIn,TOut].JetBrains.EntityFramework.Runner620.ICommandRunner<TIn>.Run (TIn command) [0x001af] in <f05235a6a61b4a789b03405b09b6d17a>:0
at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <b814b509d4ad406fb40c6c93e38929e7>:0
”
I didn't find any solution to get over with this error
if details are needed i'll try to get them for you

System.Web.HttpException with "Type Service not found." in Mono ASP.NET Web Service

I am using mono v4.2.1 and apache2 in ubuntu 14.04
I managed to install my ASP.NET web service in the url: http://myurl/WebService/Service.asmx
But when I open it, I receive this error:
System.Web.HttpException
Type Service not found.
Description: HTTP 500.Error processing request.
Details: Error processing request.
Exception stack trace:
at System.Web.UI.SimpleWebHandlerParser.GetTypeFromBin (System.String tname) <0x40f053e0 + 0x00894> in <filename unknown>:0
at System.Web.Compilation.SimpleBuildProvider.LoadTypeFromBin (System.Web.Compilation.BaseCompiler compiler, System.Web.UI.SimpleWebHandlerParser parser) <0x40f053a0 + 0x00026> in <filename unknown>:0
at System.Web.Compilation.GenericBuildProvider`1[TParser].GetGeneratedType (System.CodeDom.Compiler.CompilerResults results) <0x40f05150 + 0x00085> in <filename unknown>:0
at System.Web.Compilation.BuildManagerCacheItem..ctor (System.Reflection.Assembly assembly, System.Web.Compilation.BuildProvider bp, System.CodeDom.Compiler.CompilerResults results) <0x40f04fc0 + 0x00101> in <filename unknown>:0
at System.Web.Compilation.BuildManager.StoreInCache (System.Web.Compilation.BuildProvider bp, System.Reflection.Assembly compiledAssembly, System.CodeDom.Compiler.CompilerResults results) <0x40f04a60 + 0x0009f> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) <0x40f00ff0 + 0x00b94> in <filename unknown>:0
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) <0x40ee7490 + 0x00579> in <filename unknown>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) <0x40ee6df0 + 0x00149> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) <0x40ee6a30 + 0x000b7> in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) <0x40ee65c0 + 0x00024> in <filename unknown>:0
at System.Web.UI.WebServiceParser.GetCompiledType (System.String inputFile, System.Web.HttpContext context) <0x40ee65a0 + 0x00014> in <filename unknown>:0
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType (System.String url, System.Web.HttpContext context) <0x40ee6570 + 0x00022> in <filename unknown>:0
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler (System.Web.HttpContext context, System.String verb, System.String url, System.String filePath) <0x40edf510 + 0x0014a> in <filename unknown>:0
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String pathTranslated) <0x40edf050 + 0x00241> in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) <0x40ed71f0 + 0x002f3> in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) <0x40ed71b0 + 0x00020> in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () <0x40ebcf60 + 0x02b62> in <filename unknown>:0
This is my Service.asmx:
<%# WebService Language="C#" Class="Service" %>
And the Service class is in a library which is added by reference:
using System.Web.Services;
[WebService(Namespace = "http://myurl/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : WebService
{
public Service()
{
}
}
The point is it works completely OK in Microsoft Visual Studio but mono has a problem and I don't know where to look or what to do.
I figured out that it was because the root directory was not correctly set.
I used xsp4 instead of apache2 and it fixed.

How to serve favicon.ico and robots.txt files from ASP.NET MVC3 application

ASP.NET MVC3 application is hosted in Apache in Mono as virtual host with address http://www.mysite.com
Requests for files robots.txt , favicon.ico and apple-touch-icon.png cause 404 error below since
there are no MVC3 controllers for those names.
How to server those files ? It it possible to force Apache to serve them as regular files or can we force MVC3 application to return those files ?
Which is proper way to implement this ?
System.Web.HttpException: The controller for path '/robots.txt' was not found or does not implement IController.
at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance (System.Web.Routing.RequestContext requestContext, System.Type controllerType) [0x00000] in <filename unknown>:0
at System.Web.Mvc.DefaultControllerFactory.CreateController (System.Web.Routing.RequestContext requestContext, System.String controllerName) [0x00000] in <filename unknown>:0
at System.Web.Mvc.MvcHandler.ProcessRequestInit (System.Web.HttpContextBase httpContext, IController& controller, IControllerFactory& factory) [0x00000] in <filename unknown>:0
at System.Web.Mvc.MvcHandler+<>c__DisplayClass6.<BeginProcessRequest>b__2 () [0x00000] in <filename unknown>:0
at System.Web.Mvc.SecurityUtil+<>c__DisplayClassb`1[System.IAsyncResult].<ProcessInApplicationTrust>b__a () [0x00000] in <filename unknown>:0
at System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0 (System.Action f) [0x00000] in <filename unknown>:0
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust (System.Action action) [0x00000] in <filename unknown>:0
at System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust[IAsyncResult] (System.Func`1 func) [0x00000] in <filename unknown>:0
at System.Web.Mvc.MvcHandler.BeginProcessRequest (System.Web.HttpContextBase httpContext, System.AsyncCallback callback, System.Object state) [0x00000] in <filename unknown>:0
at System.Web.Mvc.MvcHandler.BeginProcessRequest (System.Web.HttpContext httpContext, System.AsyncCallback callback, System.Object state) [0x00000] in <filename unknown>:0
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback cb, System.Object extraData) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator3.MoveNext () [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0
Fixing robots.txt:
Right click the project name and select "Add->New Item"
Choose "Text File" and call it "robots.txt"
You can leave this file blank
Fixing favicon.ico:
Go to the RegisterRoutes method of the Global.asax.cs file and add this near the top: You can look at this page for more info: Favicon Icon-MVC3 ASP.NET
routes.IgnoreRoute("{*favicon}", new { favicon = #"(.*/)?favicon.ico(/.*)?" });
Fixing apple-touch-icon.png:
Look at these websites
Why am I getting error for apple-touch-icon-precomposed.png
http://mathiasbynens.be/notes/touch-icons

Mono - ASP.NET Application in domain Subfolder

I have an Apache server with mod_mono hooked up to a legacy ASP.NET application. I can't seem to get this application to work if I move it from a top level folder.
For example, the following mono .webapp successfully works at http://localhost/Service.asmx (as my web app is in folder2):
<apps>
<web-application>
<name>Test</name>
<vpath>/</vpath>
<path>/srv/aspnettest/folder1/folder2</path>
<vhost>localhost</vhost>
</web-application>
</apps>
However, due to a legacy URL, I need my web application to exist two subfolders deeper like so:
<apps>
<web-application>
<name>Test</name>
<vpath>/</vpath>
<path>/srv/aspnettest/</path>
<vhost>localhost</vhost>
</web-application>
</apps>
If I try to go to http://localhost/folder1/folder2/Service.asmx it fails with
HTTP 500. Error processing request.
Stack Trace:
System.Web.HttpException: Type MyType.Service not found.
at System.Web.UI.SimpleWebHandlerParser.GetTypeFromBin (System.String tname) [0x00000] in <filename unknown>:0
at System.Web.Compilation.SimpleBuildProvider.LoadTypeFromBin (System.Web.Compilation.BaseCompiler compiler, System.Web.UI.SimpleWebHandlerParser parser) [0x00000] in <filename unknown>:0
at System.Web.Compilation.GenericBuildProvider`1[TParser].GetGeneratedType (System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManagerCacheItem..ctor (System.Reflection.Assembly assembly, System.Web.Compilation.BuildProvider bp, System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.StoreInCache (System.Web.Compilation.BuildProvider bp, System.Reflection.Assembly compiledAssembly, System.CodeDom.Compiler.CompilerResults results) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GenerateAssembly (System.Web.Compilation.AssemblyBuilder abuilder, System.Web.Compilation.BuildProviderGroup group, System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Compilation.BuildManager.GetCompiledType (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler (System.Web.HttpContext context, System.String verb, System.String url, System.String filePath) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator2.MoveNext () [0x00000] in <filename unknown>:0
How can I successfully get a web app in subfolders? Thanks.
Turns out this was an Apache configuration issue that was unrelated but caused this as a side effect. I had my VirtualHost setup incorrectly.

System.InvalidOperationException compiling ASP.NET app on Mono

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.

Resources