WPF (3.5 / Visual Studio 2008) does not ship with an Open File Dialog component like in Windows Forms.  You can however still use the Windows Form’s (Win32) open file dialog class to accomplish exactly the same thing with a few lines of code.


image

I was in the process of reinstalling Enterprise Portal for Dynamics AX 2009.  After reinstalling EP, SSAS, and Service Packing my Role Center was gone and there was no ‘Home’ link in the top (breadcrumb) area of the Axapta client.  After some poking around I clicked on:  Administration | Setup | Internet | Enterprise Portal | Web sites

Look at the bottom of this screen and you will see a textbox for “Web site used to display Role Centers in the Dynamics AX client”.  If this textbox is empty (this was my case) then the Home link and the Roles Centers fail to display.  Simply copy your Internal URL and paste it into the text box.  Hit save and then log back in and viola!  Role Centers.

image

Chris does this in what I believe to be a WinForms Grid here:
http://www.christopherkane.com/post/Disabling-a-row-in-a-Grid-based-off-of-a-value-in-the-source.aspx

Look at how easy it is in WPF with Style Triggers:



Situation:  Windows Server 2008 with SQL Server 2008 Reporting Services and SQL Server 2008 Analysis Services SP 1, Microsoft Dynamics Axapta 2009 with Service Pack 1 and KB 959494 will not allow AX Analysis Extensions to install with the error message: You must install SQL Server 2005 Analysis Services with Service Pack 2 or higher before installing the Analysis extensions.

As a new DAX-er, welcome to the hell that is DAX 2009 installer.  To be kind, the setup for Ax 2009 needs a great deal of work.

Microsoft suggests applying KB 959494 which is of no use for SSAS 2008 SP1.

 

ssas-ax-02

After applying the KB article SSAS Extensions still will not install.  Further research seems to indicate that the problem might be with some 9.0 SSAS assemblies in the GAC.

Setup does not recognize that SQL Server 2008 Analysis Services is
installed If you have SQL Server 2008 Analysis Services installed and you are
installing the analysis extensions, you might receive an error that says you
must install SQL Server 2005 Analysis Services with Service Pack 2. This
error message indicates that there is an Analysis Services 2005 version of
the Microsoft.AnalysisServices.dll file in the Global Assembly Cache.
Microsoft Dynamics AX does not support running Analysis Services 2005 and
Analysis Services 2008 on the same computer. To resolve this issue, uninstall
the Microsoft.AnalysisServices.dll file that has a version number of 9.0 from
the Global Assembly Cache (typically located at C:\Windows\assembly).
Important: Be sure that you do not uninstall the
Microsoft.AnalysisServices.dll file that has a version number of 10.0

ssas-ax-01

I checked and sure enough there were.  So I looked and found SQL Server 2005 Express installed on the machine, not sure why.

Anyway, I uninstalled SQL Server 2005 Express and also the SQL Server 2005 Analysis Services ADOMD assemblies.

ssas-ax-03

I checked the GAC after uninstalling the 2005 components and I had a clean GAC, only 10.0 references.

ssas-ax-04

On to install again…and the Analysis Extensions can now be installed!

 

ssas-ax-05

Oh how beautiful it is:

ssas-ax-06

In .NET 4.0 / Visual Studio 2010 I was working with a WPF application who’s ViewModel was sending a Model (Data) object back to a WCF service for processing.  In previous versions of the framework and WCF I could simply send any serializable object down the wire.  In .NET 4.0 apparently I need to do some further class decorating.

I needed to include the namespace:


My class that I was sending needed to be decorated with:


and the properties I wanted to send down the wire via WCF needed to have:


After decorating the Class and it’s properties with DataContract and DataMethod everything worked like a charm.

 

Below are some of the debugger data that helped troubleshoot the problem.

error

 

The InnerException message was ‘Type ‘System.DelegateSerializationHolder+DelegateEntry’ with data contract name ‘DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System’ is not expected.

System.ServiceModel.CommunicationException was unhandled
  Message=There was an error while trying to serialize parameter http://tempuri.org/:receipts. The InnerException message was ‘Type ‘System.DelegateSerializationHolder+DelegateEntry’ with data contract name ‘DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System’ is not expected. Add any types not known statically to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.’.  Please see InnerException for more details.
  Source=mscorlib
  StackTrace:
    Server stack trace:
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameter(XmlDictionaryWriter writer, PartInfo part, Object graph)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameters(XmlDictionaryWriter writer, PartInfo[] parts, Object[] parameters)
       at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.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.Security.SecurityAppliedMessage.WriteBodyToSignThenEncryptWithFragments(Stream stream, Boolean includeComments, String[] inclusivePrefixes, EncryptedData encryptedData, SymmetricAlgorithm algorithm, XmlDictionaryWriter writer)
       at System.ServiceModel.Security.WSSecurityOneDotZeroSendSecurityHeader.ApplyBodySecurity(XmlDictionaryWriter writer, IPrefixGenerator prefixGenerator)
       at System.ServiceModel.Security.SecurityAppliedMessage.OnWriteMessage(XmlDictionaryWriter writer)
       at System.ServiceModel.Channels.BufferedMessageWriter.WriteMessage(Message message, BufferManager bufferManager, Int32 initialOffset, Int32 maxSizeQuota)
       at System.ServiceModel.Channels.TextMessageEncoderFactory.TextMessageEncoder.WriteMessage(Message message, Int32 maxMessageSize, BufferManager bufferManager, Int32 messageOffset)
       at System.ServiceModel.Channels.HttpOutput.SerializeBufferedMessage(Message message)
       at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ClientReliableChannelBinder1.RequestClientReliableChannelBinder1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode)
       at System.ServiceModel.Channels.ClientReliableChannelBinder1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode)
       at System.ServiceModel.Channels.ClientReliableChannelBinder
1.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.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)
    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 Warehouse.ViewModel.Services.SyncService.ISync.SendNewReceipts(SendNewReceiptsRequest request)
       at Warehouse.ViewModel.Services.SyncService.SyncClient.SendNewReceipts(SendNewReceiptsRequest request) in d:\Projects\Warehouse.2010\Warehouse.ViewModel\Service References\Services.SyncService\Reference.cs:line 75
       at Warehouse.ViewModel.SyncData.PerformSync() in d:\Projects\Warehouse.2010\Warehouse.ViewModel\SyncData.cs:line 60
       at Warehouse.Window1.btnBackup_Click(Object sender, RoutedEventArgs e) in d:\Projects\Warehouse.2010\Warehouse\Window1.xaml.cs:line 196
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.Controls.Button.OnClick()
       at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
       at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Application.RunInternal(Window window)
       at Warehouse.App.Main() in d:\Projects\Warehouse.2010\Warehouse\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Runtime.Serialization.SerializationException
       Message=Type ‘System.DelegateSerializationHolder+DelegateEntry’ with data contract name ‘DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System’ is not expected. Add any types not known statically to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.
       Source=System.Runtime.Serialization
       StackTrace:
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType(DataContract dataContract, XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType(XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteSerializationInfo(XmlWriterDelegator xmlWriter, Type objType, SerializationInfo serInfo)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteISerializable(XmlWriterDelegator xmlWriter, ISerializable obj)
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteDockReceiptToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , ClassDataContract )
            at System.Runtime.Serialization.ClassDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference(XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle)
            at WriteArrayOfDockReceiptToXml(XmlWriterDelegator , Object , XmlObjectSerializerWriteContext , CollectionDataContract )
            at System.Runtime.Serialization.CollectionDataContract.WriteXmlValue(XmlWriterDelegator xmlWriter, Object obj, XmlObjectSerializerWriteContext context)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph)
            at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph)
            at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.SerializeParameterPart(XmlDictionaryWriter writer, PartInfo part, Object graph)
       InnerException:

 

 

Vote for this bug if you encounter this problem.  Basically in 2010, if you regen the DBML file outside of VS the underlying DataContext code does not get regenerated.  This is bad because changes outside of VS 2010 to your DBML will not get ‘picked up’ when you rebuild.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=474117