Microsoft.FxCop.Sdk.InvalidMetadataException - fxcop

<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.

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 ...

Visual basic with external .ocx control => access violation

I'm new to this site and I'm going to start immediately with a question.
Currently I'm working on a thesis but I'm a stuck at this moment. I've been asked to control an IP-camera via Beckhoff Twincat3. As this is based on visual studio, I thought it might be a good idea to start in visual basic to test and debug everything I code. Everything I do results in AccessViolation.
System.AccessViolationException was unhandled
HResult=-2147467261
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=mscorlib
StackTrace:
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at RASplus_WatSearLib._DRASplus_WatSear.setCameraMap(Int16 nCamNum, Int16 postKey, String szSiteName, String szAddr, Int16 nHostCam, String szUser, String szPasswd, Int16 port, Boolean mode, Boolean bUseModem, Boolean useDvrns, String szDvrnsAddr, Int16 dvrnsPort, Int16 audioPort)
at AxRASplus_WatSearLib.AxRASplus_WatSear.setCameraMap(Int16 nCamNum, Int16 postKey, String szSiteName, String szAddr, Int16 nHostCam, String szUser, String szPasswd, Int16 port, Boolean mode, Boolean bUseModem, Boolean useDvrns, String szDvrnsAddr, Int16 dvrnsPort, Int16 audioPort)
at activex_camera.Form1.Button1_Click(Object sender, EventArgs e) in C:\Users\BECKHOFF stage\documents\visual studio 2010\Projects\activex camera\activex camera\Form1.vb:line 41
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at activex_camera.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I'm currently trying to connect with the camera and it results each time in a AccessViolation.
myCam.setCameraMap(i, CShort(0), "10.199.217.144", "10.199.217.144", i, "admin", "", CShort(8016), False, False, False, "dvrnames.net", 10088, 8116)
I hope someone can get me back on track. If .ocx or other files needed, please do not hesitate to contact me.
I asked my teacher if he knew what was wrong and he came up with this :
In the program, I was working with an 'instance' of the activex-control. This resulted in a accessviolation. He fixed it by using the direct control.
After all it made sense. ;)
Sincerely
GiovanniVanAssche

Debugging a crash

I am normally pretty good about debugging errors based on the exception message, but this one has me stumped. Can someone take a look and give me some advise? The application works on 9 out of 10 computers. 1 computer I have loaded it on gives this error, all other work fine. Systems are the same to my knowledge.
Application crashes when clicking the 'GO' button, when doing that, it attaches itself to Outlook and sends an email.
Error:
> ************** Exception Text **************
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).
at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at SickPrinter.Form1.Go_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thanks in advance

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

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/

XAML Designer Crashes in Visual Studio 2012

When I load up a XAML file in the designer I get the below exception and then I have to kill VS 2012 from the process manager. Any ideas on work arounds?
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Object reference not set to an instance of an object.
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostTextBufferSynchronizer.get_IsReadOnly()
at Microsoft.Expression.DesignHost.DesignerTextBufferSynchronizer.get_IsReadOnly()
at Microsoft.Expression.DesignHost.DesignerTextBuffer.get_IsReadOnly()
at Microsoft.Expression.DesignSurface.Documents.TextBuffer.get_IsReadOnly()
at Microsoft.Expression.DesignSurface.Documents.SceneDocument.get_IsReadOnly()
at Microsoft.Expression.DesignSurface.Documents.SceneDocument.get_IsUndoTargetReadOnly()
at Microsoft.Expression.DesignSurface.Selection.SelectionSet`2.SetSelectionWithUndo(String description, ListOfT newSelection, T newPrimarySelection)
at Microsoft.Expression.DesignSurface.Selection.SceneNodeSelectionSet.SetSelectionWithUndo(String description, SceneNodeOrderedCollection newSelection, SceneNode newPrimarySelection)
at Microsoft.Expression.DesignSurface.Selection.SelectionSet`2.ExtendSelection(T selectionToExtend)
at Microsoft.Expression.DesignSurface.ViewModel.SceneViewModel.SelectNodes(ICollection`1 nodes)
at Microsoft.Expression.DesignSurface.View.SceneView.SelectionSynchronizer.OnCaretPositionChangedTimeoutTimerTick(TextEditorContext textEditor)
at Microsoft.Expression.DesignSurface.View.SceneView.SelectionSynchronizer.SynchronizeSceneToMarkup(TextEditorContext textEditor)
at Microsoft.Expression.DesignSurface.View.SceneView.TextEditor_CaretPositionChanged(Object sender, EventArgs e)
at Microsoft.Expression.DesignSurface.TextEditorContext.CaretPositionChangedPipe(Object sender, EventArgs args)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalEvent`2.<>c__DisplayClass12.<Invoke>b__10()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessQueue(CallQueue queue)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessInboundQueue(Int32 identity)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.ProcessMessage(Int32 msg, IntPtr wParam, Boolean elevatedQuery, Boolean& handled)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at Microsoft.Expression.DesignHost.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.RunApplication()
at Microsoft.Expression.DesignHost.Isolation.IsolationProcess.<>c__DisplayClass2.<Main>b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Object reference not set to an instance of an object.
Server stack trace:
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostTextBufferSynchronizer.get_IsReadOnly()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
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 Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostTextBufferSynchronizer.get_IsReadOnly()
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostTextBufferSynchronizer.<get_IsReadOnly>b__8(IRemoteHostTextBufferSynchronizer hs)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteException
Object reference not set to an instance of an object.
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostTextBufferSynchronizer.<get_IsReadOnly>b__7()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
I know this one is a bit old but I had a similar problem in VS2013, found a clue from an MSDN article and checked the event viewer for exceptions, look for XDesProc.exe.
The problem was an out of date driver for my graphics card.
Once that was updated all started working again
It might help someone