I've done a search through the forums, but I haven't managed to find
the answer I'm looking for.
I have a relatively simple Excel file that I created using VSTO. In
the startup event of one of the sheets, I add a button to the toolbar,
and when I click that button, it opens up a form. When I fill in the
form and click the run button, it grabs data from a stored procedure
and dumps it into Excel, formatting it correctly.
When I run it in VS.NET, it works fine. When I go to the bin folder
and open the Excel file there, the button appears, and clicking on it
works like a charm.
But... if I take the Excel file and the dll and copy them to another
place on the same workstation (My Documents), then when I open up the
Excel file, no button appears. No error, either. Nothing. Clearly,
something is missing, but I'm not sure what it is. I can't imagine
that I need to use an installer project, do I? Again, it works fine
without Visual Studio when it's sitting in its original bin folder,
but if I put it anywhere else on the same machine, it doesn't.
Thanks,
Lisa
Harry Miller [MSFT] - 23 Feb 2007 22:22 GMT
Are you granting full trust to the assembly in the new location? The default
security policy that Visual Studio creates is location-based, so if you move
it you have to manually grant it trust. (Even if you move it to a new folder
on your own computer.)
This article shows how to set your security to allow the code to run for
testing:
http://msdn2.microsoft.com/en-us/library/zdc263t0(VS.80).aspx

Signature
Harry Miller
This posting is provided "AS IS" with no warranties, and confers no rights.
> I've done a search through the forums, but I haven't managed to find
> the answer I'm looking for.
[quoted text clipped - 19 lines]
> Thanks,
> Lisa
Lisa - 25 Feb 2007 16:43 GMT
That's bizarre. I don't get why they'd do something like that. We
might as well just use a macro in Excel. That way, we wouldn't need
to distribute the DLL, either, and we'd have all the same
functionality. What do they think they added by this?
Lisa
On Feb 23, 4:22 pm, "Harry Miller [MSFT]"
<harry...@online.microsoft.com> wrote:
> Are you granting full trust to the assembly in the new location? The default
> security policy that Visual Studio creates is location-based, so if you move
[quoted text clipped - 33 lines]
>
> - Show quoted text -
Harry Miller [MSFT] - 01 Mar 2007 20:05 GMT
It's just tightening up security. Macros can run with little security
checking, so viruses are easy to spread that way. If you use a different
form of evidence that travels with the assembly (so not location-based
evidence, but strong-name or certificate evidence), you can move the
assembly around and it'll still run.

Signature
Harry Miller
This posting is provided "AS IS" with no warranties, and confers no rights.
> That's bizarre. I don't get why they'd do something like that. We
> might as well just use a macro in Excel. That way, we wouldn't need
[quoted text clipped - 46 lines]
>>
>> - Show quoted text -