Windows Phone SDK 8.0 XAML Designer not loading - xaml

Before negative reporting, first figure out how this question is different from other designer loading problem. Look at their exceptions and mine.
Designer was working fine, I don't know what happened suddenly.
NOTE: I've tried uninstalling and re-installing. I've done with all VS12 update. Still facing designer issue.
System.NullReferenceException
Object reference not set to an instance of an object.
at Microsoft.Expression.DesignModel.Metadata.PlatformMetadataBase.GetPlatformAssemblies()
at Microsoft.Expression.SilverlightPlatform.SilverlightPlatformMetadata..ctor(IPlatformRuntimeAssemblyResolver platformRuntimeAssemblyResolver, IPlatformReferenceAssemblyResolver platformReferenceAssemblyResolver)
at Microsoft.Expression.SilverlightPlatform.SilverlightPlatform..ctor(IPlatformRuntimeAssemblyResolver platformRuntimeAssemblyResolver, IPlatformReferenceAssemblyResolver platformReferenceAssemblyResolver)
at Microsoft.Expression.WindowsPhonePlatform.MobilePlatform..ctor(IPlatformRuntimeAssemblyResolver platformRuntimeAssemblyResolver, IPlatformReferenceAssemblyResolver platformReferenceAssemblyResolver)
at Microsoft.Expression.WindowsPhonePlatform.WindowsPhonePlatformCreator.CreatePlatformInternal(IPlatformReferenceAssemblyResolver referenceAssemblyResolver)
at Microsoft.Expression.Platform.PlatformCreatorBase.CreatePlatform(IPlatformReferenceAssemblyResolver referenceAssemblyResolver)
at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()
at Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()
at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject project, IPlatform platform, Boolean create)
at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetSourceItemContext(IHostSourceItem sourceItem)
at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__f(CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.CallWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__e()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
System.NullReferenceException
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.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
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.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.<CreateDesignerImpl>b__6(IRemoteDesignerService d)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
System.NullReferenceException
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.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__11(RemoteCancellationToken remoteToken)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CallWithCancellation[TResult](CancellationToken cancelToken, Func`2 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
And I've tried uninstalling and re-installing all Silverlight SDKs. So please, some useful answers needed!

Try the suggestion here (in the same order)
1: Uninstall WP8 SDK
2: Uninstall all instances of Silverlight SDK and
Rutime.
3: Re-install WP8 SDK.
I used it in the following workflow and it fixed my designer problem:
1: Uninstalled all WP7 SDK:s
2: Restarted computer (The designer still
failed after this step)
3: Uninstalled WP8 SDK (Maybe it is enough to
choose repair here, but I selected to uninstall the SDK)
4: Restarted
computer
5: Installed the WP8 SDK

Ok the problem is solved. I just re-installed my whole Operating System and pikatch!

Related

SID of the target principal could not be resolved.

I delpoyed my web application (which uses LDAP) on windows server 2016. It is throwing below error. Though I am able to access same ADLDS instance using ADSI or C# console application (created utility to test connectivity). But not sure why its throwing error with web application. Please suggest.
Server Error in '/' Application.
**While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.**
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.DirectoryServices.AccountManagement.PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.
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:
[PrincipalOperationException: While trying to resolve a cross-store reference, the SID of the target principal could not be resolved. The error code is 1722.]
System.DirectoryServices.AccountManagement.ADStoreCtx.ResolveCrossStoreRefToPrincipal(Object o) +570
System.DirectoryServices.AccountManagement.ADUtils.DirectoryEntryAsPrincipal(DirectoryEntry de, ADStoreCtx storeCtx) +133
System.DirectoryServices.AccountManagement.ADDNLinkedAttrSet.get_CurrentAsPrincipal() +86
System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.MoveNext() +252
System.DirectoryServices.AccountManagement.PrincipalCollectionEnumerator.System.Collections.IEnumerator.MoveNext() +9
System.Linq.<SelectManyIterator>d__22`3.MoveNext() +65
System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +264
System.Linq.GroupedEnumerable`3.GetEnumerator() +72
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +63
System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) +392
System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) +15
Plastin.Common.Security.ADLDSClaimsProvider.SetApplicationClaims() +1012
Plastin.Common.Security.ADLDSClaimsProvider.Initialise() +174
Plastin.Common.Security.ADLDSClaimsProvider..cctor() +238
[TypeInitializationException: The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.]
lambda_method(Closure , IBuilderContext ) +81
Microsoft.Practices.ObjectBuilder2.<>c__DisplayClass1.<GetBuildMethod>b__0(IBuilderContext context) +35
Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context) +10
Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context) +198
Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context) +209
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +165
[ResolutionFailedException: Resolution of the dependency failed, type = "Plastin.Common.Security.IClaimsProvider", name = "(none)".
Exception occurred while: Calling constructor Plastin.Common.Security.ADLDSClaimsProvider().
Exception is: TypeInitializationException - The type initializer for 'Plastin.Common.Security.ADLDSClaimsProvider' threw an exception.
-----------------------------------------------
At the time of the exception, the container was:
Resolving Plastin.Common.Security.ADLDSClaimsProvider,(none) (mapped from Plastin.Common.Security.IClaimsProvider, (none))
Calling constructor Plastin.Common.Security.ADLDSClaimsProvider()
]
Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides) +329
Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides) +15
Microsoft.Practices.Unity.UnityContainerExtensions.Resolve(IUnityContainer container, ResolverOverride[] overrides) +72
Plastin.Common.Security.AuthenticationManager.Authenticate(String resourceName, ClaimsPrincipal incomingPrincipal) +149
Plastin.Portal.MvcApplication.Application_PostAuthenticateRequest() +70
[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) +87
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +21
System.Web.Util.ArglessEventHandlerProxy.Callback(Object sender, EventArgs e) +56
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
Finally we fixed this issue and my apologies I am getting late to answer this question. After lots of debugging we identified that our web application was throwing this error while getting members of ADLDS group. It was unusual as same application was working on other server. So we decided to captured network traffic using Wireshark. Wireshark capture indicated that connectivity between LDAP server and application server was blocked over SMB port 445. So we get our Network team to open port 445 which fixed the issue.
This error seems very generic error and could be other reasons for this error in your scenario but using network traffic capturing tool (like wireshark) at early stage of investigation might help you to troubleshoot these kind of issue quickly.

How to resolve a name conversion failure when sending MSMQ messages

I've recently been following this article on how to set up a 3-party queueing system with MSMQ, wherein the publisher, queue server and subscriber are all on separate systems within an Active Directory domain. I've succeeded in completing Part 1 and the first half of Part 2. However, when I continue with the latter half of Part 2 and enable Transport security, I receive the following error: An error occurred when converting the 'mymsmqservermachine.mydomain.network.ads\private$\Path/To/MyQueuedService.svc' queue path name to the format name: Unrecognized error -1072824300 (0xc00e0014). All operations on the queued channel failed. Ensure that the queue address is valid. MSMQ must be installed with Active Directory integration enabled and access to it is available.
I've verified the following:
Active Directory Integration for MSMQ is enabled on all the machines in the 3-party system, per this StackOverflow post.
The URL to the queue remains exactly the same as it was prior to enabling security, which worked just fine, no parsing errors whatsoever.
I've following the instructions provided by Windows when installing MSMQ here.
The relevant parts of the stack trace I get are:
at System.ServiceModel.Channels.MsmqFormatName.FromQueuePath(String queuePath)
at System.ServiceModel.Channels.MsmqUri.ActiveDirectory.UriToFormatName(Uri uri)
at System.ServiceModel.Channels.MsmqOutputChannel.OpenQueue()
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.MsmqOutputChannel.OpenQueue()
at System.ServiceModel.Channels.MsmqOutputChannel.OnOpenCore(TimeSpan timeout)
at System.ServiceModel.Channels.MsmqOutputChannel.OnBeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult.InvokeOpen()
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult..ctor(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.OnBeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult.InvokeOpen()
at System.ServiceModel.Channels.CommunicationObject.OpenAsyncResult..ctor(CommunicationObject communicationObject, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.CommunicationObject.BeginOpen(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.BeginCall(ServiceChannel channel, TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.BeginCallOnce(TimeSpan timeout, CallOnceManager cascade, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.BeginEnsureOpened(TimeSpan timeout, AsyncCallback callback, Object state)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit(IAsyncResult result, Boolean completedSynchronously)
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit()
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, TimeSpan timeout, AsyncCallback callback, Object asyncState)
at System.ServiceModel.Channels.ServiceChannel.BeginCall(ServiceChannel channel, ProxyOperationRuntime operation, Object[] ins, AsyncCallback callback, Object asyncState)
at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl[TArg1,TArg2,TArg3](Func`6 beginMethod, Func`2 endFunction, Action`1 endAction, TArg1 arg1, TArg2 arg2, TArg3 arg3, Object state, TaskCreationOptions creationOptions)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannel channel, ProxyOperationRuntime operation, Object[] inputParameters)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.CreateTask(ServiceChannel channel, IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
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)
Based on the content of the stack trace, it appears that the failure is coming from resolving the queue name within Active Directory. I've tried the following to attempt to resolve such a failure:
Simplifying the name to contain no periods or slashes (didn't work)
Using a public queue instead of a private queue, in the event that this step was omitted from the original tutorial on MSDN (it wasn't, didn't work)
At this point, I'm out of ideas. Has anybody encountered this error when using WCF with net.msmq bindings before and solved their issue ?
EDIT: When running the following test code from the same machine and same user, I'm able to send a message to the queue perfectly fine:
Me.TestContext.WriteLine("Executing under user '{0}'", WindowsIdentity.GetCurrent().Name)
Dim msg = New System.Messaging.Message()
msg.Body = "This is a test message"
msg.Label = "Test Message"
msg.Formatter = new ActiveXMessageFormatter()
Dim queue = new MessageQueue("FormatName:DIRECT=OS:mymsmqservermachine.mydomain.network.ads\private$\Path/To/MyQueuedService.svc")
queue.Send(msg)
By pure fluke, I stumbled across the solution, and I recorded it in my blog.
The gist of the solution was that I had to add a DNS identity for my WCF endpoint binding in my client:
Dim endpointAddress = New EndpointAddress(queueUri, EndpointIdentity.CreateDnsIdentity(queueUri.Host))
Dim netMsmqBinding = New NetMsmqBinding With
{
.Durable = true,
.ExactlyOnce = false,
.UseActiveDirectory = false,
.Security = New NetMsmqSecurity With
{
.Mode = NetMsmqSecurityMode.Transport
}
}
Return New ChannelFactory(Of ICwteCentralPublishingServiceChannel)(netMsmqBinding, endpointAddress)
I apologize to the world for the Visual Basic code, it's a legacy application and wasn't my choice.

Visual studio 11 .xaml design view error

Ok, first off I am confused on what is happening, I open up the code Blankpage.xml and click design view, but when I click on design view I get an error that says this
System.UnauthorizedAccessException
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle abort, Func`1 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue] (RemoteHandle`1 targetObject, Func`1 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor)
at Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateDesignerViewInfo(IIsolationTarget isolationTarget, IHostSourceItem item, IHostTextEditor editor, CancellationTokenSource cancelSource)
System.UnauthorizedAccessException
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Server stack trace:
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.WaitForCompletion(BlockingCall call)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Invoke(BlockingCall call)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.CallQueue.Invoke[T](Func`1 func, WaitHandle aborted)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor)
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.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor)
at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8. <Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__7(IRemoteDesignerService d)
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.DirectInvoke[T](WaitHandle abort, Func`1 func)
... I cant figure out what is wrong, This happened right after I deployed my project as a windows 8 metro application

Failed to load assembly, 0 bytes from System, BadImageFormatException

We've install .Net 4.0 Full at a client site. Current System.dll version is 4.0.30319.236.
Our test application opens without a problem and I initiate a simple "echo" to a WCF service on the same network. However, I get this nasty error when the service call is invoked:
Creating proxy
calling service method
ERROR: exception during service call and response process: Could not load file or assembly '0 bytes loaded from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. An attempt was made to load a program with an incorrect format.
System.BadImageFormatException
Stack trace:
Server stack trace:
at System.Reflection.RuntimeAssembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection, SecurityContextSource securityContextSource)
at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence securityEvidence)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] sources)
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.SerializerGenerationContext.GenerateSerializers()
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.SerializerGenerationContext.GetSerializer(Int32 handle)
at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.MessageInfo.get_BodySerializer()
at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.SerializeBody(XmlDictionaryWriter writer, MessageVersion version, String action, MessageDescription messageDescription, Object returnValue, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.SerializeBodyContents(XmlDictionaryWriter writer, MessageVersion version, Object[] parameters, Object returnValue, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.OperationFormatterMessage.OperationFormatterBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnWriteMessage(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteMessage(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
at System.ServiceModel.Channels.BinaryMessageEncoderFactory.BinaryMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
at Microsoft.Samples.CompressionEncoder.MyCompressionMessageEncoderFactory.MyCompressionMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset) in C:\Projects\TariffServices\TariffService\Source\Service Interface\CompressionEncoder\MyCompressionMessageEncoderFactory.cs:line 163
at System.ServiceModel.Channels.FramingDuplexSessionChannel.EncodeMessage(Message message)
at System.ServiceModel.Channels.FramingDuplexSessionChannel.OnSend(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.OutputChannel.Send(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.TransactionDuplexChannelGeneric`1.Send(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
We've re-installed the framework numerous times, I've tried re-ngen'ing the System.dll. Nothing works.
I've run the .Net setup verification tools, comes back with no errors.
The System.dll has a size of 3 510 600 bytes.
On the server machine (hosting the WCF service), everything is fine. The .Net version on that machine is also 4.0.30319.236.
Both machines are on WinXP 32bit Professional SP3, 2GB RAM.
Any ideas?
Thanks,
Chris
We've shelved this problem for now. There seems to be more wrong with this PC than meets the eye. We've recommended a re-format and installation of WinXP.
The problem can be connected to problem with csc.exe (used by code generator) not producing any output. Check this url for how to fix the issue: http://www.nooto.com/2011/02/net-framework-error-could-not-load-file-or-assembly/

NServiceBus Could not load file or assembly

I am getting the below error when i call "NServiceBus.Host.exe". The issue appears to be itextsharp.dll. I've read that i can use
"Configure.With(AllAssemblies.Except("itextsharp.dll"))... // rest of your config"
But i'm using the following sample and not sure where to add this property.
http://docs.particular.net/samples/web/asp-mvc-application/
#
Unhandled Exception: Magnum.StateMachine.StateMachineException: Exception occurr
ed in Topshelf.Internal.ServiceController1[[NServiceBus.Host.Internal.GenericHo
st, NServiceBus.Host, Version=2.6.0.1504, Culture=neutral, PublicKeyToken=9fc386
479f8a226c]] during state Initial while handling OnStart ---> System.Exception:
Exception when starting endpoint, error has been logged. Reason: Could not load
file or assembly 'file:///D:\dev\MYSITE\MYSITE.EStore\EStore.Server\bin\Debug\itexts
harp.dll' or one of its dependencies. Operation is not supported. (Exception fro
m HRESULT: 0x80131515)
at NServiceBus.Host.Internal.GenericHost.Start() in d:\BuildAgent-02\work\20b
5f701adefe8f8\src\host\NServiceBus.Host\Internal\GenericHost.cs:line 90
at Magnum.StateMachine.EventActionList1.Execute(T stateMachine, Event event,
Object parameter) in :line 0
--- End of inner exception stack trace ---
Server stack trace:
at Magnum.StateMachine.ExceptionActionDictionary1.HandleException(T stateMac
hine, Event event, Object parameter, Exception exception) in :line 0
at Magnum.StateMachine.EventActionList1.Execute(T stateMachine, Event event,
Object parameter) in :line 0
at Magnum.StateMachine.State1.RaiseEvent(T instance, BasicEvent1 eevent, Ob
ject value) in :line 0
at Magnum.StateMachine.StateMachine`1.RaiseEvent(Event raised) in :line 0
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(
IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInCont
ext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMes
sage msg, Int32 methodPtr, Boolean fExecuteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage req
Msg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgDa
ta, Int32 type)
at Topshelf.Internal.ServiceControllerProxy.Start()
at Topshelf.Internal.ServiceCoordinator.Start() in d:\dev\open-source\topshel
f\src\Topshelf\Internal\ServiceCoordinator.cs:line 54
at Topshelf.Internal.Hosts.ConsoleHost.Run() in d:\dev\open-source\topshelf\s
rc\Topshelf\Internal\Hosts\ConsoleHost.cs:line 53
at NServiceBus.Host.Program.Main(String[] args) in d:\BuildAgent-02\work\20b5
f701adefe8f8\src\host\NServiceBus.Host\Program.cs:line 103
When NserviceBus host starts it tries to retrieve all types from assemblies you specify.
In the sample you provide it uses NServiceBus.Configure.WithWeb() method.
This is the same as to call NServiceBus.Configure.With(AppDomain.CurrentDomain.DynamicDirectory)
You get the excpetion because "itextsharp.dll" cannot be loaded to AppDomain (this is done by calling Assembly.LoadFrom(file.FullName) method).
To fix the issue, you may manually specify assemblies you need to scan by using one of NServiceBus.Configure.With() overloads.