Windows Server 2008 R2: Compiler executable file csc.exe cannot be found - asp.net

My application is running by:
ASP.NET
MVC 3
Framework 4.0
When I run the application on my computer (localhost:...) it's runs successfully.
Now, is the first time, I run application on windows server 2008 R-2.
The error is: "Compiler executable file csc.exe cannot be found"
What could be the problem?
(.net4 installed correctly, and csc.exe file is exists in: "C:\Windows\Microsoft.NET\Framework\v4.0\").

Please, send complete stack trace, just like this below:
"[InvalidOperationException: Compiler executable file csc.exe cannot be found.]
System.CodeDom.Compiler.RedistVersionInfo.GetCompilerPath(IDictionary`2 provOptions, String compilerExecutable) +8675071
Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +739
Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) +3293761
Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) +64
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.Compile(String fileName, String[] sources, IEnumerable`1 assembliesToReference) +1252
HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(IEnumerable`1 sourcesResources, IEnumerable`1 assembliesToReference, String assemblyName) +118
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupDatabaseDefaultConnectionFactoryIfNeeded() +929
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupEntityFrameworkIntegration() +80
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize(EntityFrameworkAppenderConfiguration configuration) +47
HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize() +73
Web4.MvcApplication.Application_Start() +17
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext "
If you are using HibernatingRhinos, you should try a new dll build:
http://hibernatingrhinos.com/builds like discussed in this post:
https://groups.google.com/forum/#!topic/nhprof/XY4e3tm-ONc
It solved my issue.

Related

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies

i updated Newtonsoft.Json package as 9.0.1
and at my local server publish file working very well.but my boss said it is not working on live server.Could you please solve this issue.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 7/13/2021 7:46:08 AM
Event time (UTC): 7/13/2021 7:46:08 AM
Event ID: 90c697ce232647939806d6e807833f1e
Event sequence: 2
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-2-132706359680241249
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\DRS\
Machine name: EC2AMAZ-7HRKLBA
Process information:
Process ID: 8776
Process name: w3wp.exe
Account name: IIS APPPOOL\DRS
Exception information:
Exception type: TargetInvocationException
Exception message: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Owin.Loader.DefaultLoader.<>c__DisplayClass12.b__b(IAppBuilder builder)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func1 valueFactory) at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context) at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) Could not load file or assembly 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Hangfire.Common.SerializationHelper.Serialize(Object value, Type type, SerializationOption option) at Hangfire.Storage.InvocationData.SerializeJob(Job job) at Hangfire.RecurringJobEntity.GetChangedFields(Nullable1& nextExecution)
at Hangfire.RecurringJobEntity.IsChanged(IReadOnlyDictionary2& changedFields, Nullable1& nextExecution)
at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options)
at Hangfire.RecurringJob.AddOrUpdate[T](Expression`1 methodCall, String cronExpression, TimeZoneInfo timeZone, String queue)
at Comsol.Champ.DRS.Web.Startup.Configuration(IAppBuilder app) in D:\Projects\DRS\DRS\DRS\DRS\DRS.Web\Startup.cs:line 29
Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Request information:
Request URL: http://referal.champdonate.ie/
Request path: /
User host address: 185.233.17.193
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DRS
Thread information:
Thread ID: 10
Thread account name: IIS APPPOOL\DRS
Is impersonating: False
Stack trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Owin.Loader.DefaultLoader.<>c__DisplayClass12.b__b(IAppBuilder builder)
at Owin.Loader.DefaultLoader.<>c__DisplayClass1.b__0(IAppBuilder builder)
at Microsoft.Owin.Host.SystemWeb.OwinAppContext.Initialize(Action1 startup) at Microsoft.Owin.Host.SystemWeb.OwinBuilder.Build(Action1 startup)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.InitializeBlueprint()
at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory)
at Microsoft.Owin.Host.SystemWeb.OwinHttpModule.Init(HttpApplication context)
at System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers)
at System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context)
at System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context)
at System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext)
Custom event details:
Look in your web.config or app.config for any sections that look like this. It will force your web server to use an older version of a DLL.
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
You can fix it by, First, making a backup of your config file. Next, remove the bindingRedirect line.

umbraco website deploy Server Error in '/' Application

Hi everybody i am stuck at this point hope someone got the answer
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Umbraco.Web.Runtime.WebRuntime.Boot(IRegister register) in D:\a\1\s\src\Umbraco.Web\Runtime\WebRuntime.cs:55
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +517
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +185
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +168
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +277
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +369
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +714
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3650.0
My solution was to give full control permission on the 'httpdocs' folder on the host server

Bonobo Can't Open Database File

I'm trying to install Bonobo on Windows 7/IIS 7/.Net 4.5 but I'm having trouble with SQLite. I get the following error when I load up the page in a browser
unable to open database file
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SQLite.SQLiteException: unable to open database file
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SQLiteException (0xe): unable to open database file]
System.Data.SQLite.SQLite3.Open(String strFilename, SQLiteConnectionFlags connectionFlags, SQLiteOpenFlagsEnum openFlags, Int32 maxPoolSize, Boolean usePool) +731
System.Data.SQLite.SQLiteConnection.Open() +445916
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +102
[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +11430327
System.Data.EntityClient.EntityConnection.Open() +142
System.Data.Objects.ObjectContext.EnsureConnection() +97
System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters) +53
Bonobo.Git.Server.Data.Update.AutomaticUpdater.UpdateDatabase() +444
Bonobo.Git.Server.MvcApplication.Application_Start() +145
[HttpException (0x80004005): The underlying provider failed on Open.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12962661
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475
[HttpException (0x80004005): The underlying provider failed on Open.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12979668
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12819261
I have SQLite installed now (though, I don't think that matters... Bonobo comes with its own SQLite dlls. I AM running on a 64 bit system. I don't know if that has anything to do with compatability. I've followed the installation instructions on the Bonobo site to the tee, but I still get this error and Google hasn't provided any answers for me. Could anyone point me in the right direction?
You should try to set the right security options for your IIS.
From http://bonobogitserver.com/install/

Syntax error in global.asax

I have the code below in my global.asax file (in my asp.net application) ...
and I have the error below in stack trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Digita.Tustena.Global.Application_Start(Object sender, EventArgs e) +133
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3985477
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375
[HttpException (0x80004005): Object reference not set to an instance of an object.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11524352
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4782309
What is the problem with my code? I appriciate your helps ...
Look in the method Application_Start in the file Global.asax.cs. You have a null reference there. Put a try/catch and use the debugger to see which object is null.
If you deploy the pdb files with your dll the stack trace will also contain the line number. Also do set the Debug Info to full: Project Properties -> Build -> Advanced -> Debug Info (http://stackoverflow.com/a/3791997/57369)

.Net Framework Data Provider May Not Be Installed?

I have an ASP.NET website created in VS 2010 which is using the MVC3 (Razor) and Entity Framework and MSSQL database. The project runs fine on my machine, however when I publish and upload to my host I get the error:
Unable to find the requested .Net Framework Data Provider. It may not be installed.
Now I believe that I have added all required DLLs to my /bin folder. This is my connection string in the web.config file:
Connection String
<add name="WhimsicalFurnishingEntities"
connectionString="metadata=res://*/App_Code.WhimsicalFurnishingModel.csdl|res://*/App_Code.WhimsicalFurnishingModel.ssdl|res://*/App_Code.WhimsicalFurnishingModel.msl;
provider=System.Data.SqlClient;
provider connection string="
data source=localhost\sqlexpress;
Initial Catalog=DBNAME;
integrated security=True;
User ID=DBUSER;
Password=DBPASSWORD;
user instance=True;
multipleactiveresultsets=True;
App=EntityFramework""
providerName="System.Data.EntityClient" />
I have read that you might need to add another connection string just for the database SQL Client and I have tried:
What I Have Tried
<add name="WhimsicalFurnishingMembership"
connectionString="data source=localhost\sqlexpress;Initial Catalog=DBNAME;Integrated Security=false;User ID=DBUSER;Password=DBPASSWORD;"
providerName="System.Data.SqlClient"/>
However the same error persists. This is the exact error that I am getting from Stack Trace:
[ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed.
]
System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1434271
WebMatrix.Data.DbProviderFactoryWrapper.CreateConnection(String connectionString) +64
WebMatrix.Data.<>c__DisplayClass15.<OpenConnectionStringInternal>b__14() +16
WebMatrix.Data.Database.get_Connection() +19
WebMatrix.Data.Database.EnsureConnectionOpen() +12
WebMatrix.Data.<QueryInternal>d__0.MoveNext() +71
System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +4231764
WebMatrix.Data.Database.QuerySingle(String commandText, Object[] args) +103
WebMatrix.WebData.SimpleMembershipProvider.CheckTableExists(Database db, String tableName) +59
WebMatrix.WebData.SimpleMembershipProvider.CreateTablesIfNeeded() +55
WebMatrix.WebData.WebSecurity.InitializeMembershipProvider(SimpleMembershipProvider sMembership, DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean createTables) +73
WebMatrix.WebData.WebSecurity.InitializeProviders(DatabaseConnectionInfo connect, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
WebMatrix.WebData.WebSecurity.InitializeDatabaseConnection(String connectionStringName, String userTableName, String userIdColumn, String userNameColumn, Boolean autoCreateTables) +51
ASP._Page__AppStart_cshtml.Execute() in ******\wwwroot\_AppStart.cshtml:3
System.Web.WebPages.ApplicationStartPage.<ExecuteInternal>b__3() +65
System.Web.WebPages.ApplicationStartPage.<GetSafeExecuteStartPageThunk>b__a(Action action) +7
System.Web.WebPages.ApplicationStartPage.ExecuteInternal() +78
System.Web.WebPages.ApplicationStartPage.ExecuteStartPageInternal(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +202
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +41
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application, Action`1 monitorFile, Func`2 fileExists, Func`2 createInstance, IEnumerable`1 supportedExtensions) +88
System.Web.WebPages.ApplicationStartPage.ExecuteStartPage(HttpApplication application) +287
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application, Action`1 executeStartPage, EventHandler applicationStart) +113
System.Web.WebPages.WebPageHttpModule.StartApplication(HttpApplication application) +71
System.Web.WebPages.WebPageHttpModule.Init(HttpApplication application) +217
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +517
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +194
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +339
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +253
[HttpException (0x80004005): Exception of type 'System.Web.HttpException' was thrown.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9090876
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +256
Is there another way I can try to debug this? Am I missing anything that must be included in my web.config or _AppStart.cshtml file?
Thank You

Resources