Project: Abp 7.0 MVC EF Core
I am getting the following error "System.ArgumentException: 'Keyword not supported: 'datasource'.'" with the first migration and seed of the DbMigrator project by following the guide for creating the first project at the link:https://abp.io/get-started
I also attach the screenshot of the error and my connection string.
I hope someone can help me thanks.
{
"App": {
"SelfUrl": "https://localhost:44333"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=True"
},
"StringEncryption": {
"DefaultPassPhrase": "WK92PI2AFTDsZUoI"
}
}
Error
System.ArgumentException
HResult=0x80070057
Messaggio=Keyword not supported: 'datasource'.
Origine=Microsoft.Data.SqlClient
Analisi dello stack:
in Microsoft.Data.Common.DbConnectionOptions.ParseInternal(Dictionary`2 parsetable, String connectionString, Boolean buildChain, Dictionary`2 synonyms, Boolean firstKey)
in Microsoft.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary`2 synonyms)
in Microsoft.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
in Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
in Microsoft.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions)
in Microsoft.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
in Microsoft.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
in Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString)
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerConnection.CreateDbConnection()
in Microsoft.EntityFrameworkCore.Storage.RelationalConnection.get_DbConnection()
in Microsoft.EntityFrameworkCore.Storage.RelationalConnection.<OpenAsync>d__66.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass20_0.<<ExistsAsync>b__0>d.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.<>c__DisplayClass20_0.<<ExistsAsync>b__0>d.MoveNext()
in Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.<ExecuteAsync>d__7`2.MoveNext()
in Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.<ExistsAsync>d__24.MoveNext()
in Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<MigrateAsync>d__15.MoveNext()
in Acme.BookStore.EntityFrameworkCore.EntityFrameworkCoreBookStoreDbSchemaMigrator.<MigrateAsync>d__2.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.EntityFrameworkCore\EntityFrameworkCore\EntityFrameworkCoreBookStoreDbSchemaMigrator.cs: riga 29
in Acme.BookStore.Data.BookStoreDbMigrationService.<MigrateDatabaseSchemaAsync>d__10.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs: riga 95
in Acme.BookStore.Data.BookStoreDbMigrationService.<MigrateAsync>d__9.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs: riga 52
in Acme.BookStore.DbMigrator.DbMigratorHostedService.<StartAsync>d__3.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.DbMigrator\DbMigratorHostedService.cs: riga 36
in Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>d__12.MoveNext()
in Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
in Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.<RunAsync>d__4.MoveNext()
in Acme.BookStore.DbMigrator.Program.<Main>d__0.MoveNext() in C:\Users\GordonGekko87\source\repos\Acme.BookStore\src\Acme.BookStore.DbMigrator\Program.cs: riga 30
I tried reinstalling Microsoft SQL Server and searching online for a solution but couldn't find it...
I tried to reproduce the issue you mentioned, but I couldn't. Can you change the connection string as I posted? "ConnectionStrings": {"Default": "Server=localhost;Database=BookStore;Trusted_Connection=True;TrustServerCertificate=true"}
If still no change, could you please follow the [documentation] (https://abp.io/get-started) again and try again?
Related
I have a C++/CLI DLL that needs to run in the context of an ASP.NET WebApi action.
The action is affected by an ActionFilter that uses log4net's LogicalThreadContext to set a property containing a request ID; this works nicely to write the request ID into the log entries.
The problem is that ASP.NET seems to be creating an appdomain when it's time to load the class from the C++/CLI dll. (I can't seem to find any documentation on how that works; I'd love to find some.) When the appdomain plumbing tries to deserialize everything, it chokes because it can't find log4net.dll (see stack trace below).
Fusion logs show that it's looking in C:\Windows\System32\inetsrv, which is incorrect... I would expect it to look in the probing path or along the %PATH% environment variable.
A few data points:
log4net.dll is available in the web app's bin directory and works fine for everything else I'm using it for.
The C++/CLI code has no dependencies on log4net.
If I comment out my calls to log4net.LogicalThreadContext.Properties[...], everything works fine.
If I copy log4net.dll from my bin folder to C:\Windows\system32\inetsrv, everything works fine.
The web.config file specifies the probing path with a <probing privatePath="bin"/> element.
My Application_Start method in global.asax.cs prepends the web app's bin directory to the %PATH% environment variable:
var currentPathEnvVar = Environment.GetEnvironmentVariable("PATH");
var binPath = Path.Combine(Server.MapPath("~") ?? String.Empty, "bin");
_log.DebugFormat("Prepending paths to PATH: [{0}]", binPath);
Environment.SetEnvironmentVariable("PATH", String.Concat(binPath, Path.PathSeparator, currentPathEnvVar));
The log shows that the %PATH% is getting prepended correctly:
2015-06-05 17:07:48,816 1 DEBUG MyNamespace.WebApiApplication (null) Prepending paths to PATH: [C:\Program Files\MyCompany\MyApp\web\bin]
So how do I get the appdomain that ASP.NET creates to look in the right place to load assemblies?
Thanks.
Here's the stack trace that gets logged when all this goes down.
2015-06-05 17:08:41,148 23 ERROR MyNamespace.MyController (null) Controller action failed
System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain.
---> System.Runtime.Serialization.SerializationException: Unable to find assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
Server stack trace:
at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
at System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain()
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm)
at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at System.AppDomain.IsDefaultAppDomain()
at <CrtImplementationDetails>.GetDefaultDomain() in f:\dd\vctools\crt\crtw32\h\minternal.h:line 367
at <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 401
at <CrtImplementationDetails>.DefaultDomain.Initialize() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 278
at <CrtImplementationDetails>.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 343
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 546
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 703
--- End of inner exception stack trace ---
at <CrtImplementationDetails>.ThrowModuleLoadException(String errorMessage, Exception innerException) in f:\dd\vctools\crt\crtw32\h\minternal.h:line 194
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* ) in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 713
at .cctor() in f:\dd\vctools\crt\crtw32\msilcrt\mstartup.cpp:line 754
--- End of inner exception stack trace ---
at MyNamespace.MyController.MyAction(String foo, Int64 bar, String baz)
This helped me to resolve similar issue:
https://blogs.msdn.microsoft.com/jorman/2007/08/31/loading-c-assemblies-in-asp-net/
Faced option 2.a and proposed solution worked fine:
protected void Application_Start(object sender, EventArgs e){
String _path = String.Concat(System.Environment.GetEnvironmentVariable("PATH"), ";",
System.AppDomain.CurrentDomain.RelativeSearchPath);
System.Environment.SetEnvironmentVariable("PATH", _path, EnvironmentVariableTarget.Process); }
So I have an app that keeps crashing out and it's not leaving any application logs. When I finally went and looked in the event viewer for that server (a server 2003 box), I found this error (The even source was ASP.NET 4.0.30319.0)
An unhandled exception occurred and the process was terminated.
Application ID: /LM/W3SVC/2053196604/Root
Process ID: 24428
Exception: System.IO.FileLoadException
Message: Could not load file or assembly
'Microsoft.Practices.EnterpriseLibrary.Validation, Version=5.0.505.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
StackTrace: Server stack trace: at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName,
ObjectHandleOnStack type) at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean
throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) at
System.RuntimeType.GetType(String typeName, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName) at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.AddValidationExtension()
at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator..ctor(IUnityContainer
container) at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.CreateDefaultContainer(IConfigurationSource
configurationSource) at
Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer.SetCurrentContainerIfNotSet()
at Microsoft.Practices.EnterpriseLibrary.Logging.Logger.get_Writer()
at Apriva.WebApi.Shared.Logging.DefaultLogWriter.Log(Object message,
TraceEventType severity, LogEntry& entry, String category, HttpContext
context) at
Apriva.WebApi.Shared.Logging.DefaultLogWriter.Info(Object message,
String category, HttpContext context) at
System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr
md, Object[] args, Object server, Int32 methodPtr, Boolean
fExecuteInContext, Object[]& outArgs) at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
msg, IMessageSink replySink)
Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message
reqMsg, Boolean bProxyCase) at
System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed,
MessageData& msgData) at
Apriva.WebApi.Shared.Logging.Logger.LogDelegate.EndInvoke(IAsyncResult
result) at
Apriva.WebApi.Shared.Logging.Logger.LogAsyncComplete(IAsyncResult ar)
at
System.Runtime.Remoting.Messaging.AsyncResult.SyncProcessMessage(IMessage
msg) at
System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage
msg, IMessageSink replySink) at
System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.DoAsyncCall()
at
System.Runtime.Remoting.Proxies.AgileAsyncWorkerItem.ThreadPoolCallBack(Object
o) at
System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object
state) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx) at
System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch() at
System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
For more information, see Help and Support Center at
When I check the processes in the task manager, this PID isn't present. I figure it's because it is a w3wp process. So I go to command prompt and run iisapp.vbs and it returns a single process with a different PID.
The error seems to imply that there is a config reference to a different version of the enterprise library for validation when the version that was found was v5.0.505.0 and while my projects have plenty of references to the enterprise library, none refer to the validation package.
So my question is -- does anyone have any insight into where I should look next? I was trying to use the PID to at least see which application was causing the error, but that doesn't seem to be getting me anywhere.
Analysis:
From stack trace its clear that reference chain is:
Apriva.WebApi.Shared.Logging.DefaultLogWriter => Microsoft.Practices.EnterpriseLibrary.Logging.Logger => Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer => Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator.
Method "AddValidationExtension" of type Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.Unity.UnityContainerConfigurator needs type from 'Microsoft.Practices.EnterpriseLibrary.Validation assembly with signature
Possible steps find out root cause:
Open solution in visual studio.
Go to Edit Menu-> Find and Replace->Find in Files
Search for Microsoft.Practices.EnterpriseLibrary.Validation with Find options->Look at these file types -> *.csproj You will get list of project referencing this assembly.
Open all those project files in notepad and find out which one has different assembly signature than Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
Most probably you should get culprit with above steps.
I will also recommend to check assembly cache and check signature of Microsoft.Practices.EnterpriseLibrary.Validation assembly and if it matches Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
I am creating Costume DNN Module but I have "General Exception" happening recently. just want to ask if anyone get this error " General Exception" and how to fix it
AssemblyVersion: 7.0.5
PortalID: -1
PortalName:
UserID: -1
UserName:
ActiveTabID: -1
ActiveTabName:
RawURL:
AbsoluteURL:
AbsoluteURLReferrer:
UserAgent:
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID: 19286ea9-9154-4453-93d3-f58e3e143f64
InnerException: Error Creating BusinessControllerClass 'DotNetNuke.Modules.ResourceModule.Components.FeatureController' of module(ResourceModule) id=(637) in tab(144) and portal(0)
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Activator.CreateInstance
StackTrace:
Message: System.Exception: Error Creating BusinessControllerClass 'DotNetNuke.Modules.ResourceModule.Components.FeatureController' of module(ResourceModule) id=(637) in tab(144) and portal(0) ---> System.ArgumentNullException: Value cannot be null. Parameter name: type at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at DotNetNuke.Services.Search.ModuleIndexer.GetModuleList(Int32 PortalID) --- End of inner exception stack trace --- at DotNetNuke.Services.Search.ModuleIndexer.GetModuleList(Int32 PortalID)
Source:
Server Name:
That is an easy one, fixed in the next Template release. https://christoctemplate.codeplex.com/discussions/440995
Basically, update your .DNN file to include the proper namespace for your BusinessController class, I left a hardcoded one in there by mistake in one of the templates.
I'm seeing this error a lot in my log lately on my prod. I've searched over the net on this error. I saw some notes like this, this or this. The bottom line on all of them is that I should set machineKey. But I already have machineKey set!
Like that:
<machineKey decryption="AES"
validation="SHA1"
decryptionKey="64 hex key"
validationKey="other 64 hex key"/>
Also I'm on web farm server and my application is on asp.net 3.5.
I'm pretty hopeless about this problem =\ How can I solve this?
Thanks.
EDIT:
Here is a full log:
Time: 04/07/2011 19:52:25
MESSAGE: Padding is invalid and cannot be removed.
HTTP_REFERER:
SOURCE: mscorlib
FORM:
QUERYSTRING: d=iAY45pNWTDkOra20F86mL9NBCe-wjxevTFjlNNxafjqLF0Aug2JmvB-c_8JQN4XnDIU1UJTmY2MC1xuySMKscg2&t=633851453303086250
TARGETSITE: Int32 DecryptData(Byte[], Int32, Int32, Byte[] ByRef, Int32, System.Security.Cryptography.PaddingMode, Boolean)
STACKTRACE: at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
A recent ASP.Net patch changed the encryption format.
Make sure that every server in the farm is fully updated.
I get the following error intermitantly from the live website I develop (say twice a month).
From the stack trace, it seems to be internal to the AJAX control toolkit.
Error Message: Invalid object passed in, member name expected. (1): {"ActiveTabIndex":0,"TabState":[true,true,true,true]}
I have found once other person who has got the exact same error http://objectmix.com/software-testing/356582-microsoft-visual-studio-team-edition-software-tester-web-test.html
Its not a big issue but I'm interested to know what is causing it. Detailed stack trace is
Error Message: Invalid object passed in, member name expected. (1): {"ActiveTabIndex":0,"TabState":[true,true,true,true]}
Stack Trace: at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeDictionary(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at System.Web.Script.Serialization.JavaScriptSerializer.DeserializeObject(String input)
at AjaxControlToolkit.TabContainer.LoadClientState(String clientState) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\Tabs\TabContainer.cs:line 346
at AjaxControlToolkit.ScriptControlBase.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 314
at AjaxControlToolkit.TabContainer.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\Tabs\TabContainer.cs:line 447
at AjaxControlToolkit.ScriptControlBase.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) in C:\Program Files\Microsoft ASP.NET\AJAX Control Toolkit 3.0\AjaxControlToolkit\ExtenderBase\ScriptControlBase.cs:line 425
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)