Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / March 2007

Tip: Looking for answers? Try searching our database.

Deploying Excel file created with VSTO

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lisa - 23 Feb 2007 19:44 GMT
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 -

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.