Piers's Blog
in

dotnet.org.za

South African .NET Developer Portal

Piers's Blog

throw new WhishForException(Action.GoAway,Period.ComeBackAnotherDay);
  • 'Office Developer Webcast Series'

    The Office Platforms Team has begun a new series of webcasts for Microsoft Office System 2007
    hosted by the experts themselves.These webcasts provide great depth on the massive amount
    of new features in Microsoft Office System and the great tools support built in and available
    through Visual Studio and the new VSTO tools.

     

    7/11/2006

    Overview of Developer Technologies for Windows SharePoint Services

    Mike Ammerlaan

    7/12/2006

    ARCast: Hey Architects! Meet the 2007 Office System

    Ron Jacob

    7/18/2006

    Developing SharePoint Workflows Using Visual Studio 2005

    Eilene Hao

    7/19/2006

    Designing Collaborative Business Processes with the 2007 Microsoft Office System

    Atanu Banerjee

    8/8/2006

    Introduction to Visual Studio Tools for the 2007 Microsoft Office System

    Eric Carter

    8/9/2006

    Integrating Your Solutions with the 2007 Microsoft Office System User Interface

    Savraj Dhanjal

    8/15/2006

    Developing, Deploying, and Hosting Rich Office InfoPath 2007 Client and Browser Forms

    Pradeep Rasam

    8/22/2006

    Building Collaborative Applications Without Code Using Office SharePoint Designer 2007

    Rob Mauceri

    9/5/2006

    Extending the Web Content Management Features of Office SharePoint Server 2007

    Jim Masson

  • “Live from Redmond”

    The .NET Framework groups are offering another series of Live Meeting presentations called “Live from Redmond”. These talks are given by product team members so it’s content directly from the program managers and developers on the team.  The previous set was very popular.

    Here are the links, if you have the bandwidth, enjoy -Piers

    List of client talks:

     

    Date

    Title

    Speaker

    Registration URL

    16-Aug

    Smart Client: Offline Data Synchronization and Caching for Smart Clients

    Steve Lasker

    Click here

    23-Aug

    Windows Forms: An Overview of Windows Forms in Microsoft Visual Studio 2005

    Saurabh Pant

    Click here

    30-Aug

    Visual Studio: Developing Local and Mobile Data Solutions with SQL Server Everywhere

    Steve Lasker

    Click here

    13-Sep

    (WinFX) Windows Forms: How to Leverage Windows Forms and Windows Presentation Foundation in a Single Hybrid Application

    Scott Morrison

    Click here

    20-Sep

    Windows Forms: Solutions to the Most Common Windows Forms Development Challenges

    Scott Morrison

    Click here

     

    List of web talks:

     

    Date

    Title

    Speaker

    Registration URL

    25-Jul

    ASP.NET: An Overview of ASP.NET and Windows Workflow Foundation Integration

    Kashif Alam

    Click here

    3-Aug

    ASP.NET: Building Real-World Web Application UI with Master Pages, Themes and Site Navigation

    Pete LePage

    Click here

    10-Aug

    ASP.NET: Creating Web Applications Using Visual Studio 2005 Team System

    Jeff King

    Click here

    17-Aug

    ASP.NET Atlas: A Developers Introduction to Microsoft Atlas

    Joe Stagner

    Click here

    22-Aug

    Best Practices and Techniques for Migration Visual Studio 2003 Web Projects to Visual Studio 2005

    Omar Khan

    Click here

    24-Aug

    ASP.NET: An ASP.NET Developer’s Look at Using RSS

    Joe Stagner

    Click here

    7-Sep

    ASP.NET: Under the Covers - Creating High-Availability, Scalable Web Applications

    Stefan Schackow

    Click here

    14-Sep

    ASP.NET: Using User, Roles, and Profile in ASP.NET 2.0

    Joe Stagner

    Click here

    21-Sep

    ASP.NET: Comparing PHP and ASP.net

    Joe Stagner

    Click here

    28-Sep

    ASP.NET: Security Tips & Tricks for ASP.NET Developers

    Joe Stagner

    Click here

     

    List of Commerce Server talks:

     

    Date

    Title

    Speaker

    Registration URL

    1-Aug

    Multi-Channel, Connected Commerce (BTS/CS integration)

    Caesar Samsi

    Click here

    15-Aug

    Commerce Server 2007 Overview

    Mark Townsend

    Click here

    12-Sep

    Commerce Server 2007 Architectural Deep-Dive

    David Messner

    Click here

     

    List of .NET Compact Framework talks:

     

    Date

    Title

    Speaker

    Registration URL

    29-Aug

    .NET Compact Framework 2.0: Optimizing for Performance

    Ryan Chapman

    Click here

  • Mutex and Terminal Services

    Not been here in a while just thought this might be of some use.

    Right so am working on a solution that requires the use of a system Mutex, problem is the solution is going to be run through Citrix due to constraints in the client environment.

    Terminal services does wonderful things to a Mutex. Seems a mutex is not (by default) a 'Global' mutex.So the solution ? MARK the Mutex as global by pref like this :

    "Global\"

    But this doesnt solve all my issues next I have to get around the security on a Mutex. Normally this is not an issue as Mutex's are mostly used within a service which runs as a specfic user, however in this case integrated security will be used so the first user to create the Mutex will own it. So to allow anyone to access the mutex i have to open it up with a nice little API call.

    c# Assuming i had already created the Mutex, I could just pass it through to my method to clear out the security in the System objects DACL.

    [DllImport("advapi32.dll", SetLastError=true)]
    private static extern bool SetKernelObjectSecurity(int Handle, int SecurityInformation, ref SECURITY_DESCRIPTOR SecurityDescriptor) ;

    [StructLayout(LayoutKind.Sequential)]
    struct SECURITY_DESCRIPTOR
    {
       public byte revision;
       public byte size;
       public short control;
       public IntPtr owner;
       public IntPtr group;
       public IntPtr sacl;
       public IntPtr dacl;
    }

    private const int DACL_SECURITY_INFORMATION = 4;

    private void SetNoSecurityOnMutex (Mutex mutex)
    {
       //Create the security descriptor.
       SECURITY_DESCRIPTOR securityDescriptor = new SECURITY_DESCRIPTOR(); 
       //The only thing required is to set the revision to one and the DACL to IntPtr.Zero
       securityDescriptor.revision = 1;
       securityDescriptor.dacl = IntPtr.Zero;
       //Apply the DACL to the mutex
       if(SetKernelObjectSecurity((int)mutex.Handle,  
          DACL_SECURITY_INFORMATION, 
       ref securityDescriptor) == false)
       {
          throw new SynchronizationLockException("Unable to set security on the mutex, error "   
          +  Marshal.GetLastWin32Error());
        }

    }

    In retrospect i should have conjourd up a better solution then using Mutex's but unfortunatly the Mutex use was already all in. Alas the benifit of hindsight.

    -PM

     

     

     

     

  • Having to run IIS Reset when remoting through IIS

    Oi my second post in like lank long sorry i been buzzzy :o)

    Working on a solution where we are hosting our server side components in iis (remoting). We are using our local dev machines IIS installations during dev.

    Came across an issue when recompiling...  

    The components don't refresh properly in the cache after making a server side change and no matter what we did flushing etc still didn't work. Of course this  results in client (proxy) and server being out of sync.

    I cant believe my solution to this is the best way there has to be some dumb ass setting somewhere however i couldnt find it ?

    Anyway...
    Did some reserch into this on the net, there are a number of solutions to this problem

    1. Post build event on client application calls iisreset - issue resets iis takes lank time
    2. Create separate build configurations to build server and client individually fine a bit trickey to get right also, doing a full build it fails anyway.
    3. Updating the web config or machine config and setting the following in compilation tag

                 numRecompilesBeforeAppRestart="2">

        Problem is you have to build then run twice to get it to work and you cant set the value to 0 or 1 btw: Default is 15  in  Asp.Net.    

    Couldnt find any more quick fix solutions to this on the net so i came up with this one and it seems to work oki dokie.. I used the attrib part to take care of our source control system. All i had to do was add this as a post build event on my client application.

    attrib -r C:\Inetpub\wwwroot\RemotingHost\Web.Config & type C:\Inetpub\wwwroot\RemotingHost\Web.Config > C:\Inetpub\wwwroot\RemotingHost\Web_TMP.Config & type C:\Inetpub\wwwroot\RemotingHost\Web_TMP.Config > C:\Inetpub\wwwroot\RemotingHost\Web.Config & del C:\Inetpub\wwwroot\RemotingHost\Web_TMP.Config & attrib +r C:\Inetpub\wwwroot\RemotingHost\Web.Config

    Basically this forces a restart of the application because the web.config changes default behavior is to restart the application, not the whole of iis.

    Perhaps another solution is to restart an iis application programmatically ?  It appears that it can be done with the httpApplicationClass ? Any idears ? , I suppose you could get the IIS application to restart on an event in the Global.Asax, But the issue there is, the client build would probably die.

    You can make the above cmd into  a batch file or whatever, this only works because the MODIFIED Date changes.

    BTW This opend up another issue for me... How does one change the modified date of a file with out making some nasty api call My above command works because im basically recreating the file.

    a. VBScript cannot change the modified date of a file.
    b. Command line cant either (however there is a little program in the windows resource kits that can, it is called "touch"),
    c. .Net doesn’t seem to be able to with out making an api call, here the VB...   

                Public Declare Function SetFileTime Lib "kernel32" _
                            (ByVal hFile As Long, _
                             lpCreationTime As FILETIME, _
                             lpLastAccessTime As FILETIME, _
                             lpLastWriteTime As FILETIME) As Long

                the link  http://vbnet.mvps.org/index.html?code/fileapi/filedatetime.htm

     

    Any other Idears on how to Restart an IIS application simply

  • OBJECT Cleaner


    http://www.dvxp.com/en/ObjCleaner.aspx

    Cleans out your object directories

    Pretty useful. How often have you had to “find all” on the soln. folder to wipe the obj folders ? I guess you could use a batch file as well ..…

    del
    /ad "BIN" or "OBJ" /s

     

    in a  .cmd in the soln's root.
    if you like, but this tool allows you to select the folder if you wish.

    Posted Nov 15 2004, 08:26 AM by piers with 2 comment(s)
    Filed under:
Powered by Community Server (Commercial Edition), by Telligent Systems