WPF with DevExpress crashes when Deploying to computer other than Dev Environment - wpf

I was having an issues with a WPF application after deploying it from my local dev environment (where it works when running / debugging), it would crash, and never load the application (multiple different environments - Windows 7, Server 2008R2). The application crashes before starting up at all, so I started a brand new WPF test application (VS 2015, using .NET 4.0), and included a simple mainWindow.xaml with a simple DevExpress Grid (nothing special) and deployed it to one of the environments to test, and it has the same error.
I have made sure to include all DevExpress .dlls that are referenced in the project with the deployed code also.
It appears to have something to do with the following code implemented by DevExpress, since commenting it out will allow the application to work without the errors causing it to crash:
private void OnAppStartup_UpdateThemeName(object sender, StartupEventArgs e)
{
// This was the issue causing the Error in EventViewer causing the application to Crash outside of the Dev Environemnt when deployed.
DevExpress.Xpf.Core.ApplicationThemeHelper.UpdateApplicationThemeName();
}
Although, I would still like to get an understanding of why it is doing that and how to fix it without just commenting it out.
Environment: Windows 10, Visual Studio 2015 Professional, DevExpress 16.1, WPF Application, .NET 4.0
Error [1] in Event Viewer:
Faulting application name: TestWpfAppWithDevExpress.exe, version: 1.0.0.0, time stamp: 0x58497b5c
Faulting module name: KERNELBASE.dll, version: 6.1.7601.23418, time stamp: 0x5708a89c
Exception code: 0xe0434352
Fault offset: 0x000000000001a06d
Faulting process id: 0x1648
Faulting application start time: 0x01d251676fb4af67
Faulting application path: C:\temp\testApp\TestWpfAppWithDevExpress.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Error [2[ in event viewer:
Application: TestWpfAppWithDevExpress.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack: at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri) at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean) at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext) at System.Windows.Application.LoadComponent(System.Uri, Boolean) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__1(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Application.RunInternal(System.Windows.Window) at System.Windows.Application.Run() at TestWpfAppWithDevExpress.App.Main()

It looks like I was able to use the DevExpress toolbar and the DevExpress Assebmly Deployment tool to find out which Assemblies were required for the application that were tied to it. Once I did that and associated it with all the other / missing .dll files that were additionally required by the DevExpress items I was using (including the Theme I was using), it was able to be used on other machines.

Related

How to connect external MS SQL server database from container

I'm new in Docker and we are migrating our working ASP.NET CORE app to Docker in company
Problem is I did't find any releated topics about how to connect to external already existing MS SQL server [not in docker image] database from container.
All topics are about connecting to official Image of MS SQL-Server[which I don't need].
I wrote Dockerfile and application running but there no connection to SQL Server
Please give me correct direction with topics or hints thank you!
Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS base
WORKDIR /app
EXPOSE 5000 //port to app
EXPOSE 1433 //SQL-Server port
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src
COPY UploadCore/UploadCore.csproj UploadCore/
RUN dotnet restore UploadCore/UploadCore.csproj
COPY . .
WORKDIR /src/UploadCore
RUN dotnet build UploadCore.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish UploadCore.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "UploadCore.dll"]
I'm running my app as below
docker run -it --rm -p 5000:5000 -p 1433:1433 --name UploadCore my-app_test:4.5
Error:
Microsoft.EntityFrameworkCore.Database.Connection[20004]
An error occurred using the connection to database 'MIS_REPORTS' on server 'server02'.
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
Microsoft.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid: Connection string is not valid)
at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover, SqlAuthenticationMethod authType)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, DbConnectionPool pool)
Docker provides its own internal DNS service that can do things like resolve other container names as host names. It looks like you've configured your database location as a bare host name server02. This hits the Docker DNS resolver first, and it tries to resolve it as a container name; when that fails, that's why you're getting the error you do.
In different environments you can tell this apart from different kinds of errors by error messages like "name resolution failed" or "no such host"; this is different from an error message like "connection refused" or "connection reset by peer".
You can resolve this by using a fully-qualified domain name (FQDN) as your database location; for example, server02.example.com instead of just server02. Since that doesn't look like a container name, it will cause Docker to forward the DNS request to your normal name server.

System.BadImageFormatException occurred in the .NET Framework WPF application of Prism 7.2 that I installed

I have created a simple .NET Framework Prism WPF application using Visual Studio 2019. It works without errors in my development environment.
I installed the Visual Studio Intaller Projects extension and added the Setup Project to my solution.
In the Setup project, I added the WPF application, created the installer, ran the installation, and the installation was successful.
When I ran the WPF application, I got a怀System.BadImageFormatException.
.NET Framework version is 4.7.2, platform is Any CPU.
This exception does not occur in version 7.1.0.431, but in version 7.2.0.1367 and later (also in version 8.0.0.1909).
Eventviewer error: Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.BadImageFormatException
Exception Info: System.BadImageFormatException
at Unity.Builder.BuilderContext.Resolve(System.Type, System.String, Unity.Registration.InternalRegistration)
at Unity.Builder.BuilderContext.Resolve(System.Type, System.String)
at Unity.Builder.BuilderContext.Resolve(System.Reflection.ParameterInfo, System.Object)
at Unity.Processors.ParametersProcessor`1+<>c__DisplayClass5_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<CreateParameterResolvers>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.Processors.ConstructorProcessor+<>c__DisplayClass19_0.<GetResolverDelegate>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.Processors.MemberProcessor`2+<>c__DisplayClass8_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<GetResolver>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.Processors.MemberProcessor`2+<>c__DisplayClass8_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<GetResolver>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.Processors.MemberProcessor`2+<>c__DisplayClass8_0[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].<GetResolver>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.UnityContainer+<>c__DisplayClass94_0.<OptimizingFactory>b__0(Unity.Builder.BuilderContext ByRef)
at Unity.Strategies.BuildPlanStrategy.PreBuildUp(Unity.Builder.BuilderContext ByRef)
at Unity.UnityContainer+<>c.<.ctor>b__58_1(Unity.Builder.BuilderContext ByRef)
Exception Info: Unity.ResolutionFailedException
at Unity.UnityContainer+<>c.<.ctor>b__58_1(Unity.Builder.BuilderContext ByRef)
at Unity.UnityContainer.Unity.IUnityContainer.Resolve(System.Type, System.String, Unity.Resolution.ResolverOverride[])
at Unity.UnityContainerExtensions.Resolve(Unity.IUnityContainer, System.Type, Unity.Resolution.ResolverOverride[])
at Prism.Unity.Ioc.UnityContainerExtension.Resolve(System.Type)
at Prism.Ioc.IContainerProviderExtensions.Resolve[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Prism.Ioc.IContainerProvider)
at Prism.PrismApplicationBase.ConfigureRegionAdapterMappings(Prism.Regions.RegionAdapterMappings)
at Prism.PrismApplicationBase.Initialize()
at Prism.PrismApplicationBase.InitializeInternal()
at Prism.PrismApplicationBase.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at PrismApp1.App.Main()
Does anyone have an idea?
2020/12/15 Edited
Configuration Manager capture
Project Properties capture
Setup Project Properties capture

Change in sql server location causes Event 1026 .Net Runtime

I am connecting an application to a different SQL Server database and find the following error in the windows event log
The only change is the database server
Event 1026, .NET Runtime
Application: My.MyApp2.Win.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
at System.Data.Common.DbConnectionOptions.ConvertValueToBooleanInternal(System.String, System.String)
at System.Data.SqlClient.SqlConnectionString..ctor(System.String)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(System.String, System.Data.Common.DbConnectionOptions)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(System.Data.Common.DbConnectionPoolKey, System.Data.ProviderBase.DbConnectionPoolGroupOptions, System.Data.Common.DbConnectionOptions ByRef)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(System.Data.Common.DbConnectionPoolKey)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(System.String)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispatch[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon, System.Action`2<System.__Canon,System.__Canon>, System.__Canon, System.Action`3<System.__Canon,System.__Canon,System.__Canon>, System.Action`3<System.__Canon,System.__Canon,System.__Canon>)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(System.Data.Common.DbConnection, System.Data.Entity.Infrastructure.Interception.DbConnectionPropertyInterceptionContext`1<System.String>)
at System.Data.Entity.Infrastructure.SqlConnectionFactory.CreateConnection(System.String)
at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
at System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
at System.Data.Entity.Database.Exists()
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider.CheckDatabaseSchemaCompatibilityCore(System.Object)
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider.CreateObjectContext(System.Collections.Generic.IList`1<System.IDisposable>)
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider.Init(System.Type, DevExpress.ExpressApp.DC.ITypesInfo, DevExpress.ExpressApp.EF.EFTypeInfoSource, System.Data.Common.DbConnection, System.String, System.String, System.String)
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider..ctor(System.Type, System.String)
at My.MyApp2.Shedule.MyApp2Schedule.application_CreateCustomObjectSpaceProvider(System.Object, DevExpress.ExpressApp.CreateCustomObjectSpaceProviderEventArgs)
at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
at DevExpress.ExpressApp.XafApplication.OnCreateCustomObjectSpaceProvider(DevExpress.ExpressApp.CreateCustomObjectSpaceProviderEventArgs)
at DevExpress.ExpressApp.XafApplication.CreateObjectSpaceProviders(System.String)
at DevExpress.ExpressApp.XafApplication.Setup()
at MyApp2.Win.Program.Main()
When I enabled diagnostic actions in XAF I got
Application: My.MyApp2.Win.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.SqlClient.SqlException
at System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException, Boolean, System.Action`1<System.Action>)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(System.Data.SqlClient.TdsParserStateObject, Boolean, Boolean)
at System.Data.SqlClient.TdsParser.TryRun(System.Data.SqlClient.RunBehavior, System.Data.SqlClient.SqlCommand, System.Data.SqlClient.SqlDataReader, System.Data.SqlClient.BulkCopySimpleResultSet, System.Data.SqlClient.TdsParserStateObject, Boolean ByRef)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(System.String, Boolean, Int32, Boolean)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(System.Threading.Tasks.TaskCompletionSource`1<System.Object>, System.String, Boolean, Int32, Boolean ByRef, Boolean, Boolean)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Dispatch[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.__Canon, System.Func`3<System.__Canon,System.__Canon,Int32>, System.__Canon, System.Action`3<System.__Canon,System.__Canon,System.__Canon>, System.Action`3<System.__Canon,System.__Canon,System.__Canon>)
at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(System.Data.Common.DbCommand, System.Data.Entity.Infrastructure.Interception.DbCommandInterceptionContext)
at System.Data.Entity.SqlServer.SqlProviderServices+<>c__DisplayClass52_0.<CreateDatabaseFromScript>b__0(System.Data.Common.DbConnection)
at System.Data.Entity.SqlServer.SqlProviderServices+<>c__DisplayClass60_0.<UsingConnection>b__0()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy+<>c__DisplayClass2_0.<Execute>b__0()
at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Func`1<System.__Canon>)
at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(System.Data.Common.DbConnection, System.Action`1<System.Data.Common.DbConnection>)
at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(System.Nullable`1<Int32>, System.Data.Common.DbConnection, System.String)
at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(System.Data.Common.DbConnection, System.Nullable`1<Int32>, System.Data.Entity.Core.Metadata.Edm.StoreItemCollection)
at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(System.Data.Common.DbConnection)
at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(System.Action)
at System.Data.Entity.Migrations.DbMigrator.Update(System.String)
at System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(System.Data.Entity.Internal.InternalContext, System.Func`3<System.Data.Entity.Migrations.DbMigrationsConfiguration,System.Data.Entity.DbContext,System.Data.Entity.Migrations.Infrastructure.MigratorBase>, System.Data.Entity.Core.Objects.ObjectContext)
at System.Data.Entity.Database.Create(System.Data.Entity.Internal.DatabaseExistenceState)
at System.Data.Entity.CreateDatabaseIfNotExists`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InitializeDatabase(System.__Canon)
at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(System.Action)
at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
at System.Data.Entity.Internal.RetryAction`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].PerformAction(System.__Canon)
at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(System.Action`1<System.Data.Entity.Internal.InternalContext>)
at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider.CreateObjectContext(System.Collections.Generic.IList`1<System.IDisposable>)
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider.Init(System.Type, DevExpress.ExpressApp.DC.ITypesInfo, DevExpress.ExpressApp.EF.EFTypeInfoSource, System.Data.Common.DbConnection, System.String, System.String, System.String)
at DevExpress.ExpressApp.EF.EFObjectSpaceProvider..ctor(System.Type, System.String)
at My.MyApp2.Shedule.MyApp2Schedule.application_CreateCustomObjectSpaceProvider(System.Object, DevExpress.ExpressApp.CreateCustomObjectSpaceProviderEventArgs)
at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
at DevExpress.ExpressApp.XafApplication.OnCreateCustomObjectSpaceProvider(DevExpress.ExpressApp.CreateCustomObjectSpaceProviderEventArgs)
at DevExpress.ExpressApp.XafApplication.CreateObjectSpaceProviders(System.String)
at DevExpress.ExpressApp.XafApplication.Setup()
at MyApp2.Win.Program.Main()
The connection string is read from connections.config:
<connectionStrings>
<add name="ConnectionString"
connectionString="Server=MYSERVER;Database=MYDATABASE;Integrated Security=false;MultipleActiveResultSets=True;user=myuser;pwd=mypassword;"
providerName="System.Data.SqlClient" />
</connectionStrings>
The working server was running
Microsoft SQL Server 2017 (RTM-CU16) (KB4508218) - 14.0.3223.3 (X64) Jul 12 2019 17:43:08
Copyright (C) 2017 Microsoft Corporation
Express Edition (64-bit) on Linux (Ubuntu 16.04.6 LTS)
The new server is running
Microsoft SQL Server 2019 (RTM-CU2) (KB4536075) - 15.0.4013.40 (X64) Feb 3 2020 16:40:57
Copyright (C) 2019 Microsoft Corporation
Express Edition (64-bit) on Linux (CentOS Linux 8 (Core))
I can connect to the new server with SSMS
The Winforms program has been developed using the Dev Express XAF framework.
App.config has
<connectionStrings configSource="connections.config" />
Target framework is .NET Framework 4.7.2
I tried removing Integrated Security=false; from the connection string and it made no difference.
I tried using an invalid user name and I did get an error as expected then.
The program simply stops running without any error message.
I see the XAF loading icon but the XAF login screen does not appear.
eXpressAppFramework.log has
11.04.20 19:21:04.119 ================================================================================
11.04.20 19:21:04.135 Trace Log for My.MyApp2.Win.exe is started
11.04.20 19:21:04.135 ================================================================================
11.04.20 19:21:04.135 System Environment
OS Version: Microsoft Windows NT 6.2.9200.0
.Net Framework Versions: v4.0.30319
CLR Version: 4.0.30319.42000
eXpressApp Version: 19.1.8.0
eXpressApp File Version: 19.1.8.0
Application config
Modules=
NewVersionServer=
EnableDiagnosticActions=True
ClientSettingsProvider.ServiceUri=
11.04.20 19:21:04.197 Initialize application
=======================
11.04.20 19:21:04.197 Command line arguments:
C:\MyMyApp2\My.MyApp2.Win.exe
11.04.20 19:21:04.354 The ValueManagerType is initialized by the default value: SimpleValueManager.
11.04.20 19:21:04.369 Stack trace:
at DevExpress.Persistent.Base.ValueManager.CreateValueManager[ValueType](String key)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at DevExpress.Persistent.Base.ValueManager.GetValueManager[ValueType](String key)
at DevExpress.ExpressApp.ReportsV2.ApplicationReportObjectSpaceProvider.set_ContextApplication(XafApplication value)
at DevExpress.ExpressApp.ReportsV2.ReportsModuleV2.Setup(XafApplication application)
at DevExpress.ExpressApp.ModuleList.OnInsert(Int32 index, Object value)
at System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
at MyApp2.Win.MyApp2WindowsFormsApplication.InitializeComponent() in D:\dev\SBD.MyMyApp2\MyApp2.Win\WinApplication.Designer.cs:line 78
at MyApp2.Win.MyApp2WindowsFormsApplication..ctor() in D:\dev\SBD.MyMyApp2\MyApp2.Win\WinApplication.cs:line 48
at MyApp2.Win.Program.Main() in D:\dev\SBD.MyMyApp2\MyApp2.Win\Program.cs:line 30
I think the issue is that I have two dbcontexts in the application and the database for one is missing. I will be able to test this tomorrow.

SSMS 2016 crashes in Edit Top X Rows for Windows 10

I'm having a problem where SSMS will crash while trying to scroll through the results of the "Edit Top X Rows". I have tried reducing the number of rows returned, installing older versions of SSMS, and making sure I am on the latest versions. I will include the event log, as well as the version information for SSMS.
OS is Windows 10 x64
SSMS Info:
download location: https://msdn.microsoft.com/en-us/library/mt238290.aspx
Microsoft SQL Server Management Studio - 13.0.16000.28
Microsoft Analysis Services Client Tools - 13.0.1700.441
Microsoft Data Access Components (MDAC) - 10.0.14393.0
Microsoft MSXML - 3.0 6.0
Microsoft Internet Explorer - 9.11.14393.0
Microsoft .NET Framework - 4.0.30319.42000
Operating System - 6.3.14393
Event Log 1
Faulting application name: Ssms.exe, version: 2015.130.16000.28, time stamp: 0x580af2c5
Faulting module name: KERNELBASE.dll, version: 10.0.14393.321, time stamp: 0x57f4c291
Exception code: 0xe0434352
Fault offset: 0x000da6f2
Faulting process id: 0x3364
Faulting application start time: 0x01d24a529cd4afa4
Faulting application path: C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: c6e3afb2-b3d0-4857-8eb6-e538c1b22ff2
Event Log 2
Application: Ssms.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
at System.Buffer.BlockCopy(System.Array, Int32, System.Array, Int32, Int32)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.FileStreamReader.ReadArray[[System.Char, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](Int64, Boolean, Int32, Microsoft.SqlServer.Management.DataTools.UI.QueryResult.SpecialDataType ByRef, Char[] ByRef, Int32 ByRef)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.FileStreamReader.ReadString(Int64, Boolean, Microsoft.SqlServer.Management.DataTools.UI.QueryResult.SpecialDataType ByRef, System.String ByRef)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.DiskStorageView.SequentialReadColumn(Int32, Boolean)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.DiskStorageView.GetCellDataFromFileInternal(Int64, Int32, Boolean)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.DiskStorageView.GetCellData(Int64, Int32)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.StorageViewBase.GetCellDataAsStringInternal(Int64, Int32)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.DiskStorageView.GetCellDataAsString(Int64, Int32)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.ResultBindingList.GetValue(Int32, Int32)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.QueryResultControl.DataGridView_CellValueNeeded(System.Object, System.Windows.Forms.DataGridViewCellValueEventArgs)
at System.Windows.Forms.DataGridView.OnCellValueNeeded(System.Windows.Forms.DataGridViewCellValueEventArgs)
at System.Windows.Forms.DataGridView.OnCellValueNeeded(Int32, Int32)
at System.Windows.Forms.DataGridViewCell.GetValue(Int32)
at System.Windows.Forms.DataGridViewTextBoxCell.GetPreferredSize(System.Drawing.Graphics, System.Windows.Forms.DataGridViewCellStyle, Int32, System.Drawing.Size)
at System.Windows.Forms.DataGridViewCell.GetPreferredWidth(Int32, Int32)
at System.Windows.Forms.DataGridViewCell.OnCellDataAreaMouseEnterInternal(Int32)
at System.Windows.Forms.DataGridViewCell.OnMouseMoveInternal(System.Windows.Forms.DataGridViewCellMouseEventArgs)
at System.Windows.Forms.DataGridView.OnCellMouseMove(System.Windows.Forms.DataGridViewCellMouseEventArgs)
at System.Windows.Forms.DataGridView.UpdateMouseEnteredCell(HitTestInfo, System.Windows.Forms.MouseEventArgs)
at System.Windows.Forms.DataGridView.OnMouseMove(System.Windows.Forms.MouseEventArgs)
at System.Windows.Forms.Control.WmMouseMove(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.DataGridView.WndProc(System.Windows.Forms.Message ByRef)
at Microsoft.SqlServer.Management.DataTools.UI.QueryResult.DTDataGridView.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

"CreateRiaClientFilesTask" task failed unexpectedly

This error has started occuring when attempting to build my VS 2010 Silverlight project after some minor changes to my RIA domain services, which are hosted within the Silverlight website application. There appears to be no reason for this error and I cannot understand the access denied part of the error.
Things I have tried:
1) Full clean of all projects in the solution and re-build
2) Deletion of all temporary ASP.Net files from the framework folder
3) Removal of linked RIA services from project properties from the class library that is failing, clean, re-build and then re-add linked RIA services
Any advice on where to go from here would be much appreciated:
Error 21 The "CreateRiaClientFilesTask" task failed unexpectedly.
System.Web.HttpException (0x80004005): Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.Configuration.ConfigurationErrorsException: Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. ---> System.IO.FileLoadException: Could not load file or assembly 'Business' or one of its dependencies. Access is denied.
--- End of inner exception stack trace ---
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.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.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
at System.Web.Compilation.BuildManager.CallPreStartInitMethods()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
at System.Web.Compilation.ClientBuildManager.EnsureHostCreated()
at System.Web.Compilation.ClientBuildManager.CreateObject(Type type, Boolean failIfExists)
at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.CreateSharedTypeService(ClientBuildManager clientBuildManager, IEnumerable`1 serverAssemblies, ILogger logger)
at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.GenerateClientProxies()
at Microsoft.ServiceModel.DomainServices.Tools.CreateRiaClientFilesTask.ExecuteInternal()
at Microsoft.ServiceModel.DomainServices.Tools.RiaClientFilesTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) Insurer.Analytics.Common
Just had the same problem - turns out that something changed the permissions on the "Temporary ASP.NET Files" folder. It's easy to test. Click the ASP.Net Configuration in solution explorer for the .web project. It'll likely throw an access denied error and point you to the temp asp.net files folder. If so, open web.config in your .web project and add a tempDirectory directive to compilation, like so:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" tempDirectory="C:\<SomeDirectoryYouFullyControl>\Temporary ASP.Net Files" />
</system.web>
Rebuild your .web project and update your service reference in your silverlight project.
In my case Debug build was working, but Release wasn't.
Actual problem was that for highlighted problem-project it had x64 in Mixed Platforms Platform
instead of Any CPU
I spent like 2.5 hours on this so hope it helps to someone
I had a similar issue. My web app had an issue with the OutputPath. I fixed it by going to the project Properties -> Build -> OutputPath and changing the OutputPath of my project from "bin\Debug\" back to the default "bin\".
Open your bin folder and delete anything that is left inside.Rebuild your project -- that's what worked for me.My build configs were all set to Debug ,any CPU.
I had this error, tried many solutions and dind't seem to get fixed, until I manually erased all files from my local mapping folder and downloaded them again, restarted the computer and finally compiled!

Resources