Hi thanks for all the help, I resolved my issue by just reverting the custom 
action back to .net 2 and specifying the correct framework version in my custom 
action configuration file. 

This was the simplest way to support the older installer code. As stated by 
Jacob there wasn't any reason for the custom action to be on runtime 2 as well, 

as updating the plugin to use a newer CAS model for newer versions of office 
was not currently an option.


Kind regards,
Christoffel le Roux


-----Original Message-----
From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com] 
Sent: Tuesday, August 28, 2012 7:30 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Managed Custom Action using CAS

I've never done one of those myself, but a bit of search engine foo shows a few 
potential links 
http://social.msdn.microsoft.com/Forums/eu/vsto/thread/f46b54a0-0fc3-4a76-a47c-aad05e31bb86
 , 
http://social.msdn.microsoft.com/Forums/en/vsto/thread/890cb60c-11f6-4fea-8a44-e520341f3331
 , and 
http://stackoverflow.com/questions/3089567/is-it-possible-to-create-an-office-2003-vsto-add-in-from-visual-studio-2010
 . From the second link I find:

Different Visual Studio Versions
 
1. Visual Studio 2010 supports creating VSTO 3.0 and VSTO 4.0 solutions.
 
2. Visual Studio 2008 supports creating VSTO 2.0 and VSTO 3.0 solutions.
 
-------------------------------------------------------------
 
Different VSTO Versions
 
1. VSTO 2.0 solutions work with Office 2003 and Office 2007
 
2. VSTO 3.0 solutions work with Office 2007 and Office 2010
 
-------------------------------------------------------------

Since you stated you needed an Office 2003 VSTO, I don't think it would be 
possible to have it using the 4.0 framework (for the addin). As such, what 
benefit are you getting by upgrading the CA DLL? If you need the old behavior 
and a new feature then you could have 2 CA DLL's; one targeting 4.0 for the new 
stuff and one targeting 2.0 for the old CAS calls.

If you want to continue to try to get 4.0 to work, then the actual framework 
call that is failing (the source to CustomAction.GetPolicyLevel ) would be 
helpful.


-----Original Message-----
From: Christoffel le Roux [mailto:christoffe...@tech.flowcentric.com]
Sent: Tuesday, August 28, 2012 9:33 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Managed Custom Action using CAS

Hi Jacob, 

Thanks for the reply, I'm installing an office 2003 VSTO project and using the 
custom action which in turn needs the CAS policy methods to register the DLL as 
safe to be consumed by Office.

Kind regards,
Christoffel le Roux


-----Original Message-----
From: Hoover, Jacob [mailto:jacob.hoo...@greenheck.com]
Sent: Tuesday, August 28, 2012 4:22 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Managed Custom Action using CAS

I guess the real question would be do you even need this in .Net 4? 
http://blogs.msdn.com/b/shawnfa/archive/2010/02/24/so-is-cas-dead-in-net-4-or-what.aspx
 What is the custom action trying to accomplish with CAS?


-----Original Message-----
From: Christoffel le Roux [mailto:christoffe...@tech.flowcentric.com]
Sent: Tuesday, August 28, 2012 9:12 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Managed Custom Action using CAS

Hi, I have upgraded an old installer to a wix 3.7 custom action project that 
uses the old CAS policy methods. I've upgraded the solution to runtime 4 and 
resulted receiving the exception

This method explicitly uses CAS policy, which has been obsoleted by the .NET 
Framework.

// Get the policy level.
PolicyLevel policyLevel = CustomAction.GetPolicyLevel("SomePolicyLabel");

In order to enable CAS policy for compatibility reasons,

please use the NetFx40_LegacySecurityPolicy configuration switch. Please see 
http://go.microsoft.com/fwlink/?LinkID=155570 for more information.

Following the link I ended up specifying in the CustomAction.config file to use 
the legacy CAS method overloads.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
        <supportedRuntime version="v2.0.50727"/>
    </startup>
  <runtime>
    <NetFx40_LegacySecurityPolicy enabled="true"/>
  </runtime>
</configuration>

I've tried a bunch of things to resolve the issue but with no luck.

Any ideas anyone?

Thanks in advanced.

Kind regards,
Christoffel le Roux
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to