How to debug a user control?

Ok here's a thing:

I tried to copy the WebApplication1.dll in the temporary directory:

C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\1b7fde38\a3be0901


It worked!!!!!!!

I still dont know why, but I can go into debug mode!!!

I Still have to find out why VS doesn't put the DLL in the temporary directory. Is this a permission conflict once again???
 
Still dont Know why the DLL is not in the temporary folder.

I found articles about problems related to:

- some anti-virus
- windows indexing service
- shadow copy


Actually, my .net framework doesn't seem to do the «shadow copy» process correctly. I think the DLL is created in the temporary folder (C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\1b7fde38\a3be0901), but seems to be removed one second later to be put in the Bin directory, in my application root. I dont understand this very well.

Anyone have some clue?
 
utilitaire said:
Still dont Know why the DLL is not in the temporary folder.

I found articles about problems related to:

- some anti-virus
- windows indexing service
- shadow copy


Actually, my .net framework doesn't seem to do the «shadow copy» process correctly. I think the DLL is created in the temporary folder (C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\1b7fde38\a3be0901), but seems to be removed one second later to be put in the Bin directory, in my application root. I dont understand this very well.

Anyone have some clue?

Still looking for details bud will let you know as soon as I know anything
 
I think I found the problem.

I put the webapplication1 folder into the wwwroot, and tried to run it. In IIS, it was not setup as an application. I must have created some sort of conflict with the bin directory. Anyway: I can run the webapplication1 project!

I dont know why I was not able to run my original project, since I had the correct setting in IIS. I just retried, and it seems to work :eek:

Strange.

I'll let you know if I encounter the same problem again. I cant believe It's going to be so simple.

By the way, thank you very much for your help. It was very appreciated! Merci beaucoup, c'est très gentil de ta part!!! :)
 
LOL, yes every application has be be a website or virtual directory in the standard security policys.

You should be ok now then its alway the most simplest of things that make you think

Regards

Andy
 
Ok Actually it works, but only with applications that are configured as an application in IIS, except for the defaut application root. Let me explain myself:

mySiteApplication is the defaut web site in IIS, windows XP. The files are in «C:\Inetpub\wwwroot\mySiteApplication». This is the root directory setup in IIS. In that case, user control DO NOT compile them-self in the bin directory.

webApplication1 is an application within mySiteApplication web site. The files are in «C:\Inetpub\wwwroot\mySiteApplication\webApplication1\». In that case, no problem with user-controls.

Strange huh? :eek:
 
Here's a printscreen of the references:

http://www.vooral.com/images/demo.jpg

the namespace vooral.controls.validation cannot be found when page.aspx is running, even though it's in the references.

I am wondering what am I supposed to see in the Bin directory. Right now, the only DLL I have is vooral.dll (+ vooral.pdb). Is this correct?
 
I tried this on another computer. The same thing happens. When I try to create a web application directly in the root, it doesn't work.

IIS:

-My computer-->web sites-->default web site (here's my application)


The files:

C:\Inetpub\wwwroot\vooral (the web site root points to this folder)
 
Maybe the probleme comes from the fact that I tried to create a web application directly in the root. In visual studio, with the wizard, when I try to create a web application, the default path is:

http://localhost/WebApplication1

The problem is that I dont want to create an application. I want to create a web site. I know a web site is an «application», but I want my application to be in the root. Therefor, I would like to have my project built directly in the http://localhost/. I want my default web site to point directly to this application. Since my domain name points to my IP, I dont want my clients to see: "www.myWebSite.com/webapplication1/index.aspx" in IE. I want them to browse directly to "www.myWebSite.com".

This is why I changed IIS setting, after having my project created in VS.net. I changed the root folder in IIS so that my default web site would point to c:/inetpub/wwwroot/webapplication1.

Maybe I mixed-up a lot of things :confused:
 
Just to clarify - are you using 'Web User Controls' (the ones with an .ascx extension)? If so these are compiled into the web application's dll not a separate dll. Therefore the fact you only have a single DLL is correct.
However if you are refering to a 'Web Control Library' then the controls will compile into a dll then can be added to the toolbar and would appear in the references section of solution explorer. In which case you expect more than a single dll in the folder.

It might help if you gave a bit more detail about how the folders are structured and which are defined as applications / what permissions are set on each. Also if you have multiple web.config files then these could also affect the ability to correctly debug the site.
 
Just to clarify - are you using 'Web User Controls' (the ones with an .ascx extension)? If so these are compiled into the web application's dll not a separate dll. Therefore the fact you only have a single DLL is correct.

Ok first of all, I use both of these types of control. The ones with the .ascx extensions are working. This means that, as you said, the compiled controls are in my application DLL. This is not the case for the web control library I guess. I have some control that are only class(.cs). No .ascx extension. Is it normal that these library are not compiled with the rest of the project???
 
If the controls are part of the same project then they should also be compiled into the one Dll. One way to check is to use ildasm.exe (installed along with vs.net etc) and use it to view the web site dll and see if the control classes are defined inside the dll.

Have you tried putting the web controls into their own project and adding that project to the solution? that way everything should get rebuilt automatically when you fire up the debugger and it should allow you to set breakpoints within the code as well.
 
Ok I use ildasm.exe. My DLL contains all the namespace that are supposed to be missing. How come? Why is IIS looking for some other DLL, since every it needs is in the defaut dll.

Here's the error line:

Parser Error Message: File or assembly name vooral.controls.validation.validators, or one of its dependencies, was not found.

<%@ Register TagPrefix="eval" Assembly="vooral.controls.validation.validators" Namespace="vooral.controls.validation.validators" %>

The namespace vooral.controls.validation.validators is in vooral.dll. That's the only dll I have.
 
PlausiblyDamp said:
Have you tried putting the web controls into their own project and adding that project to the solution? that way everything should get rebuilt automatically when you fire up the debugger and it should allow you to set breakpoints within the code as well.

Right, but wont the DLL be put into its own Bin directory? I want all the DLL to be in the same directory, don't I ?
 
My website root is in C:\Inetpub\wwwroot\vooral\

the bin directory is C:\Inetpub\wwwroot\vooral\bin

Here's my solution:

solution: solution 'vooral'
projects: vooral, classlibrary (both are part of the solution)

When I compile, the vooral project creates the vooral.DLL into the correct directory (C:\Inetpub\wwwroot\vooral\bin). The classlibrary project compile and creates the dll into the C:\Inetpub\wwwroot\vooral\classLibrary\bin\Debug directory. I need to have all the DLL in the same directory, right? Something seems to be wrong here.

?
 
I can't even create another project in the same solution. Actually I can, but the library I would build in would refer to the namespace: System.Web.UI. It seems like a library project cannot use this namespace. Only web application project can.

So I need to create these library within the current project. Basically, those classes are just some validators and a «masterpage container». Those classes dont need any HTML code. So I do not use .ascx files. That's why I use only class(.cs) files.
 
If you create a web control project you should be able to use the System.Web.UI namespace. If not you may just need to set a reference to the system.web.dll and then it should work fine.
Even without a separate project you should be able put a break point in the control's .cs file.
When you build the website do any warnings or errors get generated?
 
PlausiblyDamp said:
If you create a web control project you should be able to use the System.Web.UI namespace. If not you may just need to set a reference to the system.web.dll and then it should work fine.
Even without a separate project you should be able put a break point in the control's .cs file.
When you build the website do any warnings or errors get generated?


No warning at all.

And as I said, all the classes are in the DLL. I checked this with a .exe.
 
Back
Top