Now I am engaged in three-layer development, using ASP and VB6.0, but now I am struggling to find a suitable method to debug the DLL files I wrote, and the efficiency is quite low.
I've used several methods:
1. Select uninstall in IIS, then recompile with VB to overwrite the original DLL.
2. Select a site you are debugging in IIS, stop it, then compile and overwrite it, then start it, and then refresh the page in IE.
3. Execute Regsvr32.exe -u file name on the command line and then compile, overwrite and refresh.
However, the above method does not always work. There is no problem when I use Frontpage to make ASP pages, but when using InterDev, it always reports that the DLL file is Locked, cannot-overwrite error. Sometimes turning off InterDev (or just closing all the files being edited in it) will work, but not always.
I want to use InterDev for development, which is more convenient, but I can't find a better way.
This problem has troubled me for a long time. I think everyone who develops components is confused about this
.-------------------------------- --------------------------------
I tried the following method this afternoon. I don’t know if it will make everyone laugh, but I really solved the problem and I feel good about myself all afternoon. However, I am using the .NET development environment. The details are as follows:
1. Install .NET. Of course, this consumes a lot of system resources. After installation, an ordinary computer will run very slowly. If you are nervous, you may give up this method. (Later I found that it can also be implemented under frontpage and interdev, haha. Don’t complain, I installed a .net because of my words but found that it was of little use, but after I used it, I fell in love with it.)
2. Create a folder to store the DLL. Then our most "excellent" part comes out: create several empty subfolders under this folder and name them starting from 01 to the value you want.
3. Start IIS Manager
4. Open your project in VB6
5. Now if you want to debug, you can compile directly, and then arbitrarily specify a folder created in the second step. I think it is better to start from 01.
Refresh the ASP page you are using for debugging. Do you see it? The content is already the new DLL file you wrote.
The above is just the first debugging after booting. I found a lot of errors during the debugging process. Am I always so careless? Haha, I hope you are not like this:)
Now I need to modify the DLL. After the modification is completed, recompile. You will find that you cannot overwrite the DLL just now, because you have already called this component in the page, and it has been placed in the memory and is write-protected. You need to stop your site in the IIS manager. If you are using .net, you will find that this is feasible, but other development environments may not be the same as you think. Now you set up in the second step Those folders will work, find one of them (it should be 02...) and put the new DLL here. Then start the site (don’t let it restart, it’s too slow. The simplest way to do the above steps is to select your site in IIS, press █ in the upper corner, and then ▼) (I didn’t find ▼, you can only follow ▼
How about
the hour hand rotated 30 degrees to read ^_^)
?
Is the problem solved?
I recommend using .net, because with it, you don't need to make references like interdev. You just need to write the page with the extension ASP directly, and then use the server.createobject("") method to get every object in the code. It will automatically display the methods and attributes of the classes in the latest DLL you just compiled.
If you don't want to use codeinsight, I think frontpage is also a good tool.
Is my method stupid?
I don't use VB.net or C# because my current job is to encapsulate code rather than re-create a project. In view of the syntax difference between vbscript and .net, I still choose this stupid method, and I think that writing DLL in VB may be better. It would be better, wouldn't it?