# Thursday, August 19, 2010

Today after downloading and installing Crystal Reports for Visual Studio 2010 Beta 2 I got this message:

CRforVS2010_Beta2

I understand that it is a beta but do they test this stuff!

I am lucky that I always install these kind of software in a test system but it is annoying and time consuming. 

posted on Thursday, August 19, 2010 1:55:19 PM UTC  #    Comments [0]
# Thursday, August 05, 2010

image

 

Can someone from Microsoft explain What is the job of their "Dirteam"?

This is the response I got so far. Is this arrogance or what?:

image

posted on Thursday, August 05, 2010 3:14:54 PM UTC  #    Comments [0]
# Saturday, July 10, 2010

I don't know when and how it happened, maybe when I installed VS 2010 side-by-side with VS 2008, but my VS 2010 default language was set to Visual Basic and I don't use "that thing" anymore. I ignored it for a while since I have been just converting from VS 2008 but it got annoying because every time I created a new project it was created with Visual Basic so I had to delete it and recreate it.

Finally I decided to change the setting but I was looking on the wrong place Tools -> Options. After a while I found this eggheadcafe posting and as it said it is Tools -> Import and Export Settings.:

image

Save your current settings in case you change your mind later: (not me :-))

image

Then select Visual C# Development Settings and click Finish:

image

posted on Saturday, July 10, 2010 6:32:56 PM UTC  #    Comments [0]
# Tuesday, May 18, 2010

While installing Silverlight 4 Tools v1.0 for Visual Studio I ran into the following screen sometimes after the installation hanged for a while:

image

I had found that problem before while trying to install SQL Server 2008 so I located the following registry key:

image 

and removed this from the PendingFileRenameOperations

image

After doing that I ran the installation again and it completed successfully.

image

posted on Tuesday, May 18, 2010 3:32:43 PM UTC  #    Comments [0]
# Friday, May 14, 2010

Let the source code speak: (This is from a real application not "Demoware")

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using CBSI.GL.Application;
using CBSI.NHibernate.DomainServices;
using CBSI.GL.Domain;
using CBSI.GL.DA;
using CBSI.TAE.Dashboard.RIAServices.Web.Properties;

namespace CBSI.TAE.Dashboard.RIAServices.Web.Services
{
    [EnableClientAccess()]
    public class AccountCategoryDomainService : GLDomainService<AccountCategoryRepository, AccountCategory, long>
    {
        IAccountCategoryService _AccountCategoryService;
        public AccountCategoryDomainService(IAccountCategoryService accountCategoryService) : base(accountCategoryService.Repository)
        {
            _AccountCategoryService = accountCategoryService;
        }

        public IEnumerable<AccountCategoryModel> Categories()
        {
            return from c in this.Repository.All where (c.GLSetup.ID==this.GLSetup.ID)
                   orderby c.Name
                   select new AccountCategoryModel(c); 
        }

        public void Insert(AccountCategoryModel model)
        {
            if (this.Exists(model.Name))
                throw new ApplicationException(string.Format(Resources.AlreadyExistEntityWithName, Resources.Entity_Name_Category, model.Name));
            AccountCategory accountCategory =  new AccountCategory(this.GLSetup);
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);
        }

        public void Update(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory==null)
                throw new ApplicationException(string.Format(Resources.UpdatingNonExistingEntity, Resources.Entity_Name_Category));
            accountCategory = model.ToDomain(accountCategory);
            SaveTransaction(accountCategory);
            this.ChangeSet.Associate(model, accountCategory, MapToModel);    
        }

        public void Delete(AccountCategoryModel model)
        {
            AccountCategory accountCategory = this.Repository.Get(c => c.ID == model.ID);
            if (accountCategory == null)
                throw new ApplicationException(string.Format(Resources.DeletingNonExistingEntity, Resources.Entity_Name_Category));
            DeleteTransaction(accountCategory);
        }

        bool Exists(string name)
        {
            var ac = this.Repository.Get( c => c.Name == name);
            return (ac != null);
        }

        void MapToModel(AccountCategoryModel acm, AccountCategory ac )
        {
            acm = new AccountCategoryModel(ac);
        }
    }
}

posted on Friday, May 14, 2010 2:58:49 PM UTC  #    Comments [0]
# Wednesday, April 21, 2010

When talking about the Model View ViewModel (MVVM) , Model View Controller (MVC) or any other presentation patterns Model some people refer to it as the Database Model, others as the Domain Model. Well, it is actually referred as a Presentation Data Model.

Your database or domain types could have many properties that the View does not care about and it will be a waste of resources as well as a security risk to have all that data traveling back and fourth the network even if it is an intranet.

Another problem with using Database or Domain data in your MVVM is that any change to the database or domain will require to update all the clients and that could be very costly.

Let's assume for example that we have the following very simple Domain Model:

SSLDomain

and the following Database Model:

image

Note: I created the Database Model using the following NHibernate mapping:

     
 
<?xml version="1.0" encoding="utf-8"?>
<!--Generated with CyberBizSoft's NHibernate Helper on 12/16/2009 11:30:06 PM -->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="CyberBizSoft.SSL.Domain" 
namespace="CBSI.SSL.Domain">
    <class name="Store" table="SSLStores" lazy="false" >
        <id name="ID" unsaved-value="0" column="ID" type="System.Int64">
            <generator class="identity" />
        </id>
        <property name="Name"/>
        <property name="Description"/>
        <component name="Contact" class="CBSI.Common.Domain.SingleContact, 
CyberBizSoft.Domain" >
            <component name="Address" class="CBSI.Common.Domain.Address, CyberBizSoft.Domain">
                <property name="Street" column="Street" />
                <property name="City" column="City" />
                <property name="State" column="State" />
                <property name="ZipCodeNumber" column="ZipCodeNumber" />
                <property name="Country" column="Country" />
            </component>
            <component name="Phone" class="CBSI.Common.Domain.Phone, CyberBizSoft.Domain">
                <property name="FullNumber" column="PhoneNumber"/>
            </component>
            <component name="Fax" class="CBSI.Common.Domain.Phone, CyberBizSoft.Domain">
                <property name="FullNumber" column="FaxNumber"/>
            </component>
            <component name="EMail" class="CBSI.Common.Domain.Url, CyberBizSoft.Domain">
                <property name="URL" column="EMailAddress"/>
            </component>
            <component name="Web" class="CBSI.Common.Domain.Url, CyberBizSoft.Domain">
                <property name="URL" column="WebAddress"/>
            </component>
        </component>
    </class>
    <!--Copyright (c) 2001 - 2009 by CyberBizSoft, Inc. All rights reserved.-->
</hibernate-mapping
 
     

 

Let's say that we have to create an interface only to change the Name and Description of this Store. Why would we have to bring all the other information into the client if we only need the Store's ID, Name & maybe Description?

Preferably we could create a very simple presentation data model (StoreNameModel) which we could adorn with presentation specific attributes,

class StoreNameModel
{
    [Key]
    public long ID { get; set; }
    [Required]
    public string Name { get; set; }
    public string Description { get; set; }
}

map the data from the Domain Store in the service to the StoreNameModel

public IQueryable<StoreNameModel> Stores()
{
    return from c in Repository.All
           orderby (c.Name)
           select new StoreNameModel() { ID = c.ID, Name = c.Name, Description = c.Description };
}

and then project it into the ViewModel in the client.

Update (4/23/10)

I found this post by Deepesh Mohnani about the WCF RIA Presentation Model    

 

 
posted on Wednesday, April 21, 2010 6:43:46 PM UTC  #    Comments [0]
# Tuesday, April 20, 2010

If you create a Silverlight application using the WCF RIA Services Class library and with the following walkthrough when you try to access the Context for the RIA application (WebContext) it is not there.

Since we did not enabled the WCF RIA Services for the Silverlight application the WebContext class is not generated in the client.

  image

You can verify this by selecting the Silverlight application in the Solution Explorer, click the Show All Files button in the Solution Explorer toolbar and then inspecting the hidden "Generated_Code" folder.

The workaround is to right click on the Silverlight application in the Solution Explorer, select Properties and  temporarily enable the WCF RIA Services by selecting the web project in the WCF RIA Service link.

 image

Then rebuild the solution find and copy the WebContext class in the file [YourServerAssemblyName].g.cs in the afore mentioned folder to a new file WebContext.cs somewhere in the Silverlight application project.

Now right click on the Silverlight application in the Solution Explorer again and select <No Project Set> in the WCF RIA Service link and rebuild again. "Generated_Code" folder content will be removed.

This is kind of a hack and I believe it could be solved if the WCF RIA Services Class Library template will check if the WebContext exists in the Silverlight application and if not exist it will generate it.

Update (4/26/2010)

If you move the WebContext.cs file to the WCF RIA Services library client make sure to update your app.xaml with the following:

<app:WebContext>
            <app:WebContext.Authentication>
                <appsvc:FormsAuthentication
DomainContextType="[TheNamespaceOfYourRIALibrary].AuthenticationContext,
[TheNameOfYourRIAClassAssembly ], Version= [X].0.0.0"/>
                <!--<appsvc:WindowsAuthentication/>-->
            </app:WebContext.Authentication
   </app:WebContext
posted on Tuesday, April 20, 2010 6:56:54 PM UTC  #    Comments [0]
# Sunday, April 18, 2010

Digging through my old backups I found the following application that was one of the first I built using Visual Studio for a private investigation firm way back in 1997:

clip_image001[8]

 

It has been a long love-hate relationship with Visual Studio. Happy Birthday Visual Studio!

posted on Sunday, April 18, 2010 5:41:08 PM UTC  #    Comments [0]
# Saturday, April 17, 2010

I completed the upgrade to VS 2010 but with some warnings. Apparently nothing important.

image

[04/16/10,16:44:37] Microsoft Visual Studio 2010 Professional - ENU: [2] WARNING:Warning 1946.Property 'System.AppUserModel.ExcludeFromShowInNewInstall' for shortcut 'WinDiff.lnk' could not be set.

[04/16/10,16:44:37] Microsoft Visual Studio 2010 Professional - ENU: [2] WARNING:Warning 1946.Property 'System.AppUserModel.ExcludeFromShowInNewInstall' for shortcut 'OLE-COM Object Viewer.lnk' could not be set.

[04/16/10,16:44:38] Microsoft Visual Studio 2010 Professional - ENU: [2] WARNING:Warning 1946.Property 'System.AppUserModel.ExcludeFromShowInNewInstall' for shortcut 'Manifest Generation and Editing Tool.lnk' could not be set.

[04/16/10,16:44:38] Microsoft Visual Studio 2010 Professional - ENU: [2] WARNING:Warning 1946.Property 'System.AppUserModel.ExcludeFromShowInNewInstall' for shortcut 'Install Microsoft FXCop.lnk' could not be set.

***EndOfSession***

 

Here is my list: (I removed Visual Studio 2005 but not 2008)

image

UPDATE

Later today (4/17/2010) I noticed the following entries in the Application Event Log:

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetEntityDataModelVB_ASPNET.zip), file (ModelObjectItemVB_ASPNET.vstemplate). Invalid template element (TemplateID) value (Microsoft.Data.Entity.Design.VSTemplate.ModelObjectItemVB_ASPNET).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\CSharp\1033\AdoNetEntityDataModelCSharp_ASPNET.zip), file (ModelObjectItemCS_ASPNET.vstemplate). Invalid template element (TemplateID) value (Microsoft.Data.Entity.Design.VSTemplate.ModelObjectItemCS_ASPNET).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetDataServiceVBWebsite.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\VisualBasic\1033\AdoNetDataServiceVBWebsite.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\CSharp\1033\AdoNetDataServiceCSharpWebsite.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\Web\CSharp\1033\AdoNetDataServiceCSharpWebsite.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\VisualBasic\Web\1033\AdoNetDataServiceVBWap.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\VisualBasic\Web\1033\AdoNetDataServiceVBWap.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033\AdoNetDataServiceCSharpWap.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

Error in Template (C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\Web\1033\AdoNetDataServiceCSharpWap.zip), file (WebDataService.vstemplate).  Unknown attribute (_locID).

 

Although all these Item Templates where present, I ran "DevEnv.exe /installvstemplates" from an Administrator Visual Studio Command Prompt (2010) just in case.

posted on Saturday, April 17, 2010 4:23:50 AM UTC  #    Comments [0]
# Tuesday, February 16, 2010

 

For professional health providers who need to concentrate on providing the best solution to patient's health problems, the Medical Facility Manager is a health information management system that provides a single point of access to the practice information to providers, patients and vendors. The system will store all internal and external transactions within the facility by keeping record of every interaction between patients and providers including accounting. The system will save facilities 40 percent of clerical costs in the first year of use by allowing patients to self-register, schedule appointments and retrieving tests results online. Furthermore it will allow facilities to save on accounting costs since it implements claims, billing, payroll and general accounting tasks by using The Accounting Engine. Unlike the current antiquated systems with poor security record and insecure slow manual systems, Medical Facility Manager implements state of the art security and backup sub-systems and will comply with federal and state government security and reporting requirements.

clip_image002

posted on Tuesday, February 16, 2010 4:54:55 PM UTC  #    Comments [0]