doodle dabbles

a little nerdery for everyone

Archive for the ‘microsoft’ tag

WPF Weekend, Part 1: Introducing CID

without comments

Over lunch with my friends at OpenSource Connections last Friday, we had a discussion of how they could attract more people to their booth at the FOSE convention next week in Washington, DC. A recurring suggestion was to have something to dazzle people from a distance.One of the ideas we came up with is to have an eye-catching display, but that only had limited value.

So we decided to show attendees information that is immediately useful to them, such as the conference event schedule.SO this weekend, Michael Herndon from OSC, and myself, started to build what would become CID.

We decided from the beginning to open source the project and host it on Google Code, so that others can benefit and learn from our experience, and also so that it could be extended easily in the future. This series of posts outlines some of the things we learned in the process.

Read the rest of this entry »

Written by Ashish

March 31st, 2008 at 8:02 pm

Posted in Misc

Tagged with , , ,

Executing Office Plugins Across Two Zones

without comments

When building Office plugins, you have to give the right permissions so that the plugins can execute. Depending on your situation, you will have to touch upon multiple security concepts.

One is a Zone. A zone is like the “area” of interest. There are two zones involved in doing this:

  • The location of your plugin (the dll files, etc)
  • The location of the Word/Excel file being opened (*.doc, *.xls, etc)

These zones usually match up (if your plugin is installed on your computer, and you’re accessing an Office document on your hard drive, both locations are the “My Computer” zone).

For my situation, I had the plugin installed in my computer, but the file being accessed was over an untrusted network share, hence the file was placed in the “Internet” zone.

I had my assemblies in C:\Program Files\InstalledAppDir\*
My Word Doc was in: \\networkserver\sharename\something.doc

It triggered the following error:

The customization does not have the required permissions to execute.

************** Exception Text **************
System.Security.SecurityException: The customization does not have the required permissions to execute.
at Microsoft.VisualStudio.Tools.Applications.Runtime.DomainFactory.CreateDomain(Uri evidenceUri, String domainName, String codeBase, String configFileName, IAddinSecurityManager secman)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomainInternal(Uri uriFullDocumentDirectory, Uri uriFullDocFilePath, String documentName, IHostServiceProvider hostCallback, IAddinSecurityManager secman, AppManifest& applicationManifest, Boolean& manifestDirty, IAppInfo& appInfo)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManagerInternal.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)
at Microsoft.VisualStudio.Tools.Applications.Runtime.AppDomainManager.CreateCustomizationDomain(String applicationDomainPath, String documentName, IHostServiceProvider hostCallback, IExecuteCustomization& executor)
The Zone of the assembly that failed was:
MyComputer

I followed this guide and tweaked the following policies a little and it now works:

MyComputer zone:
“FullTrust” permissions to the url: C:\Program Files\InstalledAppDir\*
Internet zone:
“Nothing” permission to the url: \\networkserver\sharename
“FullTrust” permissions to the OfficeDocumentMembershipCondition

Make sure you add the membership collection to the internet zone, even if you are accessing a network share. The easiest way to know the zone (and how I found out) is to look at your status bar when you go to the network share. It’ll tell you what security zone that path is seen as.

Written by Ashish

November 14th, 2007 at 3:51 pm

Posted in Uncategorized

Tagged with , , , ,