Microsoft Office Professional Plus 2010 – Cannot verify the license for this product. You should repair the office program by using control panel.

I got a problem faced in one of our dev machines which is eventually a VM while activating the product key. We had this problem almost for about 12hrs but couldn’t be to resolve even after multiple re-installs and restarts.

What I have did is below:

Went to Control Panel – Selected the Office program and Repair Office

Entered the product key

Reinstalled the office products

Rebooted the machine

None of  the above worked.

Finally I pinged one of my friend who is an Office MVP and he given me some inputs

Go to command prompt and enter the command
Cd C:\Program Files\Microsoft Office\Office14 (Note if you are running 64 bit then go to C:\Program Files (x86) \Microsoft Office\Office14 ).

then type below command

cscript ospp.vbs /act

Office 2010 activation - cmd

Office 2010 activation – cmd

This actually activates the product key with the office 2010 you got installed , and shows below messages as shown in the screen shot.

Dynamic Language Programming with Python – Sample Implementation

DLR is a great invention by Microsoft .NET 4.0 along with Dynamic Typing

The Dynamic Language Runtime (DLR) is piece of technology that unifies dynamic programming on the .NET platform, the same way the Common Language Runtime (CLR) has been a common platform for statically typed languages. CLR always has dynamic capabilities ,DLR is on top of CLR.

Currently IronPython and IronRuby is supported , below is an example of how to consume a python class in C#.

You may need to download the IronPython Library from the below link and install , include those references to your project.

http://ironpython.codeplex.com/

Assume you have python class like below

Calc.py

class Calculator:

   def add(self, argA, argB):

      return argA+argB

   def sub(self, argA, argB):

      return argA-argB

The above said class can be accessed in C# like below

using IronPython.Hosting;

static void Main(string[] args)

{

var enginePY = Python.CreateEngine();

  dynamic calcPYObject = enginePY.ExecuteFile(@”C:\Uday\DynamicPY – Demo Application\DynamicPY – Demo Application\calc.py”);

dynamic calc = calcPYObject.Calculator();

Console.WriteLine(calc.__class__.__name__);

//write ‘Calculator’

double X = 25;

double Y = 10;

double result;

result = calc.add(X, Y);

Console.WriteLine(“{0} + {1} = {2}”, X, Y, result);

 result = calc.sub(X, Y);

Console.WriteLine(“{0} – {1} = {2}”, X, Y, result);

Console.WriteLine(“Press any key to close the application…”);

Console.Read();

        }

    }

WCF – Configuring Instance Management

Instance management refers to the way a service handles a request from a client. Instance management is set of techniques WCF uses to bind client request to service instance, governing which service instance handles which client request.
 
It is necessary because application will differ in their need for scalability, performance, durability, transaction and queued calls.
 
There are three instance modes in WCF:
  1. Per-Call instance mode
  2. Per-Session instance mode
  3. Singleton Instance Mode
 
Configuration:
−Instance mode can be configured using ServiceBehavior attribute. This can be specified at implementing the service contract as shown below.
 
[ServiceContract()]
public interface IPayRollService
{
[OperationContract]
double ProcessSalary();
 }
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
public class PayRollService:IPayRollService
{
public double ProcessSalary()
{
//Do something
}
}

Sample MVVM Driven WPF Application

WPF has a very powerful data binding feature, that provides an easy one-way or two-way synchronization of properties.

The model-view-viewmodel is a typically WPF pattern. It consists of a view, that gets all the user input and forwards it to the viewmodel, typically by using commands.
 
This is a pattern created by by John Gossman from WPF team.
Below is the sample application which shows up how to implement the WPF PropertyChanged trigger.
 
 XAML implementation

    <DockPanel Margin=”10″>
        <StackPanel DockPanel.Dock=”Right” Margin=”10,0,0,0″>
            <Button Name=”btnAddUser” Click=”btnAddUser_Click”>Add Employee</Button>
            <Button Name=”btnChangeUser” Click=”btnChangeUser_Click” Margin=”0,5″>Change Employee</Button>
            <Button Name=”btnDeleteUser” Click=”btnDeleteUser_Click”>Delete Employee</Button>
        </StackPanel>
        <ListBox Name=”lbUsers” DisplayMemberPath=”Age”></ListBox>
    </DockPanel>

CodeBehind Implementation

 public partial class MainWindow : Window     {      

        private ObservableCollection<Employee> employees = new ObservableCollection<Employee>();

 

        public  MainWindow()                 {

                    InitializeComponent();                        employees.Add(new Employee() { Name = “Aieshwanth Deepak ” ,Age =18});                        employees.Add(new Employee() { Name = “Sharika Shivani”, Age = 19 });                        employees.Add(new Employee() { Name = “Jeeva Rekha”, Age = 28 });

                        lbUsers.ItemsSource = employees;                 }

                private void btnAddEmployee_Click(object sender, RoutedEventArgs e)                 {                         employees.Add(new Employee() { Name = “New Employee” ,Age=25});                 }

                private void btnChangeEmployee_Click(object sender, RoutedEventArgs e)                 {                         if(lbUsers.SelectedItem != null)                         {                                 (lbUsers.SelectedItem as Employee).Name = “Raymond Schenk”;                                 (lbUsers.SelectedItem as Employee).Age = 48;                         }

                }

                private void btnDeleteEmployee_Click(object sender, RoutedEventArgs e)                 {                         if(lbUsers.SelectedItem != null)                                 employees.Remove(lbUsers.SelectedItem as Employee);                 }         }

        public class Employee : INotifyPropertyChanged         {                 private string name;                 public string Name {                         get { return this.name; }                         set                         {                                 if(this.name != value)                                 {                                         this.name = value;                                         this.NotifyPropertyChanged(“Name”);                                 }                         }                 }

                public event PropertyChangedEventHandler PropertyChanged;

                public int _age;

                public int Age                 {                     get { return this._age; }                     set                     {                         if (this._age != value)                         {                             this._age = value;                             this.NotifyPropertyChanged(“Age”);                         }                     }                 }                 public void NotifyPropertyChanged(string propName)                 {                         if(this.PropertyChanged != null)                                 this.PropertyChanged(this, new PropertyChangedEventArgs(propName));                 }         }

 

Hope this helps

Windows 8.1 Preview Released

Microsoft has announced today the release of Windows 8.1 Preview  during Build 2013 conference, great news for Windows app community.

its a free update to Windows 8 coming later this year, and a prerelease version is available now for you to try. Windows 8.1 has new ways to personalize PC and includes a wave of awesome new apps and services.

One can download from the below link.

http://windows.microsoft.com/en-us/windows-8/preview

Lots of cool features Built in Cloud Storage , you can boot now directly to desktop..etc

 

 

 

VS.NET 2013 & Windows 8.1 Preview Released today during Build 2013

Absolutely its a day to remember after looking into the things happening  today at Microsoft side especially releasing several products. One side we have VS.NET 2012 Update 3 which is cumulative update to the existing  VS.NET 2012 and the other side we have VS.NET 2013 preview release , Excellent. Build 2013 conference at San Francisco rocks.