Hi John,
Thank you for using MSDN Newsgroup! My name is Steven, and I'll be
assisting you on this issue.
From your description, you've made an Winform control and used it in a web
page displayed in IE. Also, it worked well at the develop machine. However,
when you access the page from other machine, you found the control didn't
work.
If there is anything I misunderstood, please feel free to let me know.
Since you've provided the code period :
<OBJECT id="oFile1"
classid="http:FileUpload.dll#FileUpload.FileUploadControl" VIEWASTEXT>
</OBJECT>
that specify the assembly's path as the same place with the page, and the
control can be displayed well from local machine. So I don't think the
problem is caused by the path of the assembly. Also, I'd like to confirm
something on this issue:
1. All the test machines are intranet based enviroment, yes? All have the
same version of dotnet framework installed?
(At least, have the same highest version?)
2. The FileUpload.dll is put in the same directoy with the page which
contains it? If so, there won't have problem with the assembly's location.
3. When request the certain page from other client machine, what does the
page display for the control since it can work. If it is a large rectangle
with a small rectangle(on the left top corner) and also a "X" in the small
rectangle, that indicates the control's assembly can't be correctly
located. Else, if in the small rectangle, there are some mini colorful
shapes , that indicates the control's assembly has been successfully
located, but can't be executed correctly in client CLR.
Then, the problem is likely due to a security issue(assembly's access
permission).
Is the control you made strong-named? If so, Have you applied the
"AllowPartiallyTrustedCallersAttribute" to your
assembly? If not, you need to do it with your strong named control:
add [assembly:AllowPartiallyTrustedCallers()] in the AssemblyInfo file.
Then rebuild the control's assembly and replace the old one and test the
page again.
For detailed description on the "AllowPartiallyTrustedCallers" attribute,
you can view the following link in MSDN:
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemsecurityallowp
artiallytrustedcallersattributeclasstopic.asp?frame=true
Also, sometimes, there will be some certain code still unable to execute
well on client machine. Then we need to manully
adjust the "Zone Security" via the ".net Configuration tool" on the client
machine. You can find the ".net Configuration tool" through the Control
Panel---->Administrative Tools--->.net Configuration tool. Start it and
select the "Runtime security policy" node in the left treeview. Then in the
right main view, click the "Adjust Zone Security" link, choose "make change
to this computer" ( default option) and then click next, you'll found some
big icons options on the top , select the "Local Intranet" and move the
slide bar below and adjust it to "Full Trust"(give the maximum trust).
Thus,we've up the trust leve of the assemblies from local intranet area.
After that, click next and close it. Try visiting the page which contains
the winform control again to see whether the problem remains.
If you want more detailed information on the security for rich client
situatoin, you may visit the following tech article in MSDN:
#Code Access Security and Distribution Features in .NET Enhance Client-Side
Apps
http://msdn.microsoft.com/msdnmag/issues/02/06/rich/default.aspx
Please try out the preceding suggestions to see whether they help. If you
have any questions on them, please feel free to post here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)