Where should the client side control live in ASP.NET app fiolder?

G

Guest

I developed a client side control using Windows Forms and I want to deploy it
through IE inside an ASP.NET project.

I am using the object tag to deploy:

<OBJECT id="SSFileCtrl1" classid="SSCtrl.dll#SSCtrl.SSFileCtrl" VIEWASTEXT>
</OBJECT>

The previous code only works if SSCtrl.dll is inside the application root of
ASP.NET project. It doesn't work if the file is inside the "bin" folder,
which I assume it should work fine!!?

I tried the following classid="bin/SSCtrl.dll#SSCtrl.SSFileCtrl" and it
didn't work too.

Is there a way to make this work if the control is inside the bin folder?

Thanks for any help,
 
S

Steven Cheng[MSFT]

Hi Hani,

Thanks for your posting. As for the problem you mentioned, based on my
test, if the web page that used the winform control is also in the web
app's root folder, it can find the assembly correctly if we assign the path
as
classid="bin/Assembly.dll#Namespace.Class"

So are your web pages also in the web app's root folder or is some other
folder hierarchy in the web app?
Also, I suggest you try using the dynamic generated path in your page such
as:

<OBJECT id="wlbl" classid='<%= ResolveUrl("~/bin/")
%>WindowsControlLib.dll#WindowsControlLib.WLabel' VIEWASTEXT></OBJECT>

#ResolveUrl("~/bin/") will return the path of the "bin" sub folder under
the application's root folder

Hope helps. Thanks.

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.)
 
G

Guest

Hi Steven,

Thanks for your input..

I liked the ResolveUrl solution, but it didn't work until I set the "Read"
permission on the bin folder. I thought the search pattern for IIS in case of
DLLs is to search the bin folder incase it didn't find the file in the page
folder (which was in my case also in the root).

I don't like setting Read on bin because I understand that "bin" should be
hidden from the outside world, but in this case we could allow people to
download file from the bin folder.

Any comments?
 
G

Guest

Thanks bruce for your reply.
codebase is used with the case of ActiveX not .NET User Controls.
 
S

Steven Cheng[MSFT]

Hi Hani,

Thanks for your followup. As for the "bin" folder you mentioned, yes,
generally it is only used internally by ASP.NET and the all the assemblies
used by the asp.net's serverside code will be located in the private bin
path(in addtion to GAC). However, as for IE host winform control, it is
not refernced by serverside code(assembly), but be required by the
clientside(IE). In other words, the assembly is something like a serverside
static resources that the client need to download it. Thus, the "Read"
permission is required. Also, since the IE host winform control's assembly
has no related to the serverside assemlbies in the "bin" folder, I
recommedn that we create another separate folder to store them. For
example, provide a "clientbin" private folder to store all those assemblies
and allow "read" in IIS for that folder.

If you have anything unclear, please feel free to post here. Thanks.


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.)
 
G

Guest

I agree with you Steven.. Actually, setting the read permission on the "bin"
folder will get overridden by IIS and removed next time you compile and run
the ASP.NET application.

Thanks for your detailed explanation.
 
S

Steven Cheng[MSFT]

You're welcome , Hani,

Thanks again for your posting. Have a good day!


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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top