Access denied error with MVC site

If your new MVC site throws an access denied error you probably don’t have windows authentication setup.

The first thing is checking if you are hosting your site on IIS 7 or better. (Otherwise this section won’t help).
Right click on your project in Visual Studio, click Properties.
Click the web tab.

Open IIS Manager (Start –> Administrative Tools –> Internet Information Services (IIS) Manager).
Navigate to your website (usually Default Web Site) and click on it.

Double click Authentication.
If you don’t see Windows Authentication then it’s not setup.

See this post about enabling windows authentication.
(You may need to close IIS Manager and reopen it).

4. In the Actions pane, click Enable to use Windows authentication.

5. On the Authentication page, select Anonymous authentication.

6. In the Actions pane, click Disable to disable anonymous authentication.

Here is how to enable windows authentication on IIS Express in Visual Studio 2012.
1. Click on your project in the Solution Explorer to select the project.
2. If the Properties pane is not open, open it (F4).
3. In the Properties pane for your project:
a) Set “Anonymous Authentication” to “Disabled”.

b) Set “Windows Authentication” to “Enabled”.

[tweetmeme only_single=”false”]

How to setup windows authentication on Windows

Here on the steps to enable windows auth on Windows 7:
a) In Control Panel open “Programs and Features”.

b) Select “Turn Windows features on or off”.
c) Navigate to Internet Information Services > World Wide Web Services > Security
and make sure the Windows authentication node is checked.

To enable Windows authentication on Windows Server:
a) In Server Manager, select Web Server (IIS) and click Add Role Services.
b) Navigate to Web Server > Security
and make sure the Windows authentication node is checked.

[tweetmeme only_single=”false”]

How to offer remote assistance with Windows 7 on your network

1) Go to your start menu and type “assistance” in the search box (see below).

2) Windows will find the Windows Remote Assistance program.
Select that program.

3) You will now have 2 choices, ask for assistance or offer assistance.
Choose the second choice “Help someone who has invited you” (Doesn’t matter that no one has invited you.)

4) On this screen click the link, “Advanced connection option for help desk”.

5) Now you can type in a computer name or ip address (and it will keep a history of what you previously entered).

6) Click Next and it will start a remote assistance session.

[tweetmeme only_single=”false”]

How to add a content editor web part to a SharePoint page

Here is some code to add a content editor web part to a page. So if you are creating a page in code (like during feature activation), then you put a content editor web part on the page.

Setting the InnerText (contentXMLElement.InnerText = “”;) will set the text in the content editor, incase you want something to be there by default.  User HTML.

using (SPWeb webSite = SPContext.Current.Site.OpenWeb(SiteToOpen))
using (SPLimitedWebPartManager mgr = webSite.GetFile(“default.aspx”).GetLimitedWebPartManager(PersonalizationScope.Shared))
if (mgr != null)
# region AddNewLink

ContentEditorWebPart cewp = new ContentEditorWebPart();
cewp.AllowClose = false;
cewp.AllowEdit = false;
cewp.AllowHide = false;
cewp.AllowMinimize = false;
cewp.ID = “ContentEditorWP”;
cewp.Title = “Content Editor Web Part”;
cewp.ChromeType = PartChromeType.None;

//Add content to the content editor web part
XmlDocument addNewXMLDoc = new XmlDocument();
XmlElement contentXMLElement = addNewXMLDoc.CreateElement(“Root”);
contentXMLElement.InnerText = “”;
cewp.Content = contentXMLElement;
cewp.Content.InnerText = contentXMLElement.InnerText;

// add the web part.
// first argument: web part object
// second argument: zone
// third argument: index (location within the zone)
mgr.AddWebPart(cewp,”left”, 0);

# endregion


Tweet from Outlook

Outlook is the one application I have open all day long.  I don’t like most twitter apps.

So I was happy to find an add-in for outlook that will tweet for you.  It can stuff all your new tweets in a folder (or your inbox) and you can save everything you tweet in a folder (like sent mail)

If puts a new toolbar in Outlook.




Here is the link

VS copy instead of paste problem

So in Visual Studio when accidently copy (ctrl-c) instead of paste (ctrl-v) you lose what was on your clipboard.

Quite annoying behavior, but you can fix it.

Tools-> Options –> check Show All Settings –> expand the Text Editor node –> select All Languages –> under Settings –> clear the Apply cut or copy commands when there is no selection.

This will change the behavior in visual studio to work like word when it comes to copy and paste.



This is a tip I read about in the Code magazine for Jan/Feb 2009.

Technorati Tags: ,,

Variations quit propagating

Technorati Tags: ,

If variations quit working, the it could be the relationship list (hidden list in the root site) could be corrupt.
This could happen when you copy sites/pages from the target site back to the source site.

The easiest way to fix is run the variations editor.

You have to run the tool on the front end server (just on one of them if you have multiple, SharePoint will propagate the changes to any other front end servers).  You just download the zip file and extract the files to a folder, it doesn’t install anything there is just a .exe (SharePoint Variations Editor.exe) file to run.

You have to enter the url for your site (ex,, then click the scan button (next the text box you entered the url, looks kind of like a site icon).

It will scan all your sites (progress bar (with % complete) at the bottom) and show your site structure.

The very last 2 nodes will include any warnings or errors.

For each error on a page, select the page, check the check box, then click green button in the toolbar.

For each error on a site, you will need to look up that site’s group in the hidden relationship list (http://demo/Relationships%20List/AllItems.aspx).  Look for that site in a different variation and get the group id from that site.  You will have to rescan after making these changes.

After that propagation will continue to work and any page not propagated will be propagated to the target sites.

This blog summarizes a couple of other blogs I learned from (I want to give credit where credit is due.)