Welcome to MSDN Blogs Sign in | Join | Help

What Identity with IIS7 and ApplicationPoolIdentity?

With IIS7, we have a little bit more isolation with AppPool Identities

For example, if you’re using the the DefaultAppPool, if you need to assign permissions to NTFS, SQL, etc., what you’d use instead is as follows:

IIS APPPOOL\DefaultAppPool

Where “DefaultAppPool” ends up being the name of your AppPool as shown in IIS Manager…

That is if you’ve set the identity to the “ApplicationPoolIdentity” instead of something else, such as Network Service, Local System, or something other…

Posted by scicoria | 0 Comments
Filed under: , ,

Wildcard Certificates and IIS7

Let’s face it, during development, managing all the certificates if you’re doing anything with validating SSL/TLS traffic is a pain.

Now with Windows Identity Foundation (fka Geneva) we really have to get crackin on getting used to managing certificates, setting up SSL sites, etc.

So, here’s great post on setting up IIS7 to use wildcard certificates…

http://blog.mikeobrien.net/PermaLink,guid,12d9628c-a350-4f7b-a573-9d05429b54e8.aspx

This gives you 1 certificate rooted at some common domain (eg.    mydev.local) where all sites would be site1.mydev.local, site2.mydev.local, etc.  The CN in the certificate ends up being *.mydev.local – just wire up in your hosts file (..\drivers\etc\hosts) and you’re golden…

Posted by scicoria | 0 Comments
Filed under: , ,

Make sure you copy the correct web.config…

During an installation issue, a client followed the TechNet article (http://technet.microsoft.com/en-us/library/cc298447.aspx) and those instructions are misleading.

It indicates to copy the “web.config” to the Layouts directory – what if fails to specify is it should be the “layoutsweb.config” file instead.

While following the article does get you passed the issue that brought you there in the first place, you eventually end up with issues on provisioned sites that reference anything in _layouts are there are sections “<system.web>” that don’t make sense in a IIS path.

Just recopying that correct config file fixes all.

Posted by scicoria | 0 Comments

How did I miss this one – The VirtualPathUtility in ASP.NET

I’ve been writing one off methods that apparently are handled quite well for a few things in the type System.Web.VirtualPathUtility.

For example, if you just want the page name or the extension, you have this utility to quickly get that from the current request path.

http://msdn.microsoft.com/en-us/library/system.web.virtualpathutility.aspx

Posted by scicoria | 0 Comments
Filed under:

Snip-IT Pro – manage all those little code snippets for re-use and sharing…

An old colleague of mine from Avanade has apparently put out a very cool tool for managing re-usable “snippets” of code from a repository.  This is a tool that could be used every day, or even for demos…

This is a smooth application that takes advantage of some the P&P smart client framework.  Quite a professional tool…

The name of the tools is Snip-IT Pro

http://www.snipitpro.com/index.html

It can also managed / retrieve snippets from a hosted service called http://snipplr.com/ along with

Frankly, I can see using this with a simple folder on Mesh (www.Mesh.com)

Posted by scicoria | 0 Comments
Filed under: ,

SharePoint 2010 and Claims Based Awareness

The industry it moving towards identity standards, and with the recent release of Windows Identity Foundation (fka Geneva), and the beta of SharePoint 2010, it’s important to take a look at the direction of how identity is being normalized into a “service” within the SharePoint object model.

With SPS 2010, the SPUser object is now a claims identity.  Identity management has been normalized to a approach that internally uses an STS that takes all “provider” or external STS identities, then creates a SPUser claims identity.  This can have implications for LOB application design.  Even Windows identities are presented within SPS as a claims identity after banging against the SP STS for claims transformation.

Venky Veeraraghavan has a great video up on Channel 9 on how WIF was used to create this model within SharePoint and how we get 1) Identities “In”, 2) Identities “within”, and 3) Identities “out” – specifically, when talking to downstream back-end LOB applications, DB, Web Services, etc.  These are all things WIF and claims based identity is moving the industry. 

This is certainly how we all should be looking at identity management and authentication scenarios.

Get Microsoft Silverlight
Posted by scicoria | 0 Comments
Filed under: ,

SharePoint 2007 and InfoPath 2010 Client – current install issues…

Ok, I’ve been bitten twice in the past week on this.  If you have InfoPath 2010 Beta installed and you’ve also got SharePoint 2007 running, at least with the latest SP2 and October CU, you run into an issue that surfaces in the logs as follows

One or more types failed to load. Please refer to the upgrade log for more details

When you pull that log apart, you’ll see that it’s attempting to load a few types such as Microsoft.Office.InfoPath.Server.DocumentLifetime.XmlFormHost' from assembly 'Microsoft.Office.InfoPath.Server.

Which, they fail – removing InfoPath from the install works.

Posted by scicoria | 0 Comments
Filed under:

Loopback Check on Windows 2008, etc.

This KB article (KB926642) explains 2 methods for handling the scenarios that we as developers require for using a local machine for development.  My option has been, going forward, of being explicitly in the host names that my development machine will use.  From that article:

Method 1 (recommended): Create the Local Security Authority host names that can be referenced in an NTLM authentication request

To do this, follow these steps for all the nodes on the client computer:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
  3. Right-click MSV1_0, point to New, and then click Multi-String Value.
  4. In the Name column, type BackConnectionHostNames, and then press ENTER.
  5. Right-click BackConnectionHostNames, and then click Modify.
  6. In the Value data box, type the CNAME or the DNS alias, that is used for the local shares on the computer, and then click OK.
    Note Type each host name on a separate line.
    Note If the BackConnectionHostNames registry entry exists as a REG_DWORD type, you have to delete the BackConnectionHostNames registry entry.
  7. Exit Registry Editor, and then restart the computer.
Posted by scicoria | 0 Comments
Filed under:

Tongue in Cheek Geek Humor from the PDC

An old colleague (Biff Gaut) of mine has a great daily newsletter from the PDC.  This is certainly targeted for those of us looking for a “light” look at all things new that come out of PDC, but at times very technical with a perspective from someone who has been in the industry for some time (20+ years), started off as a C or C++ developer (not sure how early as I started with C/ASM).

But, as always, with the technical content comes the sometimes dry, humor that only Biff can interweave into the Geek content.

http://www.biffspdcnewsletter.com/2009/PDC2009Day1.aspx

To subscribe, find the email on his page it’s  “editor AT biffspdcnewsletter.com”

To go back a few years, take a look at some of his prescience`:

http://www.biffspdcnewsletter.com/default.aspx

Kind of reminds me of Mr. Bunny’s Guide to ActiveX – which is on my all time favorite reading list – if you know anything about ActiveX in the early days (COM to be specific), then this book is also a great, dry humor read.

Biff, I apologize for the overuse of the word “dry” in this post.

Posted by scicoria | 0 Comments
Filed under: , ,

Cleanup your Features…

Many times, your coding, etc. SharePoint features.  You’ll code something up, deploy, activate, etc. 

Using WSP builder, while a convenient tool, it also leaves some orphans around.  It forcibly deletes the solution leaving any place it’s activate with some “broken features”.

Fortunately, there’s a tool to help you cleanup those orphans.

http://featureadmin.codeplex.com/

 

image

Posted by scicoria | 0 Comments
Filed under: ,

Minor update to the WSS Command Prompt…

 

Take the following and paste into a VBS file – then run.

Still need to choose the Link, then set the “Run as administrator” when UAC is on…

 

Set Shell = CreateObject("WScript.Shell") 
Set Env = Shell.Environment("PROCESS") 
DesktopPath = Shell.SpecialFolders("Desktop") 
Set link = Shell.CreateShortcut(DesktopPath & "\WSS CMD.lnk") 

cssHive = Env("CommonProgramFiles") & "\Microsoft Shared\web server extensions\12" 
currentPath = RTrim(Replace(WScript.ScriptFullName, WScript.ScriptName, "")) 
envBatFile = "setWssPath.cmd" 

CreateBatFile currentPath & setWssPath & envBatFile, cssHive 

link.Arguments = "/k " & " " & Chr(34) & currentPath & envBatFile & Chr(34) 
link.Description = "WSS Command Prompt" 
link.HotKey = "CTRL+SHIFT+W" 
link.IconLocation = "%SystemRoot%\system32\SHELL32.dll,94" 
link.TargetPath = "%comspec%" 
link.WindowStyle = 1 
link.WorkingDirectory = cssHive 
link.Save 
Sub CreateBatFile(fileName, cssHive) 
    Set fso = CreateObject("Scripting.FileSystemObject") 
    Set file = fso.CreateTextFile(fileName, True) 
    file.WriteLine("@SET PATH=%PATH%;" & cssHive & "\bin") 
    file.WriteLine("@ECHO WSS CMD Shell - Shawn Cicoria") 
    file.WriteLine("CD " & cssHive)

End Sub
Posted by scicoria | 2 Comments
Filed under: ,

SharePoint 2010 Developer | Learn | Channel 9

Ted Pattison and Andrew Connell have a bunch of Learning SharePoint 2010 content up on Channel 9.

I can say, having attended Ted’s classes in the past, he’s one of the best to learn SharePoint development from.  He’s been at the forefront of getting to the reality of how to build things while working with the guidelines, rules, constraints of a “managed” platform such as SharePoint. 

If you get a chance take a look at these videos – even better, if you can attend in person, check out http://www.criticalpathtraining.com/ for classes.

SharePoint 2010 Developer | Learn | Channel 9

image

Posted by scicoria | 0 Comments
Filed under: ,

TeamPrise acquired by Microsoft.

TeamPrise – the cross platform “client” for TFS, with Eclipse support (plug-in), command line – has been acquired by Microsoft.

So, we’ve been pushing folks to a 3rd parties to get back to the ALM Mothership – which is by far the best Enterprise class ALM platform that can scale from “1” person (see 2010 TFS) to thousands, geo-distributed – now, we can offer it direct resolving client’s concerns.

Not that the SourceGear guys are of concern, they’ve been around for quite some time.

This is great news.

http://www.microsoft.com/presspass/press/2009/nov09/11-09TeamprisePR.mspx

http://www.teamprise.com

http://www.microsoft.com/pathways/teamprise/

Posted by scicoria | 0 Comments
Filed under: ,

Making a Windows 7 bootable USB…

This get’s even easier.  The Microsoft store has released a utility that will, from an ISO (eg. one you get from the Microsoft Store) create a bootable USB flash drive.

The direct link is here to the description page

http://store.microsoft.com/Help/ISO-Tool

Posted by scicoria | 0 Comments
Filed under: ,

Visual Web Part Designer in Visual Studio 2010

In the October edition of MSDN Magazine, there’s a great article that does a quick rundown of building a component that can be surfaced as a Web Part via the Gallery and placed in Web Part zones on pages.

The article by Steve Fox is here: Steve Fox - Visual Studio 2010 Tools for SharePoint Development – MSDN Magazine October 2009

There’s a couple very important aspect that might not be 100% clear from the title – 1st, you’re really visually designing a User Control (ASCX).  So, this is really just a “visual user control designer and web part cookbook combination deployment helper”…

And 2nd– this all works today, you just don’t get the magical build of the CAML based manifests, feature.xml, DDF, etc. to rapidly get into the “code –> build –> debug –> test –> code” cycles needed to increase the velocity of development.  Well, actually you can – with a couple of 3rd party tools.

I’m not saying this isn’t a good thing – having VS2010 provide this capability.  In fact, what they are providing is industrialization of development patterns into a model that provided directly in the VS 2010 environment that was “cobbled” together either through the VseWss extensions or tools such as WSP Builder.

User Controls

Now, why are User Controls potentially a concern.  In one word “versioning”.  Since, even in the example, most user controls are deployed to the farm into the “12” or “Root” hive of SharePoint – they are Farm based artifacts – in that you get 1 and only 1 of these “ASCX” files to be reused wherever they are statically referenced.

That doesn’t give you true “Side-by-Side” (SxS) installation – which we can get with an Assembly that packages our Server control or Web Part Server control into a strong named that we can explicitly reference at runtime.

That means if you have 2 Web Apps, Sites, whatever, that want to use distinct versions, you have to provide a way to have basically 2 complete “sets” of all these artifacts and using the way the example code was presented, you’d have to come up with a way to put a version name in the “filename”.

So, how would you change the ASCX portion of the component for site #2 and redeploy?  Well, one way is to change the following – which is in your truly compiled class that probably made it into the GAC:  You can change a couple of things – 1st, the name of the ASCX file:

private const string _ascxPath =
@"~/CONTROLTEMPLATES/SampleWebPartProject/ProductInfo/" +
@"ProductInfoUserControl.ascx";

If you change the name of the ASCX file, well, that didn’t buy you much.  Because, all instances across the Farm will still use this.

Option 1

Another way is to change the prefix of the path “~/CONTROLTEMPLATES/” – to something unique.  For that one, in the past I’ve simply use IIS virtual path mapping to a specific feature folder that contains the version name in the folder.  So, for example:

Site1: “~/_MYCONTROLS”  is mapped to   “..\12\TEMPLATE\FEATURE\ControlsV1”

Site2: “~/_MYCONTROLS”  is mapped to   “..\12\TEMPLATE\FEATURE\ControlsV2”

The only difference being that it’s physically mapped to a different location (physical directory) – so at runtime it picks up the mapped version through IIS virtual directory magic. 

This can be automated, creation of process through AppCmd as follows: (I've left out the full 12\14 hive path).

AppCmd.exe ADD vdir /app.name:"LitwareInc/" /path:/_MYCONTROLS /physicalPath:c:\...\FEATURE\ControlsV2

So, what’ve got now is a single assembly, the true “web part server control” instantiating the version you really need. All for just a little bit more on the configuration side.

Option 2

An option that I’d like the template to automatically provide is to externalize the control name (ASCX) file to use at Web Part configuration time through the use of a property on the web part.  This could then be managed through the Web Part property editors that we get for free in SharePoint.

This way at Page or Web Part configuration time, you either explicitly set this property or you provide some default in the code.  So, a property like the following would surface in the property editor allowing an “administrator”. 

So, this is what I’ve done in the past that works:  In the web part define a configurable property as follows:

[WebBrowsable]
[WebDisplayName("Control File Name")]
[WebDescription("Name of the ASCX file in the feature folder")]
[Category("Custom")]
[Personalizable(PersonalizationScope.Shared)]
public string ControlFileName {
    get;
    set;
}

Then change the code in the Web Part class to the following (in fact, this is where you can now have a “universal” User Control loader and just one way to wrap these User Controls from a single GAC deployed Web Part shell

protected override void CreateChildControls()
{
string ctrlPath= @"~/_MYCONTROLS/" + this.ControlFileName;  //maybe validate this - er, does it end in ASCX?
Control control = this.Page.LoadControl(ctrlPath);
Controls.Add(control);
base.CreateChildControls();
}
Posted by scicoria | 0 Comments
More Posts Next page »
 
Page view tracker