Atlanta .NET Regular Guys

Community Blog for two guys in Atlanta that focus on Microsoft and Community.

Quick About

This is the community blog for Brendon Schwartz and Matt Ranlett.  If you want to see their technical posts visit http://www.sharepointguys.com

Back To DevCow

Recent Posts

Tags

Email Notifications

    Archives

    Programming

    WebVisions: Atlanta Web and User Experience conference–Nov 17-18

     

    map_atlantaWebvisions is bringing its three city US conference to Atlanta on November 17th and 18th at the GA Tech hotel and conference center.  Costs under $450 to attend with several pricing options available.

    Web & Mobile Design, Technology and UX Conference - WebVisions

    Stay tuned to this one folks – seems like a great conference with some really interesting presenters.

    A threefer at the Atlanta MS Pros User Group meeting tonight

    Logan Gray (@intensetech) of Intense Tech Inc (www.intensetech.com) gave the first of three presentations tonight.  Focusing on Windows Home Server, Logan tried really hard to convince everyone that this is the next technology purchase they need to make.  Find an example ready-built HP EX487 hardware chassis for under $500 on Amazon.com.  The entire point is to backup and protect your important data files, photographs, and music.

    Abbey Gwayambadde (@ophedian) talked about home automation and about how much things have changed since the X10 home automation presentations we saw a few years ago.   Common targets for automation include lighting, audio and video distribution, HVAC, irrigation, security, and even automobiles!  Companies such as Insteon and Zigbee have begun producing reliable and high quality components.  Check out the components and software from mControl at http://www.embeddedautomation.com/ for a complete picture of how cool this can be.

    Jim Wooley (@LinqKinq) from http://www.thinqlinq.com/ was the third batter in the lineup, presenting about the scalability considerations of Linq.  Revealing coding techniques such as proper ordering of a simple Linq query to improve performance by orders of magnitude.  For example:

    Dim Ordered1 = (from num in randnums
                    order by num
                    where num <10).ToList
    Total time: > 6,000,000 ticks

    Dim Ordered1 = (from num in randnums
                    where num <10
                    order by num).ToList
    Total time: > 188,000 ticks

    Additional scalability and performance considerations include multi-threaded and even multi-cluster server processing centric programming with AsParallel and DryadLinq.

    Debugging a WCF Data Services problem

    I was asked to help out with a problem with the deployment of a multi-tiered application from the development environment (where everything works) to the QA environment.  The basic issue is that where everything works in the development environment, the QA environment is rejecting connection requests to the WCF Data Service.  The exception returned is a “401-Unauthorized: Access is denied due to invalid credentials”

    Debugging steps we took:

    Step 1: from the client machine, try to ping the remote server.  Expected result – successful return of ping test

    Step 2: validate via simple console application that the issue is reproducible as working in dev and broken in QA

    Step 3: check the QA server’s logs (application, security, and IIS logs) to find the exact error codes.  FYI, some development machines don’t have the IIS logging feature turned on. Follow these instructions to do so.

    Step 4: Find nothing especially useful so turn to Bing and Google, where the most relevant page is this totally useless forums post: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/4065e321-d605-4cd7-8399-c5ebf2e0021c/

    Step 5: Casting about in the dark, try creating a new test function in the service itself so that the GET service attempts to do the update for us – thereby eliminating the SQL connection as the potential problem.

    Step 6: Last ditch effort – validate that the Services folder allows EVERYONE full control and retest.  SUCCESS!  Back out the EVERYONE user and put in the AppPool user so that we’re running in more of a Least Privileges manner (slightly…who can identify the security hole here?).  SUCCESS continues.

    In this particular case, the issue turns out to be that the AppPool user requires Modify permissions to the .svc file on the file system.  Why?  No idea!  We simply found that the Domain Users with Read & Execute permissions was an insufficient setting.

    Martin Fowler speaking in Atlanta

    Neato Martin Fowler – author of must read books such as Refactoring: Improving the Design of Existing Code and more – is coming to Atlanta on the 29th this month.  Sign up for a spot and even submit a question or two ahead of time.

    Register

    http://connect.thoughtworks.com/ATLTWMFTechnologyForum/

    Want to try out ASP.NET 4 and Visual Studio 2010 for FREE

    Check out this offer from MaximumASP if you are interested in a free BETA Hosted account.

    MaximumASP Partners with Microsoft to offer Free Beta Hosting Accounts for ASP.NET 4 and Visual Studio 2010

    LOUISVILLE, Ky.--MaximumASP, the premier Windows-based hosting and managed IT services provider rolled out FREE ASP.NET 4 and Visual Studio 2010 hosted beta accounts based on the new MaxESP platform.

    Beta users can create a website and test it out in a scalable environment by utilizing an included Dynamic Capacity Upgrade (DCU). Beta accounts are hosted on Windows Server 2008 R2/IIS 7.5, .NET Framework 4 Beta 2, and come with 1GB Disk Space, 50 MB SQL Server 2008 database, MS Deploy Access and FTP over SSL Access.

    Interested developers are welcome to sign up at http://aspnet4beta.maximumasp.com/.

    What's new in ASP.NET 4 Beta 2 and Visual Web Developer?

    The .NET Framework version 4 Beta 2 includes enhancements for ASP.NET 4 in targeted areas. Visual Studio 2010 and Microsoft Visual Web Developer Express also include enhancements and new features for improved Web development.

    There are many exciting changes in ASP.NET that are coming in .NET 4:

    • Out of the box support for ASP.NET MVC 2
    • Dynamic Data
    • Improved AJAX and CSS Support
    • Improved core services and
    • One Click Publishing

    About MaximumASP

    MaximumASP, based in Louisville, Kentucky, was founded in 2000 as an outsourcing firm for Windows-based hosting services. MaximumASP was named by Microsoft as its 2009 Hosting Solutions Partner of the Year. The company currently hosts more than 50,000 domains for customers in over 120 countries. With a strong focus on hosting solutions that combine advanced monitoring and management tools, MaximumASP has become a top choice for Microsoft developers seeking a robust hosting platform for mission-critical web applications. For more information, visit www.maximumasp.com.

    The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

    Atlanta MS Pros - Migrating from Linq to SQL to the Entity Framework, according to Jim Wooley

    CroppedStitch

     

     

    Last night we had about 60 people at the Atlanta MS Pros user group listening to Jim Wooley talk about the migration path developers currently using Linq to SQL might use to move to the Entity Framework.  Jim has some deep history with Ling, including being the coauthor of the Manning Press book Linq in Action

    After the informative meeting, nearly 20 of us wandered over to the local Miller’s Ale House to continue our socializing over beer and enormous mounds of the Ale House’s famous Chicken Nacho’s

    Don Browning shows Visual Studio 2010 to the Atlanta Microsoft Professionals

    Don Browning from Turner Broadcasting came out of the fun buildings which bring you the Cartoon Network (and those other channels) to talk to the group about the new architecture features of Visual Studio 2010.  Those changes include:

    • 6 new designers
      • case model – a visual view of user stories (including dependencies) backed to TFS (2008 or 2010) work items
      • class diagram – UML class designer NOT tied to code so you can make changes without messing up code
      • activity diagram – looks like a flowchart to show logic
      • sequence diagram – across a given span of time, what objects get used or come into play
      • component diagram – helps you define service interactions
      • Layer diagram
    • architect explorer – architectural view of code supporting class view and solution view
    • model explorer – model elements that are reusable are listed in the model explorer, which is a repository model of elements
    • code analysis visualizations – a static analysis turned graphical including graph mode, force directed mode, and matrix mode.
    • Integration with TFS – supports the storage of model elements in TFS and can be tied to work items.

    The talk was clearly popular as we had a huge turnout at about 65 people!

    AMP sees VS2010

    Atlanta MobileCamp later this year

    Url: http://www.mobilecampatlanta.org/
    Cost: TBD
    Twitter: MobileCampAtl

    Currently you can follow them on Twitter: http://twitter.com/MobileCampAtl if you want more information or to keep up to date with them.

    Also to get more info you can email

    jonathan [at] mobilecampatlanta.org

    DevCow calendar now up to date

    If anyone doesn't know, the DevCow calendar is actually manually updated every month.  I have been updating the calendar for about 3-4 years now every month.  The process I take is to go directly to the websites of the user groups that we list on the site and make sure they are having a meeting for the month.  Sometimes if the web site is not updated but I know the user group leader personally I will update the calendar based on what they tell me.

    Recently I have been busy and the calendar has been one of those things to get behind.  I have always wanted to automate some of the calendar, but that would still require a person to enter information at some point in time so it can only be as up to date as the knowledge or the group.

    The reason I am letting you know this is because many of the groups have mailing list you can subscribe to.  This will allow you to make sure from the user group leader the exact details of the meeting.  I will get the calendar back on track now and hopefully we won't get behind again.  Sorry for the delay.

    Correct way to add Site Copyright line in Graffiti CMS

    It is very easy to add the copyright information to the page in a Graffiti CMS view, but the default new theme template adds the following

    Add copyright information:

    $data.Site.Copyright

    You should update your templates with the following lines that will only display if you have copyright information, otherwise if the copyright information is empty it will display $data.Site.Copyright.

    Better line:

    $!data.Site.Copyright

    Add Login link to home page with Graffiti CMS

    After installing Graffiti CMS I found it difficult for end users to know where to log in.  Go ahead don't read the document called Readme.htm and see if you can find out where to log in.  Well after learning a little bit about Graffiti CMS I found out how easy it would be for me to add it.

    Start by clicking Personalize on your current theme and add the follow lines of code to your HTML.  You can obviously change it as you see fit.

    #if($macros.IsNull($user.ProperName))
            <b>You are not Logged in!</b> <br />
            Do you want to <a href="/graffiti-admin" mce_href="/graffiti-admin">Log in</a>
    #else
            $user.ProperName
    #end

    Here is how it looks and so simple.

    Login Script In Action

    SharePoint Delegate Controls in SharePoint 2007 - Best Practices

    SharePoint Delegate Controls: What EVERY SharePoint developer should know, but most do not.

    Every time I talk to someone about SharePoint 2007 development, I ask them if they know about SharePoint delegate controls.  Almost all of them have said no at first. LEARN THEM!

    I feel this is one of the most important features of SharePoint 2007 if you are doing any type of customization or skinning.

    A delegate control is user control that has a predefine space on a page that can be changed by turn on or off a feature.  The stock example used is, if you want to change the search area you could upload a feature with a user control to replace it with your own.  Delegate controls are based on numbered sequences with the lowest being displayed.  Yours just has to be the lowest.

    Looking on the web there are some good resources to get you started

    A couple rules of thumb that I use, but some have no real technical reason. These are just some best practices for delegate controls:

    1. When designing your page, create delegate controls for functionality that might change over time. (i.e. the search box like Microsoft did)
    2. Don't over use delegate controls. You will find once you understand them you will want to use them everywhere.
    3. Number 3 is my most important rule, you should have 3 delegate controls on every page.
    4. Don't put too many delegate controls in a single feature, remember they all deploy together. (light up/turn off together)
    5. Keep good track of the sequence and don't put the number too low.  You don't want to have trouble overriding the feature in the future.

    Most people always give me a hard time about number 3 because there are no technical reasons to have 3 delegate controls on a page.  The reason I think this rule holds true is because on most pages you will have a search area (1 delegate control), navigation data source (2 delegate controls), and then you might have your own for the functions of your application (3 delegate controls).  Every application will be different, but I think you will find that in your application you will have 3 or more delegate controls per page.

    Here are some areas that could use some improvement going forward with delegate controls.

    1. A user interface page in the site settings to manage delegate controls for the site.
    2. The ability to create a delegate control container on the fly out of the box.
    3. Adding a new control ID to a site from the user interface. (i.e. <Control Id="ControlArea" Sequence="25" ControlSrc="~/_ControlTemplates/AddedControl.ascx" />)
    4. Have the ability to change the sequence number of the loaded delegate controls on the fly though the user interface.
    5. Be able to change a delegate control sequence per site within the user interface.
    Error Type Not loading when building custom web services in SharePoint 2007

    If you have followed the steps in the MSDN article http://msdn2.microsoft.com/en-us/library/ms464040.aspx or used the blog post http://blogs.ittoolbox.com/km/sharepoint/archives/creating-a-custom-web-service-for-sharepoint-13553 you may have run into an error that looked like the follow:

    Could not load type 'DevCow.SharePoint.WebServices.HelloBrendon' from assembly 'DevCow.SharePoint.WebServices, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bf7fa58d7195484e'

    Error Message

    You might find it strange that nothing is in the eventlog or the SharePoint log, so for a new person or even skilled person this would give them no idea of what to change.

    There could be a couple of reasons.

    1. The class might not be in the assembly.  To fix this just add the right reference to the class.
    2. I couldn't find the real problem, sorry there is no magic fix yet.

    Here is what I did to fix number 2

    1. I added this the AssemblyInfo.cs file

      using System.Security;

      [assembly: AllowPartiallyTrustedCallers()]
    2. Rebuilt the Class file.
    3. Ran IISReset.
    4. Redeployed my files to the server.
    5. Navigated to the file http://sharepoint.devcow.com/_layouts/DevCowSampleWebService.asmx
    6. Removed the added code from AssemblyInfo.cs
    7. Rebuilt the Class file
    8. Ran IISReset.
    9. Redeployed my files to the server
    10. Navigated to the file http://sharepoint.devcow.com/_layouts/DevCowSampleWebService.asmx and it still worked.

    I am sorry that I don't have more helpful information for this problem, I know it can be frustrating if you do have the error.

    Now I am having trouble recreating the problem, but I know I saw it.  If you are having trouble please email me to try to figure this problem out.

    I'm sick of problems with STSADM and MAKECAB

    You tell them to do things and they partly do it.  My gripe with MakeCab is that the files in the CBA archive (or wsp) don't use the same date stamp as what Windows Explorer uses.  Building a DLL and as part of a post-build step you're putting the new DLL into the CAB file?  Wouldn't it surprise you when the DLL in the new CAB file has a date weeks or months old?  It sure surprised me!  Leads to all kinds of confusion as to whether or not you are about to deploy the correct code.

    As for STSADM - why doesn't it deploy from a batch file correctly?  I'm running the fairly standard set of RETRACTSOLUTION, DELETESOLUTION, ADDSOLUTION, DEPLOYSOLUTION commands with the EXECADMSVCJOBS sprinkled throughout in the correct places.  I'm deploying to a single server.  Why would it fail to delete the old stuff or worse yet, delete the old stuff and not deploy the new stuff?  So frustrating!  This annoys me so much b/c the "admin" can't figure out what happened and so I have to handle the deployment every time - I can't just say "Double-click this batch file and you'll be upgraded".

    [I originally wrote this post weeks ago but it hit me again recently so I felt the rage all over again - hence the post]

    Debug SharePoint macro

    I've been working recently on a lot of code which needed debugging inside of SharePoint.  One of the frustrating aspects of SharePoint development is the annoying debugging story.  Click Debug, click Attach to Process, click your desired process(es), click Attach, click OK on each process popup...  That's a lot of clicking to debug.  So I put together a quick little macro for Visual Studio which allows me to attach to any running SharePoint process AND any of the development web server apps (those little things in the system tray) so that I can debug with a simple key combo (CTRL+SHFT+A, P).  BTW - I totally stole this idea from like a dozen different authors which I forgot to write down so I can't give proper credit (sorry guys - not intentional), but I did modify the code so it fit my needs (both SharePoint and the dev web server at once).  I frequently bounce IIS, hit the target web page, then run this:

    Open Visual Studio, open the Macro Explorer, and put in the following code:

    Sub Attach2ASPNetWP()
        Dim attached As Boolean = False
        Dim proc As EnvDTE.Process
        Dim processToAttachTo As String

        ' name of the process to attach to
        processToAttachTo = "WebDev.WebServer.EXE"

        ' iterate through all processes running on the local machine
        For Each proc In DTE.Debugger.LocalProcesses
            ' if the last [X] characters of the process name = name of the process...
            If (Right(proc.Name, Len(processToAttachTo)) = processToAttachTo) Then
                ' appach to the process
                proc.Attach()
                ' set a flag that we've attached to the process & exit the for loop
                attached = True
                ' Exit For
            End If
        Next

        ' now attach to the second process name
        Dim secondProcessToAttachTo As String
        Dim proc2 As EnvDTE.Process

        secondProcessToAttachTo = "w3wp.exe"

        For Each proc2 In DTE.Debugger.LocalProcesses
            If (Right(proc2.Name, Len(secondProcessToAttachTo)) = secondProcessToAttachTo) Then
                proc2.Attach()
                attached = True
            End If
        Next

        ' if macro didn't find process running, notify user
        If attached = False Then
            MsgBox("Neither " & processToAttachTo & " nor " & secondProcessToAttachTo & " is running right now")
        End If
    End Sub

    Note - this does need to be adjusted b/c it attaches to ALL SharePoint w3wp processes, not just your target process.  For an easy way to identify the CORRECT SharePoint worker process to attach to, check out Doug Ware's helpful tip over on his blog at eLumenotion

    More Posts Next page »