> Thanks for the reply. There are some finer points of all this
> that I'm missing. I've added some clarifications/answers. It
> just seems that I should be able to create a policy assembly
> directly as the result of buiding a VS.Net project. I've read
> as much in the book Distributed .NET Programming in C# but
> insufficient info was supplied to get it work. I'm not sure
> what I'm missing.

Well as many times as I've tried creating a publisher policy from VS.NET,
it's never worked because VS.NET only supports embedding resources into
assemblies, not linking them.

> No references per se but a deployment project project with
> library project output references. I'm using a mergemodule
> project to deploy the resulting policy assembly (dll) to the
> GAC; not a script and gacutil. The policy assembly is
> referenced by the mergemodule and the mergemodule's
> retargetable folder is set to deploy to the GAC.

Not sure why you'd be having problems; have you considered setting the
publisher policy DLL and CONFIG file to Content files, and adding the
Content files from your project to the GAC instead of directly pointing to
the file location?

> 2. It has to be a "linked resource" or "external resource" to
> an assembly, which is what the /linkresource switch does. It
> keeps the .config file outside of the assembly but creates an
> entry in its manifest to the external resource.
>
> I can tell you that my policy assembly redirects appear to
> work properly as I'm buiding them as described. Below is an
> excerpt from the Al.exe doc. It seems to imply that linking
> the resource at the time of build does embed the resource the assembly

Nope, /embed embeds the resource into the assembly. The /link switch
effectively says "this DLL is not complete without this file", or "the DLL
and the linked files are one unit". It's incredibly easy to verify this...
Use al.exe with /embed instead of /link and look at the MANIFEST section in
ILDASM, then do the same with /link.

/embed (copies the file into the assembly):
.mresource public NameOfResource
{
}

/link (does not copy the file into the assembly):
.mresource public 'NameOfResource'
{
        .file 'NameOfResource' at 0x000000000
}

Adam..

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to