"The resource MultipleIdDefinition was not found" on deserialization on Windows Phone 7 - silverlight

I suddenly started getting this from my Windows Phone 7 app. I don't know what changed in the data I was deserialization that would have caused this. Any idea what it means?
System.Runtime.Serialization.SerializationException occurred
Message=The resource MultipleIdDefinition was not found in System.Runtime.Serialization
StackTrace:
at System.Runtime.Serialization.ReferencedObjectCache.Add(String id, Object referencedObject)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.AddNewObjectWithId(String id, Object obj, Boolean isReference)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.AddNewObject(Object obj, Boolean isReference)
at System.Runtime.Serialization.XmlFormatReader.InvokeBeforeDeserialization(ClassDataContract classContract, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlFormatReader.InitializeCallStack(DataContract clContract, XmlReaderDelegator xmlReaderDelegator, XmlObjectSerializerReadContext xmlObjContext, XmlDictionaryString[] memberNamesColl, XmlDictionaryString[] memberNamespacesColl)
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Int32 id, RuntimeTypeHandle declaredTypeHandle, String name, String ns)
at System.Runtime.Serialization.XmlFormatReader.InternalDeserialize(Object value, Type type, String name, String ns, XmlObjectSerializerReadContext context, XmlReaderDelegator xmlReader)
at System.Runtime.Serialization.XmlFormatReader.ReadValue(Type type, String name, String ns, XmlObjectSerializerReadContext context, XmlReaderDelegator xmlReader)
at System.Runtime.Serialization.XmlFormatReader.ReadCollectionItem(CollectionDataContract collectionContract, Type itemType, String itemName, String itemNs, XmlObjectSerializerReadContext context, XmlReaderDelegator xmlReader)
at System.Runtime.Serialization.XmlFormatReader.ReadCollectionItems(DeserializedObject desObj, CollectionDataContract collectionContract, Int32 membersRead, Int32 size)
at System.Runtime.Serialization.XmlFormatReader.ReadCollection(DeserializedObject desObj, CollectionDataContract collectionContract, Int32 membersRead)
at System.Runtime.Serialization.XmlFormatReader.Deserialize(XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlFormatReader.InitializeCallStack(DataContract clContract, XmlReaderDelegator xmlReaderDelegator, XmlObjectSerializerReadContext xmlObjContext, XmlDictionaryString[] memberNamesColl, XmlDictionaryString[] memberNamespacesColl)
at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.ReadDataContractValue(DataContract dataContract, XmlReaderDelegator reader)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, DataContract& dataContract)
at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns)
at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName)
at System.Runtime.Serialization.XmlObjectSerializer.ReadObject(XmlDictionaryReader reader)
at ...
at Microsoft.Phone.Shell.PhoneApplicationService.FireLaunching()
at Microsoft.Phone.Execution.NativeEmInterop.FireOnLaunching()

If you're not knowlingly deserializing any XML, then I can only guess that either:
the app's isolated storage contains some app-state XML (e.g. from AppSettings)
or that there's a problem with the configuration XML for your app
To try to fix this, you could:
Take a look in the Properties folder of your project - are the XML configuration files there OK? If you open them in the editor, are there any warnings or errors shown?
Uninstall the app from the emulator and/or from your phone (you can even try restarting the emulator or factory resetting the phone)
If not, post more info and we'll try to help more - interesting problem!

If you are working with WCF, this might be caused by added "IsReference=true" of the DataContract at server side.
In actual payload it will be noticeable as something like z:Id=”i7”.
If you have two versions (one working and one not working) I would recommend to debug as deep as possible so you can clearly see stuff you deserialize, and then do text comparison of two versions.

Related

Adding permission management module for customization

I have abp .Net Core Application and I have added permission module using command
abp add-module Volo.PermissionManagement --with-source-code --add-to-solution-file
then when I open application then found permission module added in solution under modules folder and solution build success but when I run application I get error in browser
HTTP Error 500.30 - ASP.NET Core app failed to start
and error in log is
System.IO.FileNotFoundException: Could not load file or assembly 'Volo.Abp.PermissionManagement.Application.Contracts, Version=5.3.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Volo.Abp.PermissionManagement.Application.Contracts, Version=5.3.0.0, Culture=neutral, PublicKeyToken=null'
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, RuntimeType type, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
at Volo.Abp.Modularity.AbpModuleHelper.FindDependedModuleTypes(Type moduleType)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.AddModuleAndDependenciesRecursively(List`1 moduleTypes, Type moduleType, ILogger logger, Int32 depth)
at Volo.Abp.Modularity.AbpModuleHelper.FindAllModuleTypes(Type startupModuleType, ILogger logger)
at Volo.Abp.Modularity.ModuleLoader.FillModules(List`1 modules, IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.Modularity.ModuleLoader.GetDescriptors(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.Modularity.ModuleLoader.LoadModules(IServiceCollection services, Type startupModuleType, PlugInSourceList plugInSources)
at Volo.Abp.AbpApplicationBase..ctor(Type startupModuleType, IServiceCollection services, Action`1 optionsAction)
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action`1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at DCC.Program.Main(String[] args)
although all projects are the same version 5.3.0
The problem in version of packages when you replace packages with code the version of resulted Dll will be different than the other Abp packages
So what you should do is to set the version in csproj for each project in your module
in your case set version to 5.3.0

Sitecore with SOLR: An index with the name "sitecore_marketingdefinitions_master" have already been added

I get this error when configuring SOLR 6.3 with Sitecore 8.1. I have done all steps from the following post, but after complete steps I get the following error:
An index with the name "sitecore_marketingdefinitions_master" have already been added.
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.InvalidOperationException: An index with the name "sitecore_marketingdefinitions_master" have already been added.
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:
[InvalidOperationException: An index with the name "sitecore_marketingdefinitions_master" have already been added.]
Sitecore.Diagnostics.Assert.IsFalse(Boolean condition, String message) +81
Sitecore.ContentSearch.ContentSearchConfiguration.AddIndex(ISearchIndex index) +185
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +128
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
Sitecore.Configuration.DefaultFactory.AssignProperties(Object obj, Object[] properties) +869
Sitecore.Configuration.DefaultFactory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper) +655
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper) +322
Sitecore.Configuration.DefaultFactory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert) +72
Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert) +619
Sitecore.ContentSearch.ContentSearchManager.get_SearchConfiguration() +262
Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.get_Cores() +92
Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +255
(Object , Object[] ) +71
Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +484
Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22
Sitecore.Nexus.Web.HttpModule.Application_Start() +259
Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +704
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +618
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +402
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +343
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +579
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +112
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +712
You might still have .Lucene. configs in your App_Config/Include folder that have not yet been disabled. Need to add .disabled to all Lucene config files.

VS2012 Winform designer error

I keep getting the error "Collection was modified; enumeration operation may not execute".
While in design mode for a winform. Project runs fine, just design time which has an issue.
This goes away after opening and closing the project X times (between 1 and 10+ so far), but always comes back at random times (even when no changes have been made to the project or any of its dependencies).
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List1.Enumerator.MoveNextRare()
at System.Collections.Generic.List1.Enumerator.MoveNext()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblySpecFound(List1 assemblies, String assemblyFullName)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AddDependencies(Assembly a, String fileName)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblySpecFound(List1 assemblies, String assemblyFullName)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AddProjectDependencies(Project project)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Boolean allowPrivate, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name, Boolean throwOnError)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.GetAssembly(AssemblyName name)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.OnAssemblyResolve(Object sender, ResolveEventArgs e)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Boolean allowPrivate, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchEntries(AssemblyName assemblyName, String typeName, Boolean ignoreCase, Assembly& assembly, ReferenceType refType)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, ReferenceType refType)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.GetType(String name)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetRuntimeType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.DesignerSerializationManager.System.ComponentModel.Design.Serialization.IDesignerSerializationManager.GetType(String typeName)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetType(IDesignerSerializationManager manager, String name, Dictionary2 names)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.FillStatementTable(IDesignerSerializationManager manager, IDictionary table, Dictionary2 names, CodeStatementCollection statements, String className)
at System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
I think this was a bug that was fixed in Visual Studio 2012 Update 4:
Windows Forms
You may receive the following error message in Windows Forms Designer:
Collection was modified; enumeration operation may not execute
Go to Download Visual Studio 2012 Update 4 to get the update.

Deserializing JSON objects to POCO objects in Silverlight

I'm trying to deserialize some JSON objects in a Silverlight client, which are sent over to the client via SignalR.
These objects have been serialized using the TypeNameHandling = TypeNameHandling.All settings.
The first problem is that you can't add a Class library project reference to the Silverlight one, so I have used the trick of creating a Silverlight Class library that contains a link to the POCO classes.
But then I get an error when deserializing, because the JSON string contains the full type including assembly (which is different). If I manipulate the JSON string and replace the assembly name, still get the same error.
These are the POCOs:
public abstract class MessageBase
{
public Exception Exception { get; set; }
}
public class AccessRCImported : MessageBase
{
public DateTime Cob { get; set; }
}
This is the JSON string:
{"$type":"CS.RAR.ICE.Common.Messages.AccessRCImported, CS.RAR.ICE","Cob":"2012-08-01T00:00:00","Exception":null}
Which has been serialized by
var output = JsonConvert.SerializeObject(message,
new JsonSerializerSettings
{TypeNameHandling = TypeNameHandling.All});
// Replace the assembly name
var result = output.Replace(", CS.RAR.ICE.Common", ", CS.RAR.ICE");
var ctx = ConnectionManager.GetHubContext<ServerHub>();
ctx.Clients.Notify(result);
Then on the Silverlight client, I'm doing
var message = JsonConvert.DeserializeObject< MessageBase>(onData, _serializerSettings);
And I get below error. Both the Silverlight app and the Silverlight Client library are targetting Silverlight 5.
Any ideas?
Thanks.
{Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'CS.RAR.ICE.Common.Messages.AccessRCImported, CS.RAR.ICE'. Path '$type', line 1, position 66. ---> System.IO.FileLoadException: Could not load file or assembly 'CS.RAR.ICE, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The requested assembly version conflicts with what is already bound in the app domain or specified in the manifest. (Exception from HRESULT: 0x80131053)
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, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, 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 Newtonsoft.Json.Serialization.DefaultSerializationBinder.GetTypeFromTypeNameKey(TypeNameKey typeNameKey)
at Newtonsoft.Json.Utilities.ThreadSafeStore2.AddValue(TKey key)
at Newtonsoft.Json.Utilities.ThreadSafeStore2.Get(TKey key)
at Newtonsoft.Json.Serialization.DefaultSerializationBinder.BindToType(String assemblyName, String typeName)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadSpecialProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
--- End of inner exception stack trace ---
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadSpecialProperties(JsonReader reader, Type& objectType, JsonContract& contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue, Object& newValue, String& id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at CS.RAR.ICE.ClientHub.Handle(String onData)}

System.ArgumentException: Keyword not supported: 'provider'

I have a working copy of asp.net mvc site locally. I just uploaded the whole site to my web hosting server. everything looks fine at first but when i login, i get the following error:
System.ArgumentException: Keyword not supported: 'provider'.
[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4907604
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +24
System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +54
[ArgumentException: An error occurred while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax.
Parameter name: connectionString]
System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +136
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +134
System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String username, Boolean updateLastLoginActivityDate, Int32& status, String& password, Int32& passwordFormat, String& passwordSalt, Int32& failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount, Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate) +815
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved, String& salt, Int32& passwordFormat) +105
System.Web.Security.SqlMembershipProvider.CheckPassword(String username, String password, Boolean updateLastLoginActivityDate, Boolean failIfNotApproved) +42
System.Web.Security.SqlMembershipProvider.ValidateUser(String username, String password) +78
SalemGolf.Controllers.AccountMembershipService.ValidateUser(String userName, String password) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:335
SalemGolf.Controllers.AccountController.ValidateLogOn(String userName, String password) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:207
SalemGolf.Controllers.AccountController.LogOn(String userName, String password, Boolean rememberMe, String returnUrl) in D:\Adam\Code\CSharp\Asp.net\SalemGolf\SalemGolf\Controllers\AccountController.cs:59
lambda_method(ExecutionScope , ControllerBase , Object[] ) +245
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
System.Web.Mvc.Controller.ExecuteCore() +123
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
any suggestions?
The value that was provided for the
connection string may be wrong, or it
may contain an invalid syntax.
My suggestion is to fix the configuration string.
This MSDN article contains all allowed keyword values within the ConnectionString for SqlConnection object. "Provider" is not in the list.
You have two options:
remove "provider" keyword;
use an OleDbConnection instead of SqlConnection.
Also When your connection string parameter "User ID" use the space, if it is written as "UserID" then also it gives error
Remove "Provider=MSDORA" from your connection string. And then this should work.
Watch for keywords in the connectionstring which NEED spaces. Like User ID is correct but UserID will fail.

Resources