Groups | Blog | Home
all groups > dotnet security > may 2006 >

dotnet security : Windows User Control wont load in IE browser!



Claudio Maras
5/15/2006 7:33:01 AM
Hi,

new to this newsgroup so please bare with me if Im a bit off here.

I have created a Windows User Control in Visual Studio 2005 (.NET 2.0) that
I load through a Web Form using the OBJECT tag.

During development I used the "ASP.NET Development Server" and in here I
have got the user control to load and execute. The following is what the User
Control does:

- Contact a Web Service and recieves a DataSet.
- Verifies the file structure the User Control uses.
- Creates a Tab Delimited file with teh data from the DataSet.
- Opens Word and use Mail Merge to merge the Tab Delimited file.
- Prints the Word Document to the default ptinter.

To get this working on the "ASP.NET Development Server" I had to:
- Strong Name my assembly.
- Add the System.Security.Permissions to complete the File IO and other tasks.

But to be honest the last is only applicable if the User Control loads!

So once I have now completed my User Control I published the Web Application
to a folder and created a Virtual Directory in IIS 6.0. The problem arrives
when I load my page wpcPrintMan.aspx, the OBJECT frame where the User Control
should load stays blank.

If I look under "C:\WINDOWS\Assembly\Download" there is nothing there, FYI
before I published my site I ran the command "GACUTIL -CDL" to clear the
download cache. Also I run the Web Page wpcPrintMan.aspx from the same
machine where IIS is installed, this is also the same machine the User
control loaded just fine using the "ASP.NET Developmet Server".

There must be something on the IIS that is different as that is the only
thing that is different between the tests. But I have gone over eveything I
know, I have a infrastructure background so I've setup and managed a couple
of IIS over the years but Im not that at home with .NET Framework security
which I believe is the issue that the User Control does not load.

So if anybody knows why my User Control refuses to load or what logs I can
check to see what is going on. I did check the Sites log file which shows
that the IIS does a GET on both the wpc.PrintMan.aspx and the PrintMan.dll.

Regards,
Claudio Maras
5/16/2006 1:27:02 AM
Hi again,

as nobody replied I continued digging and found this article on the subject:

http://aspnet.4guysfromrolla.com/articles/052604-1.aspx

In here I found the problem, my execute permissions were "Script and
Execute" while its should be "Script Only". For some reason having Execute on
will cause the secnario I mentioned above, as soon as I switched to "Script
Only".

I hope this helps somebody out in the future.

Regards,
Claudio

[quoted text, click to view]
AddThis Social Bookmark Button