DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 1 Aug 2007 01:48:16 +0200,    posted on: microsoft.public.dotnet.framework.interop        back       

Thread Index
  1    Willy Van den Driessche


Office 2007, Office 2003, Vista, interop and publisher policies   
I have a large application that does (some) interop with office 2003.  I 
deploy this app via clickOnce to my customers.
I have now installed Visio 2007 (because I needed a drawing and I wanted to 
see what Office 2007 looks like without disturbing the office applications 
and because I wanted to use my MSDN account for more than Visual Studio).

I added a feature (more like "fixed a 'feature'") to my app and redeployed 
the app.  My customer rang me and complained they now had a message box :

*Unable to install or run the application.
The application requires that assembly office Version 12.0.0.0 be installed 
in the Global Assembly Cache (GAC) first.
Please contact your system administrator*

It didn't take me ten seconds to realize Visio 2007 was at the root of the 
problem.  I used Reflector to see what happened and it showed me my app was 
using office 11 and office 12  interop assemblies.
Since the reference in my project clearly states office 11 I was stunned for 
a moment.  Then I realized .NET allows for publisher policies and yes, there 
is a publisher policy "Policy.11.0.office.dll" which states (in the 
properties) "Publisher policy to load 12.0 assemblies instead of 11.0 
assemblies."
I think that's a great idea. This is the .NET way of Microsoft saying that 
office 12 is upwards compatible with office 11.  What I don't like is that 
the compiler uses this information to force my application to include a 
reference to office 2007 (which most of my clients don't have - neither do I 
for that exact same reason).

So I tried to uninstall the Policy assemblies manually from the GAC.  Access 
Denied.  O yes, this is Vista now, you have to be an administrator.  Still 
acess denied.  If it's installed by an MSI then that MSI will decrement the 
reference count, not you.  Grumph.   Opened the Visio install looking for 
what looks like programming and .NET.  I now still have 2 policy files left 
(unfortunately Policy.11.0.office.dll is among them)

Why this story ? It's my unlucky combination that makes things not work :
- if Microsoft hadden't installed a publisher policy in the GAC, this 
wouldn'ty have happened in the first place.
- if the .NET compiler would not have interpreted the policy, things would 
have been great.
- if Vista would allow me to uninstall the policy files manually (trust me I 
now what I'm doing ...)
- if Visio was still not part of Office ...
-....

If if if.  Now I will uninstall Visio 2007 (still need the drawing though) 
and install Visio 2003 hoping for better news (If I can still download it 
from the MSDN site that is)
Date:Wed, 1 Aug 2007 01:48:16 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us