EPiServer-error, Dynamic Data Store 6.2.267.1 can only be used with database version 6204, current version is 6001 - sql

I have upgraded a database from EPiServer 5 to 6 R2.
Current database-version is '6103' according to a script run in Microsoft SQL Server Management Studio. However when I try to access the website I get the following error ('current version is 6001'):
Previously a copy of the same database has run successfully with the same website (same web.config and the other files the same (the only difference is the database of the connectionstring).
Dynamic Data Store 6.2.267.1 can only be used with database version 6204, current version is 6001. Make sure both database and assemblies are upgraded correctly.
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: Dynamic Data Store 6.2.267.1 can only be used with database version 6204, current version is 6001. Make sure both database and assemblies are upgraded correctly.
Source Error:
[No relevant source lines]
Source File: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\87acb86c\7104e381\App_global.asax.j09cuuvu.0.cs Line: 0
Stack Trace:
[InvalidOperationException: Dynamic Data Store 6.2.267.1 can only be used with database version 6204, current version is 6001. Make sure both database and assemblies are upgraded correctly.]
EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.ValidateVersion() +427
EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.get_Connection() +36
EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.CreateCommand() +16
EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.ValidateVersion() +75
EPiServer.Data.Dynamic.Providers.DbDataStoreProvider.Initialize(String name, NameValueCollection config) +564
EPiServer.Data.Dynamic.Providers.DataStoreProvider.CreateInstance(ProviderSettings providerSettings) +198
EPiServer.Data.Dynamic.Providers.DataStoreProvider.CreateInstance() +145
EPiServer.Data.Dynamic.<>c__DisplayClass1.<InternalGet>b__0() +11
EPiServer.Data.Cache.LocalCache`2.Add(TKey key, Boolean cacheNullValues, Boolean overwriteExistingValue, Func`1 action) +140
EPiServer.Data.Cache.ReplicatedCache`1.Add(String key, Boolean cacheNullValues, Boolean overwriteExistingValue, Func`1 action, Boolean broadcast) +28
EPiServer.Data.Dynamic.StoreDefinition.InternalGet(String storeName) +172
EPiServer.Data.Dynamic.EPiServerDynamicDataStoreFactory.CreateStore(String storeName, Type type, StoreDefinitionParameters parameters) +110
EPiServer.Data.Dynamic.EPiServerDynamicDataStoreFactory.CreateStore(Type type) +35
EPiServer.Web.InitializationModule.InitializeDynamicDataStore() +169
EPiServer.Web.InitializationModule.<Initialize>b__1a() +5
EPiServer.Web.InitializeEngine.Initialize() +235
EPiServer.Web.InitializationModule.Initialize(EPiServerSection config, Settings settings, ConnectionStringSettingsCollection connectionStringSettings) +2832
EPiServer.Web.InitializationModule.<StaticInitialization>b__4() +34
EPiServer.Web.InitializeEngine.Initialize() +235
EPiServer.Web.InitializationModule.StaticInitialization() +1490
EPiServer.Web.InitializationModule.Initialize(InitializationEngine context) +47
EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +343
EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +83
EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +163
EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +68
EPiServer.Global..ctor() +54
ASP.global_asax..ctor() in c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\87acb86c\7104e381\App_global.asax.j09cuuvu.0.cs:0
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
System.Activator.CreateInstance(Type type, Boolean nonPublic) +69
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1136
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +23
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +60
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +227
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
How do I resolve this?

Sounds like you have had a mix of hotfixed and non-hotfixed 6 R2 environments.
You need to run the SchemaUpdate.sql script for the database giving the error message you posted.
More info here:
http://world.episerver.com/Blogs/Shahid-Nawaz/Dates/2012/1/General-Hotfix-CMS-6-R2/

Related

How do you resolve ODATA returning an open bracket of array and 'StatusCode could not be set' error

I am working on a .NET ODATA API that exposes data from SQL Views and is consumed by a 'Salesforce Connect' Connector.
If I execute a query with an ODATA filter applied my query works fine but when I test some filters i get the following output:
Please note the 'open bracket response'. The response is 200 so I get an OK. But in my .NET logging I see the following error in my console:
fail: BARCO.ODataApi.Api.Web.AppExceptionHandlerMiddleware[0]
Request resulted in SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite, String method)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.InitializeReader(Enumerator enumerator)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.<>c.<MoveNext>b__19_0(DbContext _, Enumerator enumerator)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.Enumerator.MoveNext()
at Microsoft.AspNetCore.OData.Formatter.Serialization.ODataResourceSetSerializer.WriteResourceSetAsync(IEnumerable enumerable, IEdmTypeReference resourceSetType, ODataWriter writer, ODataSerializerContext writeContext)
at Microsoft.AspNetCore.OData.Formatter.Serialization.ODataResourceSetSerializer.WriteObjectInlineAsync(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext)
at Microsoft.AspNetCore.OData.Formatter.Serialization.ODataResourceSetSerializer.WriteObjectAsync(Object graph, Type type, ODataMessageWriter messageWriter, ODataSerializerContext writeContext)
at Microsoft.AspNetCore.OData.Formatter.ODataOutputFormatterHelper.WriteToStreamAsync(Type type, Object value, IEdmModel model, ODataVersion version, Uri baseAddress, MediaTypeHeaderValue contentType, HttpRequest request, IHeaderDictionary requestHeaders, IODataSerializerProvider serializerProvider)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultAsync>g__Logged|22_0(ResourceInvoker invoker, IActionResult result)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at BARCO.ODataApi.Api.Web.UnitOfWorkMiddleware.Invoke(HttpContext context) in C:\Github\BARCO\BarcoODataApi\BarcoODataApi\src\BARCO.ODataApi.Api\Web\UnitOfWorkMiddleWare.cs:line 46
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at BARCO.ODataApi.Api.Web.ClientConfigurationMiddleware.Invoke(HttpContext context) in C:\Github\BARCO\BarcoODataApi\BarcoODataApi\src\BARCO.ODataApi.Api\Web\ClientConfigurationMiddleware.cs:line 66
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at BARCO.ODataApi.Api.Web.AppExceptionHandlerMiddleware.Invoke(HttpContext context) in C:\Github\BARCO\BarcoODataApi\BarcoODataApi\src\BARCO.ODataApi.Api\Web\AppExceptionHandlerMiddleware.cs:line 37
ClientConnectionId:6b3c22ec-a535-4e66-99df-0cf41053a3f9
Error Number:-2,State:0,Class:11
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HMFRFUHVRJMQ", Request id "0HMFRFUHVRJMQ:00000002": An unhandled exception was thrown by the application.
System.InvalidOperationException: StatusCode cannot be set because the response has already started.
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.set_StatusCode(Int32 value)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
at Microsoft.AspNetCore.Http.DefaultHttpResponse.set_StatusCode(Int32 value)
at BARCO.ODataApi.Api.Web.AppExceptionHandlerMiddleware.SetResponseExceptionStatusCode(HttpContext context, Exception exception) in C:\Github\BARCO\BarcoODataApi\BarcoODataApi\src\BARCO.ODataApi.Api\Web\AppExceptionHandlerMiddleware.cs:line 101
at BARCO.ODataApi.Api.Web.AppExceptionHandlerMiddleware.Invoke(HttpContext context) in C:\Github\BARCO\BarcoODataApi\BarcoODataApi\src\BARCO.ODataApi.Api\Web\AppExceptionHandlerMiddleware.cs:line 47
at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Is there a way to provide more detailed logging so I can understand what exactly is going wrong in my application or where the error is? Since receiving a response of "value":"[" is really weird and I have never seen this kind of response. I searched online already but there does not seem to be any questions out there with the same issue concerning this response.
One of my first questions i posted so please let me know if there is a need for additional information on my question.
Thanks in advance!
EDIT:
Salesforce Connect Backend Query translation:
SELECT TOP(#__TypedProperty_2) ...
FROM ... AS [v]
WHERE CASE
WHEN ( #__TypedProperty_0 LIKE N'' )
OR ( Charindex(#__TypedProperty_0, [v].[assetid]) > 0 ) THEN
Cast(1 AS BIT)
ELSE Cast(0 AS BIT)
END = #__TypedProperty_1
ORDER BY ...

How to avoid IE Navigation error which says the RPC server is unavailable?

I have a service which is installed on my server. It suddenly stops with the following error log:
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.VisualBasic.CompilerServices.VBBinder.InvokeMember(String name, BindingFlags invokeAttr, Type objType, IReflect objIReflect, Object target, Object[] args, String[] namedParameters)
at Microsoft.VisualBasic.CompilerServices.LateBinding.InternalLateCall(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack, Boolean IgnoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at vbIranStock.VBNetLib.vbScript4.Parsing(Object& objIE, Object& MainHTML, String[]& logid, String& logpath, String& Servicepath, Boolean& doPrint) in vbScript4.vb:line 119
at vbIranStock.VBNetLib.vbScript4.VbsRun4(Boolean doPrint) in vbScript4.vb:line 50
at WindowsServiceVB.Service1.MyProgram() in Service1.vb:line 106
at WindowsServiceVB.Service1.ScheduleService() in Service1.vb:line 73
When I refer to the specified Visual Basic code line, I see following codes:
119: objIE.Navigate("https://www.example.ir" + lblUrl)
I checked following RPC related services which all are running and are not stopped:
Remote Process Call
Remote Process Call Locator
DeCom Server Process Launcher
RPC Endpoint Mapper
Remote Access Connection Manager
Remote Access Auto Connection Manager
Remote Registry
Besides I checked firewall and added inbound and outbound rules to allow my service connection.
But again I have this error. Please help me to stop getting the error.

Microsoft.FxCop.Sdk.InvalidMetadataException

<FxCopReport Version="10.0">
<Exceptions>
<Exception Keyword="CA0001" Kind="Engine">
<Type>Microsoft.FxCop.Sdk.InvalidMetadataException </Type>
<ExceptionMessage>
The following error was encountered while reading module 'myproject': Method type parameter in position 0 is not valid.
</ExceptionMessage>
<StackTrace>
at Microsoft.FxCop.Sdk.Reader.HandleError(ModuleNode mod, String errorMessage) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseTypeList(MemoryCursor sigReader) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseTypeList(MemoryCursor sigReader) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseParameterTypes(TypeNodeCollection& varArgTypes, MemoryCursor sigReader, Int32 paramCount, Boolean& genericParameterEncountered) at Microsoft.FxCop.Sdk.Reader.GetMemberFromRef(Int32 i, TypeNodeCollection& varArgTypes, Int32 numGenericArgs) at Microsoft.FxCop.Sdk.Reader.GetMethodDefOrRef(Int32 codedIndex, Int32 numberOfGenericArguments) at Microsoft.FxCop.Sdk.Reader.GetMethodFromSpec(Int32 i) at Microsoft.FxCop.Sdk.Reader.GetMemberFromToken(Int32 tok, TypeNodeCollection& varArgTypes) at Microsoft.FxCop.Sdk.InstructionParser.ParseInstruction() at Microsoft.FxCop.Sdk.InstructionParser.ParseInstructions() at Microsoft.FxCop.Sdk.Reader.ParseMethodInstructions(Method method, Int32 methodIndex, Int32 RVA) at Microsoft.FxCop.Sdk.Reader.GetMethodInstructions(Method method, Object i) at Microsoft.FxCop.Sdk.Reader.GetMethodBody(Method method, Object i, Boolean asInstructionList) at Microsoft.FxCop.Sdk.Method.get_Instructions() at Microsoft.FxCop.Sdk.RuleUtilities.HasImperativeSecurityAction(Method method, SecurityAction action) at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction action) at Microsoft.FxCop.Sdk.RuleUtilities.HasSecurityAction(Method method, SecurityAction[] actions) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.RecordCallSites(Method caller) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitMember(Member member, TargetMember target) at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes) at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitType(TypeNode type, TargetType target) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitType(TypeNode type, TargetType target) at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitTypes(TypeNodeCollection types, TargetNamespaceDictionary targets) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitModule(ModuleNode module, TargetModule target) at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.VisitAssembly(AssemblyNode assembly, TargetFile target) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.Load(TargetFile target, Boolean buildTree, Boolean queueItems, AssemblyNode loadedAssembly) at Microsoft.FxCop.Engines.Introspection.LoadVisitor.LoadAssemblies(Queue queue, ExceptionCollection exceptions)
</StackTrace>
</Exception>
<Exception Keyword="CA0001" Kind="Engine">
<Type>Microsoft.FxCop.Sdk.FxCopException </Type>
<ExceptionMessage>
An unhandled exception occurred while analyzing assemblies:
</ExceptionMessage>
<InnerType>Microsoft.FxCop.Sdk.InvalidMetadataException </InnerType>
<InnerExceptionMessage>
The following error was encountered while reading module 'myproject': Method type parameter in position 0 is not valid.
</InnerExceptionMessage>
<InnerStackTrace>
at Microsoft.FxCop.Sdk.Reader.HandleError(ModuleNode mod, String errorMessage) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseTypeList(MemoryCursor sigReader) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseTypeList(MemoryCursor sigReader) at Microsoft.FxCop.Sdk.Reader.ParseTypeSignature(MemoryCursor sigReader, Boolean& pinned, Boolean& isTypeArgument) at Microsoft.FxCop.Sdk.Reader.ParseParameterTypes(TypeNodeCollection& varArgTypes, MemoryCursor sigReader, Int32 paramCount, Boolean& genericParameterEncountered) at Microsoft.FxCop.Sdk.Reader.GetMemberFromRef(Int32 i, TypeNodeCollection& varArgTypes, Int32 numGenericArgs) at Microsoft.FxCop.Sdk.Reader.GetMethodDefOrRef(Int32 codedIndex, Int32 numberOfGenericArguments) at Microsoft.FxCop.Sdk.Reader.GetMethodFromSpec(Int32 i) at Microsoft.FxCop.Sdk.Reader.GetMemberFromToken(Int32 tok, TypeNodeCollection& varArgTypes) at Microsoft.FxCop.Sdk.InstructionParser.ParseInstruction() at Microsoft.FxCop.Sdk.InstructionParser.ParseInstructions() at Microsoft.FxCop.Sdk.Reader.ParseMethodInstructions(Method method, Int32 methodIndex, Int32 RVA) at Microsoft.FxCop.Sdk.Reader.GetMethodInstructions(Method method, Object i) at Microsoft.FxCop.Sdk.Reader.GetMethodBody(Method method, Object i, Boolean asInstructionList) at Microsoft.FxCop.Sdk.Method.get_Instructions() at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.UpdateSourceContext(SourceContext& sourceContext, Method method) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.LogProblems(Method method, TargetMember target, Rule rule, ProblemCollection problems) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.LogProblems(Member member, TargetMember target, Rule rule, ProblemCollection problems) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.CheckMember(Member memberToAnalyze, Member member, TargetMember target) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.VisitMember(Member member, TargetMember target) at Microsoft.FxCop.Engines.Introspection.BaseVisitor.VisitMembers(MemberCollection members, TargetMemberDictionary targets, Boolean visitNestedTypes) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.VisitType(TypeNode type, TargetType target) at Microsoft.FxCop.Engines.Introspection.AnalysisVisitor.Analyze(Queue queue) at Microsoft.FxCop.Engines.Introspection.IntrospectionAnalysisEngine.AnalyzeThread()
</InnerStackTrace>
</Exception>
</Exceptions>
</FxCopReport>
I got the following errors when running fxcop code analysis, anyone seen these before, i am not sure why it's telling "Method type parameter in position 0 is not valid"?
Are you using Code Contracts or PostSharp or some other post-compilation step that fiddles with the IL?
I've just started getting this - in my case, it went away when I changed the Code Contract's Runtime Checks from "Full" to "Pre and Post", so it looks like something dodgy in ccrewrite.exe.

Add regex to password complexity in Sitecore 8

The requirement is to require users to have complex passwords requiring minimum length of 8 characters. 1+ non alpha numeric character. 1+ lowercase alpha character. 1+ uppercase alpha character. 1+ number.
I can accomplish this by adding the following to the web.config
<add name="sql" type="System.Web.Security.SqlMembershipProvider" connectionStringName="core" applicationName="sitecore" minRequiredPasswordLength="8" minRequiredNonalphanumericCharacters="1" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" passwordStrengthRegularExpression="(?=.{8,})(?=.*[\d])(?=.*[a-z])(?=.*[A-Z]).*" />
passwordStrengthRegularExpression validation seems to not be handled by Sitecore as I get the following unhandled exception when an invalid password is entered:
376 15:59:41 ERROR Application error.
Exception: System.Web.HttpUnhandledException
Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.
Source: System.Web
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Nested Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Web.UI.XamlSharp.Xaml.XamlControl.ExecuteAjaxMethod(AjaxMethodEventArgs e)
at Sitecore.Web.UI.WebControls.AjaxScriptManager.DispatchMethod(Control control, String parameters)
at Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline)
at Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic)
at Sitecore.Web.UI.WebControls.ContinuationManager.RunPipelines()
at Sitecore.Web.UI.WebControls.ContinuationManager.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Nested Exception
Exception: System.ArgumentException
Message: The parameter 'newPassword' does not match the regular expression specified in config file.
Source: System.Web
at System.Web.Security.SqlMembershipProvider.ChangePassword(String username, String oldPassword, String newPassword)
at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover)
at Sitecore.Security.SitecoreMembershipProvider.ChangePassword(String username, String oldPassword, String newPassword)
at Sitecore.Security.Accounts.MembershipUserWrapper.ChangePassword(String oldPassword, String newPassword)
at Sitecore.Shell.Applications.Security.SetPassword.SetPasswordPage.OK_Click()
Can this be accomplished by modifying config values or is this something that can easily be accomplished by patching the <loggingin> pipeline?
Looking at the code for the SitecoreMembershipProvider there is a wrapper property for PasswordStrengthRegularExpession and the material methods just hand off processing to the underlying provider, in this case the SqlMembershipProvider. So the error is actually being generated there, as you see from the stack trace.
The exception is actually an expected behaviour for this method according to the MSDN documentation. In your application's login/change password/new user forms you should validate a user's entry against Membership.PasswordStrengthRegularExpression manually to ensure the complexity requirement is met before passing the new value back to Sitecore.
It's hard to tell from your question, but does this cover your case, or are you referring to an error being generated in the Sitecore Change Password dialog (haven't tried that)? If that's the case I would raise a support ticket, as the system really should gracefully cope with that situation. Notwithstanding the documentation eluded to by Nikola (#nsgocev) it seems that at least the author of the Sitecore wrapper did implement at least rudimentary wrappers for this property.

Intermitant DefinitionInvalidException with windows forms ReportViewer 2008

I've got some RDL using it in a (windows forms) .net 2.0 app.
When user clicks around in app, rdl is reloaded into report viewer.
For the same RDL I sometimes get the error, sometimes not.
When I run my app debugging in Visual Studio it never gets the error.
Immediately after running, I launch the exe from the bin folder and now I get errors (but only 50% of the time the report gets refreshed)
The Exception occurs when I call ReportViewer.RefreshReport
I've looked through the RDL at every place where there is a minOccurs and they are all either "0" or "1".
Interestingly if I call Application.DoEvents() immediately before I call RefreshReport I can but the amount of time the error happens down to 5%... but it still occasionally happens!
The definition of the report 'Main Report' is invalid.
, An unexpected error occurred in Report Processing.
, The value for the 'minOccurs' attribute is invalid - The value for the 'minOccurs' attribute must be xsd:nonNegativeInteger..
(DefinitionInvalidException)
Stack Trace:
Microsoft.Reporting.DefinitionInvalidException: The definition of the report 'Main Report' is invalid. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.Xml.Schema.XmlSchemaException: The value for the 'minOccurs' attribute is invalid - The value for the 'minOccurs' attribute must be xsd:nonNegativeInteger..
at System.Xml.Schema.XmlSchema.Read(XmlReader reader, ValidationEventHandler validationEventHandler)
at System.Xml.Schema.XmlSchema.Read(Stream stream, ValidationEventHandler validationEventHandler)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.RmlValidatingReader..ctor(XmlTextReader textReader, PublishingErrorContext errorContext, String targetRDLNamespace)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.RmlValidatingReader.CreateReader(XmlTextReader upgradedRDLReader, PublishingErrorContext errorContext, String targetRDLNamespace)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.Phase1(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, String& description, String& language, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportPublishing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] definition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileReport(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, PublishingErrorContext errorContext, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks)
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
--- End of inner exception stack trace ---
at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(CatalogItemContext reportContext, Byte[] reportDefinition, CreateReportChunk createChunkCallback, CheckSharedDataSource checkDataSourceCallback, AppDomain compilationTempAppDomain, Boolean generateExpressionHostWithRefusedPermissions)
at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
--- End of inner exception stack trace ---
at Microsoft.Reporting.ReportCompiler.CompileReport(CatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.StandalonePreviewStore.StoredReport.CompileReport()
at Microsoft.Reporting.StandalonePreviewStore.StoredReport.get_Snapshot()
at Microsoft.Reporting.StandalonePreviewStore.GetCompiledReport(CatalogItemContext context, Boolean rebuild, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.LocalService.GetCompiledReport(CatalogItemContext itemContext, Boolean rebuild, ReportSnapshotBase& snapshot)
at Microsoft.Reporting.LocalService.CompileReport(CatalogItemContext itemContext, Boolean rebuild)
at Microsoft.Reporting.WinForms.LocalReport.CompileReport()
Instead of
ReportViewer.RefreshReport
Doing this seemed to fix it.
Application.DoEvents()
ReportViewer.LocalReport.ExecuteReportInCurrentAppDomain(Reflection.Assembly.GetExecutingAssembly().Evidence)