Saturday, March 21, 2009

Publishing/Deploying .NET 3.5 XAML applications


I did some investigation in how to deploy a .NET 3.5 XAML Application onto a network share drive. One can just put the dlls into a location on the share drive but deploying a new version when someone is running the application is problematic. This is because the user file locks the dlls.



So in this entry I would like to present:

1. How to publish a XAML application in Visual Studio 2008 to a share drive

2. Some thoughts on deployments through a dev, test, prod share locations passing various gates of developer and UAT approvals



1. Steps in deploying a XAML application in Visual Studio 2008

A. Open your XAML solution

B. Verify your Assembly name (Right click the WinForm project/Properties/ ensure the Assembly name is what you want vs. the default $safeprojectname$.Winform

You will need to update your references in your XAML files when you change this value as well

C. Go to Build/Publish (Assembly Name)

D. Specify the UNC Path to where the XAML application will be deployed file://sharedrive/XamlApp/ and click Next

E. Specify how users will install the application

Select the "From a UNC path or file share" and the value should be the same path as the previous step and click Next

F. Will the application be available offline?

Yes - A short cut added to the Start Menu and the application can be uninstalled via Add/Remove programs(Probably don’t want to do this, because it installs the application locally)

No - Only available online (No short cut and run directly from publish location)

and click Next

G. Click Finish


The publish will occur at the location of the UNC path specified.

There will be a publish.htm file which will also be launched at the end of the deploy to run the application.

This html page contains a link to the AssemblyName.application file that will launch the application.

The Application Files folder created will contain various versions of the application; each publish will create a new folder with an incremented version number.


Extra notes:

Publishing a new application version can be done without concern to users currently running the application.

Even if the files on the share are deleted and the user is running the application, the user will not notice

Older version under the Application Files directory can be removed if disk space is a concern.









Sunday, January 11, 2009

Connecting to the Business Objects CMS with .NET

Here is some sample code to connect to the Business Objects CMS (Central Management Server) with .NET

Tip:
Please note that the QueryBuilder SQL will return a maximum of 1000 records even if there are more to be returned. So logic should be included that if 1000 sorted records are returned, you should requery to retrieve missed records or until a recordset with less than 1000 returned records occurs.

This sample is a .NET 3.5 application.

Create a simple project and add references to
CrystalDecisions.Enterprise
CrystalDecisions.Enterprise.Framework
CrystalDecisions.Enterprise.InfoStore

Sample Code:

using System;
using CrystalDecisions.Enterprise;

namespace ConsoleAConnection
{

class Program
{
static void Main(string[] args)
{
string query = "Select SI_ID,SI_KIND,SI_NAME,SI_PARENT_FOLDER FROM CI_INFOOBJECTS WHERE SI_KIND IN ('Folder','FavoritesFolder')";

InfoObjects infoObjects = getCMCConnection().Query(query);
if (infoObjects.Count > 0)
{
foreach (InfoObject infoObject in infoObjects)
{
string siId = "" + infoObject.Properties["SI_ID"] + ":" + infoObject.Properties.Count;
Console.WriteLine("SI_ID=" + siId);
}
}
else
{
Console.WriteLine("No results found for " + query);
}
}

static InfoStore getCMCConnection()
{
SessionMgr sessionMgr = new SessionMgr();
EnterpriseSession enterpriseSession = sessionMgr.Logon("UserName", "Password", "ServerName", "secEnterprise");
EnterpriseService enterpriseService = enterpriseSession.GetService("InfoStore");
InfoStore infoStore = new InfoStore(enterpriseService);
return infoStore;
}
}
}

Thursday, January 8, 2009

Software Estimation by Steve McConnell



I just finished "Software Estimation" by Steve McConnell. This is a good book for covering exactly what the title indicates.

Steve McConnell is a well known author of software development books including "Code Complete".

This book starts with the difficulties experienced in software estimation and how hard it is indeed.

He then proceeds to cover approaches to develop more accurate estimates.

Techniques which include:

- counting

- calibration with historical data

- expert judgment

- decomposition and recomposition

- estimatino by analogy

- proxy-based estimates

Coverage of expert judgment in groups, software estimation tools, handling multiple approaches, and standardizing estimating procedures. The latter half of the book covers special issues in estimating.

All in all a good book to provide a thorough covering of software estimation.

Wednesday, January 7, 2009

ASP .NET 3.5 - Application Architecture and Design


ASP .NET 3.5 - Application Architecture and Design by Vivek Thakur is a great overview of architecture principles in the .NET 3.5 framework.
This book is available at http://www.packtpub.com.

Overview of major issues in application architecture with a perspective in regards to .NET 3.5.
Detailed explanation of the ASP.NET MVC framework!
Lots of screen shots and code samples to document the architecture principles and how to apply them in .NET 3.5. Very straightforward review for anyone looking to get basic architecture principles in the .NET 3.5 framework.

Chapter 1: Introduction to Architecture and Design
Lays out the importance of architecture and design and the associated definitions.Outlining the difference between tiers(physical separation) and layers(logical separation).
Chapter 2: 1-Tier 1-Layer Architecture in ASP.NET
Overview of simplest ASP applications: aspx files with code-behind
Chapter 3: ER Diagrams, Domain Model, and N-Layer Architecture
Review of ER graphical notation for data representationsReview of Domain Model notation with a UML reviewReview of 3 Layer Architecture (Data Access Layer, Business Layer, UI Layer)
Chapter 4: N-Tier Architecture
Reasons for N-Tier(Performance, Scalability, Reusability, Loose Coupling, better Plug and Play)5 Tier approach - Presentation, UI, Business, Data access, and Data tiers
Chapter 5: Model View Controller
Review of the Page Controller Pattern in ASP .NET(old style ASP .NET) and its problemsReview of the MVC Design or Model View Controller Detailed explanation of the ASP.NET MVC framework
Chapter 6: Design Patterns
Some review of useful design patterns as laid out by the "Gang of Four"Singleton, Factory, etc.
Chapter 7:SOA and WCF
Review of Service Oriented Architecture and Windows Communication FoundationSOA: XML, building and consuming Web ServicesWCF: the bundling of everything required for web services including performance gains
Chapter 8: Database Design
Issues with designing, modelling with Visio, and creation of databases
Chapter 9: Localization
Making your .NET application usable in multiple languages