David Sandor

Build succeeded.

Solved: Connection String does not show up when editing the connection property of a DBML file.

clock July 17, 2009 00:09 by author dsandor

The DBML editor in Visual Studio 2008 tends to create a nasty name in the settings file for your database connection string.  We have our databases named with the associated environment e.g. Product_dev or Product_test.  When the DBML editor saves the connection string you get a nasty name such as: ClassLibrary1.Properties.Settings.Product_devConnectionString.

This is fixed by creating the setting for the connection string first and giving it a pleasant name such as: ProductDb. 

 

Make sure you create the setting of type (Connection String) and save the settings.  After this you will need to edit your .config file and assign a providerName attribute to the connection string that was created.

providerName="System.Data.SqlClient"

 

After this, open your DBML file and your ProductDb connection string will show in the dropdown.



Convert a WPF Browser Application project to a WPF Application

clock July 17, 2009 00:09 by author dsandor

So I started an application as a WPF Browser Application (XBAP – Xaml Browser APplication) and quickly noticed that I needed to do some things that really should be in a stand alone app for CAS reasons.  I found a blog entry by Karen Corby that showed how to do this way back in ‘06.  She wrote a cool Visual Studio project template that would let you target XBAP vs. Stand Alone.

In 2009 this is still applicable.  Here is what she said to edit in your CSPROJ file to accomplish the change.

You can do this by manually editing the .csproj or .vbproj.

There are three main tags involved in making something an “XBAP”:

    <HostInBrowser>True</HostInBrowser>
    <Install>False</Install>
    <TargetZone>Internet</TargetZone>

Other tags are required for the “XBAP” debug experience, etc:

    <EnableSecurityDebugging>false</EnableSecurityDebugging>
    <MapFileExtensions>False</MapFileExtensions>
    <StartAction>Program</StartAction>
    <StartProgram>$(WINDIR)\System32\PresentationHost.exe</StartProgram>
    <ApplicationExtension>.xbap</ApplicationExtension>
    <StartArguments>-debug “$(MSBuildProjectDirectory)\bin\$(Configuration)\$(AssemblyName)
$(ApplicationExtension)”</StartArguments>

If you comment out all of the above tags and add…

    <Install>True</Install>

…your app will run as a standalone.

http://scorbs.com/2006/06/04/vs-template-flexible-application



WPF & VS 2010: What happened to…

clock July 17, 2009 00:08 by author dsandor

This blog page will end up being a series.  Here I will discuss what happened to certain features and elements of WPF and Visual Studio.

Anchor

In Windows Forms we used Anchoring to allow a control to stretch while a form is resized.

<Frame  HorizontalAlignment="Stretch" Name="frame1" VerticalAlignment="Stretch"  VerticalContentAlignment="Stretch" 
Margin="177,0,0,0" HorizontalContentAlignment="Stretch" />

One caveat is that by default the controls have a Width and Height property. When you set the Alignment and ContentAlignment properties to stretch you must remove the Width and Height properties from the XAML or you will end up with a centered control that does not stretch.



Visual Studio 2010: Intellisense fails to recognize namespaces of a referenced project.

clock July 17, 2009 00:07 by author dsandor

Intellisense fails to recognize namespaces of a referenced project.


Type
Bug
ID
453846

Status
Active
Access Restriction
Public

Opened By
dsandor
Opened
5/19/2009
Submission Language
English


Description

Adding a previously compiled project reference to a WCF project does not show intellisense. Even after waiting several minutes.

Product Language

English

Version

Visual Studio Team System 2010 Beta 1

Operating System

Windows Vista

Operating System Language

English

Steps to Reproduce


Solution file with a WCF Service Application and a Windows Class project.
Generate a DBML file and place it in the class project.
Compile.
Add the class project as a 'project reference' to the WCF project.
Reference shows up in References, object viewer shows the object and all it's classes.
Try entering code in the default/template DoWork() method and the Namespace does not show in Intellisense. Manually type the fully qualified namespace+class name; e.g. MyCompany.SubNS.Class1 class1 = new MyCompany.SubNS.Class1();
Gets Red error underline.
Trying to add namespace to using declarations results in same red underlines.
Compile -> successful. Subsequent use of intellisense works properly now.

Actual Results

Referenced classes and namespaces do not show in intellisense until the first time you compile the referencing app.

Expected Results

Referencing application should show referenced classes and namespaces without having to compile the referencing application first. This is behavior in VS2008 already.



Sizer application to simulate different screen resolutions easily for Windows or Web apps.

clock July 17, 2009 00:07 by author dsandor

Brian Apps wrote a tiny application that lets you set a window to a specific size.  The app is a measly 17k and works like a champ.  Oh, and it is free.

Sizer System Tray Icon

http://www.brianapps.net/sizer.html



Visual Studio 2008 SP 1 – Why you need to stay on top of service packs.

clock July 17, 2009 00:07 by author dsandor

So it has been a while since I needed to write a legacy ASPX application.  I updated my Telerik controls to the latest version which changed the manner in which the design time control code is referenced.  As it turns out Telerik has gone full circle with their controls as far as how the assemblies are distributed.  They used to put each control in its own assembly then tidied it up a bit by placing everything into one assembly.  With the latest revision they separated the design time code from the redistributable. 

As it turns out Visual Studio 2008 RTM had a problem where design time controls would not load if the DTC was GAC’ed.  SP1 fixed this issue and all is OK in the world of Design Time Control references from the GAC.

This is a key piece of functionality.  As a developer that has needed to build controls with designers so that developers could consume my work… I understand how frustrating this can be.  A software rev (Visual Studio) breaking long working functionality.

We update your Visual Studio if you are using legacy ASPX pages/controls and you are having Designer Rendering issues. 

Download details- Visual Studio 2008 Service Pack 1



.NET – My application works on XP but not Server 2003, Vista, Server 2008, Windows 7…

clock July 17, 2009 00:06 by author dsandor

Application manifests work differently between XP and the 2003/Visa cores.  On Windows XP the external manifest is searched for and utilized first.

On Server 2003 and later the Internal manifest is read first.  See Junfena Zhang’s post on this topic.  This explains a lot.  I have written several shrink wrapped apps that are installed across a nonstandard install base and this has been my problem in the past.



Log4Net vs. Entlib Logging Block – Old post still applicable.

clock July 17, 2009 00:06 by author dsandor

http://weblogs.asp.net/lorenh/archive/2005/02/18/376191.aspx

I like the blog title:  “If your only tool is a hammer…” I have said that so many times.  Developers learn one trick and want to apply it to every situation.  Sometimes Tool-A is better than Tool-B.  I suppose that is what separates an Architect from a developer.  Loren does a great job explaining the differences.



Enabling WS-Atomic Transactions on Server 2008 for WCF

clock July 17, 2009 00:06 by author dsandor

When you enable WS-Atomic Transaction support on Server 2008 the installation gives you an info message in the installation log that states something to the effect:

<Informational>: To configure WS-Atomic Transactions, run the wsatconfig.exe utility in C:\Windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation using the following certificate thumbprint for the SSL certificate: 4EA4E7A5BE979E1039D2F6F51D77230843BED0D2

When you run the command it tells you to run you receive an error:

C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation>WsatConfig.exe -endpointCert:4EA4E7A5BE979E1039D2F6F51D77230843BED0D2

Microsoft (R) WS-AtomicTransaction Configuration Utility
[Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.648]
Copyright (c) Microsoft Corporation.  All rights reserved.

Cannot update the WS-AT configuration when WS-AT network support is disabled.

The solution is simple. 

Reboot after enabling the WS-Atomic Transaction feature and then run the wsatconfig application again.

Use the full command line:

WsatConfig.exe –network:enable -endpointCert:4EA4E7A5BE979E1039D2F6F51D77230843BED0D2

Obviously replace the thumbprint with the one listed in your log.

Interestingly enough, Server 2008 spits out the message:

[Paraphrased]
The certificate could not be used..

So a subsequent execution of the same command rendered:

Could not find the specified SSL certificate.



Converting over to a new blog platform – BlogEngine.net

clock July 17, 2009 00:05 by author dsandor

I will be converting from the Community Server platform to BlogEngine.net shortly.  I will build a data converter for the rollover and have my blog ported over very soon, hopefully with some of my own custom Silverlight elements.

http://blogengine.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=26080



Mouse gestures to display context menu in Silverlight.

clock July 17, 2009 00:05 by author dsandor

Morten has a great little article with supporting source code explaining how to display a context menu with mouse gestures such as shift-click, double click, right-click..etc.  The code is very useful.  Good job!

http://www.sharpgis.net/post/2009/05/09/Adding-rightclick-to-Silverlight.aspx



SplendidCRM project file for Visual Studio 2008 and .NET 3.5 – working!

clock July 17, 2009 00:04 by author dsandor

So for those of you that do not know, Splendid CRM is a (sorta) free CRM product based on Sugar CRM (another sorta free).  Both products are great CRM codebases.  The SplendidCRM version is re-written in C# and .NET.  The community version which is a free download contains the source tree.

I had some problems getting the csproj file included in the source tree to work so I figured I would help out the community by publishing my final conversion that builds properly.  I had to manually edit the project file in order to get it into a workable 2008 project.  I also had to fix some VS2005 reference issues to make the project work with .NET 3.5.

Here is the link to SugarCRM:

http://www.sugarcrm.com/crm/

…and Splendid CRM

http://www.splendidcrm.com/

…and finally, the Project file.  Replace the csproj file in the community edition with this one and you should be ok.

http://davidsandor.com/Content/SplendidCRM7.rar



.NET RIA Services – New Domain Service Class does not show your available DataContexts

clock July 17, 2009 00:04 by author dsandor

One issue I noticed with RIA services is that LINQ to SQL DBML classes do not show in the Available Data Context drop down until you have compiled the dbml at least once.  This is for obvious reasons but it would be nice to have a warning message or something.

image

Solution:  Compile your project that contains the DBML file and your data contexts will show in the New Domain Service Class dialog.



What happened to the IIS_WPG in IIS 7?

clock July 17, 2009 00:04 by author dsandor
IIS 6 IIS 7
IUSR_MachineName IUSR
IIS_WPG IIS_IUSRS
   


Free Antivirus software for ALL versions of Windows including Server 2003.

clock July 17, 2009 00:03 by author dsandor

I was searching for an AntiVirus product for my development servers for a while.  I found some great AV products that are free for a workstation but charge a ridiculous price for their server versions even though they do pretty much the same thing as the free desktop version.  I was not looking for a bunch of additional garbage.  Just basic AV.

I finally found an open source AV product named ClamWin.  I initially shrugged it off because the name it a bit weak in my opinion.  However it is a great product.

http://www.clamwin.com/

Configuration Screen



Dynamics AX 2009 Cubes deployed to SSAS 2008 removing unlicensed elements from the cubes so that they will process.

clock July 17, 2009 00:03 by author dsandor

There is a document that links to a spreadsheet which lists all the licensing modules which relate to the cubes in SSAS.  This is a very long winded way to get your cubes trimmed up so that they will process.  The documentation for this ‘best practice’ way is listed below.  Have fun it will take you a week of monotonous cross referencing and cube surgery.  When you are defeated, cruise back over here and follow this 10 minute procedure ;)

http://www.microsoft.com/downloads/details.aspx?FamilyId=28CDB057-416A-497E-A7E0-8D52C4EB1BFB&displaylang=en#filelist

(You also need the xlsx file, as that shows you which licensed modules relate to the entities in the cube you need to remove.)

Follow page 10 of the ConfigureDefaultCubes.xps document on the SQL Server / SSAS server.  This gets you an imported BI project from the deployed SSAS Cubes.  FYI if you don’t have the cubes deployed yet you will need to manually install the cubes by following my blog post here:

http://davidsandor.com/blogs/tipsandtricks/archive/2009/05/05/dynamics-ax-2009-cube-deployments-to-ssas-2008-on-a-clustered-sql-2008-on-windows-clustering-failover-server-2008.aspx

Now that you have your BI project created you must place the project target database in Enterprise Server mode or you will have other issues.  To do this follow these steps:

1) Right click on the root node of the solution explorer and select properties:

image

2) Change the Deployment Server Edition to Enterprise. (Yes, even if you are using STD.)

image

3) Right click your Accounts Payable Cube and choose Process.

image

4) You will get a TON of errors in the error log.  Start at the top of the error log.  Double click the error and in the solution explorer a dimension will be highlighted that is causing the error.

image

Delete the error.  The reason that this error occurred when you try to process the cube is because the table or column in the Axapta database did not exist.  As you go through and delete the invalid dimensions the error list will get smaller and smaller.  When you have deleted all of the invalid dimensions you will have completed the tedious chore in a few minutes.

5) You should now be able to deploy the project back to the server to update the cubes on the SSAS server.  Note that if you are using a cluster you will need to update the DataSource to point to your SSAS cluster resource name (usually your SQL cluster resource name) because by default it tries to hit the localhost and with Windows Failover Server 2008 this does not work at localhost.

image



Dynamics AX 2009 Cube deployments to SSAS 2008 on a clustered SQL 2008 on Windows Clustering / Failover Server 2008

clock July 17, 2009 00:02 by author dsandor

In short:  You must manually deploy the SSAS cubes to your SSAS 2008 server.

On your Dynamics AX 2009 installation media locate the following folder:

[MEDIA ROOT]:\support\Analysis Services\Scripts

Locate the DynamicsAX.xmla SSAS deployment script.  This file contains all the information to create the SSAS database, all the dimensions, and all the cubes.

To install this script you must open SQL Server Management Studio 2008 and connect to the Analysis Services server.

image

 

Next, right click on the SSAS server root node and choose New Query | XMLA.

image

This will open a new XMLA query window.  Drag the DynamicsAX.xmla script into this window and execute it.  This will create the SSAS database for Dynamics AX.



Bug in Silverlight 3 when adding a service reference to a Silverlight Application under source control.

clock July 17, 2009 00:02 by author dsandor

Problem: 

Add a reference to a WCF service to your Silverlight 3 application.  The proxy client is created but the binding and endpoint configuration fails to write to the ServiceReferences.ClientConfig file.

 

Workaround: 

Checkout the .ClientConfig file prior to making changes to the service references.



Linqpad

clock July 17, 2009 00:01 by author dsandor

LINQPad ScreenshotHa!  Kudos to Joseph Albahari for a cool tool!

 

http://www.linqpad.net/



Visual Studio 2008 crashes after undocking a window and closing the application.

clock July 17, 2009 00:00 by author dsandor

I have had this issue since the RTM of Visual Studio 2008 and posted a bug report about it.  After a year the problem has been fixed even though several developers on the Visual Studio Dev team claimed they could not reproduce the issue.  That is such a ‘developer’ thing.

And finally the fix:

http://code.msdn.microsoft.com/KB960075/Release/ProjectReleases.aspx?ReleaseId=2346



About the author

David Sandor is a Software Architect working in Chicago, IL.  My development focuses around the Microsoft Stack including Azure, AppFabric, Silverlight, WPF, .NET Framework, and various mobile devices including iOS (iPhone/iTouch), Android, Windows Mobile and Windows Phone 7.

Month List

Sign in