Error when using CefSharp.OffScreen in an ASP.Net Web Application - Could not load file or assembly CefSharp.BrowserSubprocess.Core.DLL - asp.net-web-api2

Is it possible to run CefSharp.OffScreen in an ASP.Net Web application? When I try this error happens right away and is before any code that I can put a breakpoint on. To get this error just create a new project, add the CefSharp.Offscreen package and then F5. I'm guessing I need to add some references or maybe it requires a STA thread? I realize this is probably not the typical use of this library but I am just experimenting.
Server Error in '/' Application.
Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.
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.IO.FileNotFoundException: Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.
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:
[FileNotFoundException: Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +37
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +159
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +80
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
System.Reflection.Assembly.Load(String assemblyString) +29
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +39
[ConfigurationErrorsException: Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +777
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +229
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +140
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +176
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +99
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +310
System.Web.Compilation.BuildManager.ExecutePreAppStart() +165
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +590
[HttpException (0x80004005): Could not load file or assembly 'CefSharp.BrowserSubprocess.Core.DLL' or one of its dependencies. The specified module could not be found.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10080656
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0

Related

CREATE DATABASE permission denied in database 'master' accessing as SA

I created a small application for test purposes. The problem starts when I try to deploy the app to an Azure VM. When accessing the published app, I get an error
CREATE DATABASE permission denied in database 'master'
The strange thing is that it works fine when I access the same DB, with the same user (sa), from my PC or SSMS. It just doesn't work only when running on the web server. I have no idea what is going wrong.
Here is the stack trace I get:
[SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +3306108
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +736
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4061
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +1293
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) +421
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +380
System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +104
System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) +499
System.Data.Entity.SqlServer.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn) +135
System.Data.Entity.SqlServer.<>c__DisplayClass33.<UsingConnection>b__32() +587
System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +18
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +234
System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) +909
System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) +117
System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +211
System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +125
System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +156
System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +116
System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext) +124
System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +292
System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +187
System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +75
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +482
System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +177
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +269
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +38
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +69
System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() +21
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +59
System.Linq.Queryable.FirstOrDefault(IQueryable`1 source, Expression`1 predicate) +61
MajowskiMartinCloud.Models.ADALTokenCache..ctor(String signedInUserId) +539
MajowskiMartinCloud.Startup.<ConfigureAuth>b__7_0(AuthorizationCodeReceivedNotification context) +149
Microsoft.Owin.Security.OpenIdConnect.<AuthenticateCoreAsync>d__1a.MoveNext() +5428
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Owin.Security.OpenIdConnect.<AuthenticateCoreAsync>d__1a.MoveNext() +5937
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Security.Infrastructure.<BaseInitializeAsync>d__0.MoveNext() +817
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +329
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +197
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Security.Infrastructure.<Invoke>d__0.MoveNext() +768
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<RunApp>d__5.MoveNext() +197
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +60
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.<DoFinalWork>d__2.MoveNext() +184
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +31
Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar) +117
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +367
System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128
After 2 days, I finally found out witch was the problem.
When I created the project in VS2015, i created a new MVC project with AzureAD authentication. While creating the solution, VS added to web config this part of code to manage the token cache:
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
On my PC I was using the IIS Express server, so I assume that VS was managing all the authorization part. And I just did't care about it, since it was working, so I didn't even know that there was another DB access, other than the one I defined for EF Model.
I'm not sure, but I assume that with this configuration the app try to connect to the local sql server instance (.\SQLEXPRESS) using the IIS user. The IIS user does,'t have any role on my Sql instance, so I think that this is the reason of the error. I resolved changing the part above with this:
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="Data Source=.\SQLEXPRESS;Initial Catalog=MyDB;MultipleActiveResultSets=True;User ID=*******;Password=*******" />
</parameters>
</defaultConnectionFactory>
Now it works

No project templates are compiling with Visual Studio 2017 RC

On clean a Windows 10 64 machine, I have installed Visual Studio 2017 RC (along with ALL components) and no projects are building at all. They are all failing with this error:
Child node "2" exited prematurely. Shutting down. Diagnostic
information may be found in files in the temporary files directory
named MSBuild_*.failure.txt.
When i investigate the log file it mentions it says:
UNHANDLED EXCEPTIONS FROM PROCESS 7300:
===================== 07/01/2017 19:30:19 System.IO.FileNotFoundException: The system cannot find the file
specified. (Exception from HRESULT: 0x80070002) at
Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance() at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.ReadApplicationConfiguration()
at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.get_ConfigurationSection()
at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.<get_ToolsVersions>d__8.MoveNext()
at
Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary`2
toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1
initialProperties, Boolean accumulateProperties) at
Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary`2
toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1
initialProperties, Boolean accumulateProperties, String&
msBuildOverrideTasksPath, String& defaultOverrideToolsVersion) at
Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2
toolsets, ToolsetRegistryReader registryReader,
ToolsetConfigurationReader configurationReader, PropertyDictionary`1
environmentProperties, PropertyDictionary`1 globalProperties,
ToolsetDefinitionLocations locations) at
Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader
registryReader, ToolsetConfigurationReader configReader) at
Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2
globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers,
ToolsetDefinitionLocations toolsetDefinitionLocations, Int32
maxNodeCount, Boolean onlyLogCriticalEvents) at
Microsoft.Build.Evaluation.ProjectCollection.get_GlobalProjectCollection()
at
Microsoft.Build.Execution.OutOfProcNode.HandleNodeConfiguration(NodeConfiguration
configuration) at
Microsoft.Build.Execution.OutOfProcNode.HandlePacket(INodePacket
packet) at Microsoft.Build.Execution.OutOfProcNode.Run(Boolean
enableReuse, Exception& shutdownException) at
Microsoft.Build.CommandLine.MSBuildApp.StartLocalNode(CommandLineSwitches
commandLineSwitches) at
Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches
switchesFromAutoResponseFile, CommandLineSwitches
switchesNotFromAutoResponseFile, String& projectFile, String[]&
targets, String& toolsVersion, Dictionary`2& globalProperties,
ILogger[]& loggers, LoggerVerbosity& verbosity, List`1&
distributedLoggerRecords, Boolean& needToValidateProject, String&
schemaFile, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter&
preprocessWriter, Boolean& debugger, Boolean& detailedSummary, Boolean
recursing) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String
commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main()
=================== 07/01/2017 19:30:19 System.IO.FileNotFoundException: The system cannot find the file
specified. (Exception from HRESULT: 0x80070002) at
Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance() at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.ReadApplicationConfiguration()
at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.get_ConfigurationSection()
at
Microsoft.Build.Evaluation.ToolsetConfigurationReader.<get_ToolsVersions>d__8.MoveNext()
at
Microsoft.Build.Evaluation.ToolsetReader.ReadEachToolset(Dictionary`2
toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1
initialProperties, Boolean accumulateProperties) at
Microsoft.Build.Evaluation.ToolsetReader.ReadToolsets(Dictionary`2
toolsets, PropertyDictionary`1 globalProperties, PropertyDictionary`1
initialProperties, Boolean accumulateProperties, String&
msBuildOverrideTasksPath, String& defaultOverrideToolsVersion) at
Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2
toolsets, ToolsetRegistryReader registryReader,
ToolsetConfigurationReader configurationReader, PropertyDictionary`1
environmentProperties, PropertyDictionary`1 globalProperties,
ToolsetDefinitionLocations locations) at
Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetRegistryReader
registryReader, ToolsetConfigurationReader configReader) at
Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary`2
globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers,
ToolsetDefinitionLocations toolsetDefinitionLocations, Int32
maxNodeCount, Boolean onlyLogCriticalEvents) at
Microsoft.Build.Evaluation.ProjectCollection.get_GlobalProjectCollection()
at
Microsoft.Build.Execution.OutOfProcNode.HandleNodeConfiguration(NodeConfiguration
configuration) at
Microsoft.Build.Execution.OutOfProcNode.HandlePacket(INodePacket
packet) at Microsoft.Build.Execution.OutOfProcNode.Run(Boolean
enableReuse, Exception& shutdownException) at
Microsoft.Build.CommandLine.MSBuildApp.StartLocalNode(CommandLineSwitches
commandLineSwitches) at
Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches
switchesFromAutoResponseFile, CommandLineSwitches
switchesNotFromAutoResponseFile, String& projectFile, String[]&
targets, String& toolsVersion, Dictionary`2& globalProperties,
ILogger[]& loggers, LoggerVerbosity& verbosity, List`1&
distributedLoggerRecords, Boolean& needToValidateProject, String&
schemaFile, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter&
preprocessWriter, Boolean& debugger, Boolean& detailedSummary, Boolean
recursing) at Microsoft.Build.CommandLine.MSBuildApp.Execute(String
commandLine) at Microsoft.Build.CommandLine.MSBuildApp.Main()
===================
I have repaired the installation and done a full uninstall/install that doesnt make a difference.
Tried turning logging on under Tools -> Options to diagnostic but it doesnt show me which file it is refering to in the error message in the log file.
This works with existing projects and new projects. Any ideas?
NOTE: I did originally install VS on a non default non system drive but removed this and re did it to the default installation.

Creating tables with existing data source in Entity Framework

I am new to MVC (using MVC4 and EF5) and I have been following the introductory tutorial (http://www.asp.net/mvc/overview/gett...adding-a-model) to create a model, controller,and the views. I want to create an "Orders" screen where all orders are displayed, etc, just so I can understand CRUD operations with EF but when I publish to the server I am getting an error.
The first thing I did was right-click the models folder and add a new class to create a model:
Imports System.Data.Entity
Imports System.ComponentModel.DataAnnotations.Schema
Imports System.ComponentModel.DataAnnotations
<Table("Orders")> _
Public Class Orders
<Key()> _
<DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)> _
Public Property OrderID As Integer
Public Property UserID As Integer
Public Property OrderDate As DateTime
Public Property OrderAmount As Decimal
End Class
Public Class OrdersDBContext
Inherits DbContext
Public Sub New()
MyBase.New("OrdersDBContext")
End Sub
Public OrderList As DbSet(Of Orders)
Public Property Orders As DbSet(Of Orders)
End Class
The next thing I did was add a line item into the Web.Config file:
<add name="OrdersDBContext" connectionString="Data Source=dbnumber.db.1and1.com,1433;Initial Catalog=db620663152;User Id=dbo620663152;Password=xxxxx;" providerName="System.Data.SqlClient" />
I built the project, eventually was able to create an "OrdersController" by right-clicking on the controller folder and selecting "Add Controller", making the appropriate selections in the wizard. Controller is now added. When I actually navigate to the newly-added orders area, I get the following error:
Server Error in '/' Application.
CREATE DATABASE permission denied in database 'master'.
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.SqlClient.SqlException: CREATE DATABASE permission denied in database 'master'.
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:
[SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +1787814
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5341674
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +546
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +1693
System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +869
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +413
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +163
System.Data.SqlClient.<>c__DisplayClassa.<DbCreateDatabase>b__7(SqlConnection conn) +33
System.Data.SqlClient.SqlProviderServices.UsingConnection(SqlConnection sqlConnection, Action`1 act) +92
System.Data.SqlClient.SqlProviderServices.UsingMasterConnection(SqlConnection sqlConnection, Action`1 act) +379
System.Data.SqlClient.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +276
System.Data.Objects.ObjectContext.CreateDatabase() +84
System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +84
System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists() +70
System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +44
System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext) +253
System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext) +125
System.Data.Entity.Database.Create(Boolean skipExistsCheck) +115
System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +307
System.Data.Entity.Internal.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6() +19
System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +181
System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7
System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +185
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +52
System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +15
System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnume rator() +40
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
TampaBayDeliveryV4.OrdersController.Index() +21
lambda_method(Closure , ControllerBase , Object[] ) +62
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +181
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27
System.Web.Mvc.Async.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41() +28
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32
System.Web.Mvc.Async.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33() +58
System.Web.Mvc.Async.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() +225
System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeActionMethodWithFilters>b__36(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34
System.Web.Mvc.Async.<>c__DisplayClass2a.<BeginInvokeAction>b__20() +24
System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +99
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +50
System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +14
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +55
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9651516
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34280
So, I am not really sure whats going on here. I am using a shared host and cannot access the database remotely; I also cannot have the code create a new database, the code needs to use the existing database and add the tables. This was fine for the account model (it created the necessary underlying tables for authentication/accounts). I think the issue here is that the code expects to create a new database (since the table for orders doesn't exist yet?).
If I am not off-base with my assumption, what should I do to tell my MVC app to use the existing data-source in the connection string rather than try and create a whole new database? I just basically want my application to create the tables with the given connection string in the web.config file.
Thanks for any advice.

The service cannot be activated due to an exception during compilation

I have deployed WCF service on IIS 7 (Windows Server 2008), but I'm getting a strange error:
WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/31364015
Exception: System.ServiceModel.ServiceActivationException: The service '/WCFService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)). ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not load file or assembly 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
File name: 'IHEC.WS.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> System.IO.FileLoadException: Could not load file or assembly 'IHEC.WS.dll' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
File name: 'IHEC.WS.dll'
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
--- End of inner exception stack trace ---
at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
at System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()
at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
at System.Web.Compilation.WebDirectoryBatchCompiler..ctor(VirtualDirectory vdir)
at System.Web.Compilation.BuildManager.BatchCompileWebDirectoryInternal(VirtualDirectory vdir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.BatchCompileWebDirectory(VirtualDirectory vdir, VirtualPath virtualDir, Boolean ignoreErrors)
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetCompiledCustomString(String virtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.GetCompiledCustomString(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)
--- End of inner exception stack trace ---
at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: w3wp
Process ID: 2616
The strange is, that the file IHEC.WS.dll is there in the bin directory.
Moving OP's own answer/comment to Answers
meanwhile I have solved this problem. When I deploy a project with
using Web Deployment Project and set 'Allow this precompiled site to
be updateble' it works fine. But I don't know why

Changing the web.config takes the WCF service down?

I have a simple WCF service hosted on IIS. Anytime I change the web.config file the service goes down and shows the following error:
Could not load file or assembly
'AutoMapper, Version=1.1.0.188,
Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E)
To correct it, I need to delete all existing files and re-publish the WCF service. Re-publishing without deleting old files doesn't work, and neither does restarting the iis server.
Does anyone know why this happens? Or if there is an alternative to republishing the service to bring it back up? I am using IIS on Windows Server 2003, which I think is 6.0, and .Net framework 4.0
Further Error Info...
Assembly Load Trace: The following
information can be helpful to
determine why the assembly
'AutoMapper, Version=1.1.0.188,
Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' could
not be loaded.
WRN: Assembly binding logging is
turned OFF. To enable assembly bind
failure logging, set the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog]
(DWORD) to 1. Note: There is some
performance penalty associated with
assembly bind failure logging. To turn
this feature off, remove the registry
value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load
file or assembly 'AutoMapper,
Version=1.1.0.188, Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName
fileName, String codeBase, Evidence
assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark&
stackMark, Boolean
throwOnFileNotFound, Boolean
forIntrospection, Boolean
suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.nLoad(AssemblyName
fileName, String codeBase, Evidence
assemblySecurity, RuntimeAssembly
locationHint, StackCrawlMark&
stackMark, Boolean
throwOnFileNotFound, Boolean
forIntrospection, Boolean
suppressSecurityChecks) +39
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence
assemblySecurity, StackCrawlMark&
stackMark, Boolean forIntrospection,
Boolean suppressSecurityChecks) +132
System.Reflection.RuntimeAssembly.InternalLoad(String
assemblyString, Evidence
assemblySecurity, StackCrawlMark&
stackMark, Boolean forIntrospection)
+144 System.Reflection.Assembly.Load(String
assemblyString) +28
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
constructorString, Uri[]
baseAddresses) +208
System.ServiceModel.HostingManager.CreateService(String
normalizedVirtualPath) +1440
System.ServiceModel.HostingManager.ActivateService(String
normalizedVirtualPath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable(String
normalizedVirtualPath) +615
[ServiceActivationException: The
service
'/Services/ClientLoginService.svc'
cannot be activated due to an
exception during compilation. The
exception message is: Could not load
file or assembly 'AutoMapper,
Version=1.1.0.188, Culture=neutral,
PublicKeyToken=be96cd2c38ef1005' or
one of its dependencies. Logon
failure: unknown user name or bad
password. (Exception from HRESULT:
0x8007052E).]
System.Runtime.AsyncResult.End(IAsyncResult
result) +679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult
result) +190
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication
context, String
routeServiceVirtualPath, Boolean
flowContext, Boolean ensureWFService)
+234 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object
sender, EventArgs e) +355
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+148 System.Web.HttpApplication.ExecuteStep(IExecutionStep
step, Boolean& completedSynchronously)
+75