Exception occurred creating type 'DevExpress.XtraEditors.CheckEdit, DevExpress.XtraEditors.v8.2, Version=8.2.8.0, Culture=neutral, PublicKeyToken=9b171c9fd64da1d1' System.TypeInitializationException: The type initializer for 'DevExpress.Utils.AppearanceObject' threw an exception. ---> System.NotSupportedException: This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LegacySecurityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information. ..\Properties\licenses.licx
Tried below configuration in app.config to resolve the issue but did not work:
`
<configuration>
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
<startup>
<supportedRuntime version="v3.5.0000"/>
<!--<supportedRuntime version="v1.0.3705"/>-->
</startup>
`
Is there any extra configuration or setup required to resolve this issue?
Tried the steps given in the link below to resolve the issue:
https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/dd409253(v=vs.100)
https://learn.microsoft.com/en-us/previous-versions/dotnet/netframework-4.0/w4atty68(v=vs.100)
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.
I have a project that contains my Entity Framework generated models and DBContext. I am attempting to reference that project from another project which has the following config file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<entityFramework>
But anytime I instantiating the context: using (var db = new DataDB()) { ... } I get the error below:
An unhandled exception of type 'System.InvalidOperationException' occurred in mscorlib.dll
Additional information: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application.See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
I also installed EF for my project. Not sure what else needs to be configured to get this working?
If anyone is looking, you probably have created your model in a separate project. You need to add references for EntityFramework and EntityFramework.SqlServer
I have a dnn website which I have configured as secure. After making it secure whenever I access secure pages of host menu, it throws error and I am unable to access host secure pages.
Please help me ASAP!
Error Details :
Method: DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings
StackTrace:
Message: System.Exception: Unhandled Error: ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings(Int32 TabId, PortalAliasInfo objPortalAliasInfo) at DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo objPortalAliasInfo) at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
Thanks,
Kusum
Try to re-install your certificate
Clear Web Browser Cache
Restart Site (add a white space to your web.config file and save)
I use Controls from Silverlight SDK and Silverlight Toolkit and I'm curious if the client has to install the packages as well?
How do I build such an application correctly to deploy it afterwards?
EDIT:
I just ask because I'm unable to get my application to run on a client running a bare SL4 runtime. It just throws the following exception:
Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei System.Windows.Application.Application_Starting(Object sender, StartupEventArgs e)
bei MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
I use the VS2010 devserver to deploy the application to the client.
The app makes use of a WCF Service I also serve by VS2010 for now, it also contains a "clientaccesspolicy.xml":
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Thanks in advance.
You don't need to install those packages on the client side,
it's will be part of your xap file,
and about the server running your Silverlight application,
Silverlight is a client technology and can be hosted on any web server. It can be any type of web server that is capable of delivering the XAP file along with the correct content MIME type from the server (application/x-silverlight-app).
As long as it does that, we don’t care what type of web server it is delivering the XAP file.