| |

VerySource

 Forgot password?
 Register
Search
View: 4304|Reply: 25

I cried for a long time about this problem, everyone help me

[Copy link]

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-6 16:20:01
| Show all posts |Read mode
All code is compiled using the command line, without using an IDE environment
Background code --- and compiled into DLL
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace mytest {
public class mypage: Page {
protected override void OnLoad (EventArgs e) {
Response.Write ("ad");}}}
Foreground code
<% @ Page Language = "C #" Inherits = "mytest.mypage" Codebehind = "test.cs" enableViewState = "false"%>
<asp: Label id = "Label1" Text = "display">
</ asp: Label>
Error during access
Parser Error Message: Could not load type 'mytest.mypage'.
Why Inherits can't find the class
--------------------------------------
I checked the online MSDN and the installed version of MSDN, as well as the major forums. I haven't solved it. I hope to get a helpful answer.
Reply

Use magic Report

1

Threads

60

Posts

37.00

Credits

Newbie

Rank: 1

Credits
37.00

 China

Post time: 2020-1-6 17:33:01
| Show all posts
Because as a class in a dll, he first needs to be new, so he cannot find it.
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-6 17:36:01
| Show all posts
You use vs.net to add this dll to another project, see if you can find it in the Object Browser
mypage class, if not found, it means that the compilation was unsuccessful, and the compilation command is wrong. This cs file was not compiled into the dll
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-6 17:39:01
| Show all posts
I used your file and compiled it from the command line to successfully display ad.

But "display" is not available, because label1 does not have runat = "server"
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 17:57:01
| Show all posts
Why are the questions you answered so different in nature? ? ? ? ? ? ? ? ? ? ? ? ? The previous condition of this question was that I was not using VS. NET IDE environment, and ensure that all operations are normal, and the correctness of all code, I asked a question similar to the project release, please do not turn around in doubt when the code is correct , I have initially solved some of them after my own efforts
---------------
I checked a lot of information, and now it has been solved as follows, the program must have these two conditions when it is arranged
1. The compiled DLL file must be placed in the BIN directory
2. DLL file name must be 1.DLL
3.
Why does the compiled DLL file have to be 1.dll? If I change the name, I will get an error. I am getting closer to the essence of the problem, but it is
Know where to set this information, don't tell me it's the web.config file
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 18:00:01
| Show all posts
---------------
I checked a lot of information, and now it has been solved as follows, the program must have these two conditions when it is arranged
1. The compiled DLL file must be placed in the BIN directory
2. DLL file name must be 1.DLL
3.
Why does the compiled DLL file have to be 1.dll? If I change the name, I will get an error. I am getting closer to the essence of the problem, but it is
Know where to set this information, don't tell me it's the web.config file
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-1-6 18:06:01
| Show all posts
Well I didn't say.
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 18:09:01
| Show all posts
I now want to change my DLL file to any name that can be executed normally (that is, the front-end ASPX file is called). The current file name can only be 1.dll. If it is changed, an error occurs

Line 256: <add assembly = "System.EnterpriseServices, Version = 1.0.5000.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" />
Line 257: <add assembly = "System.Web.Mobile, Version = 1.0.5000.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" />
Line 258: <add assembly = "*" />
Line 259: </ assemblies>
Line 260:
Reply

Use magic Report

1

Threads

5

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

 Author| Post time: 2020-1-6 18:45:02
| Show all posts
Solved it by myself
Reply

Use magic Report

0

Threads

9

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-6 19:18:01
| Show all posts
Overnight! The spirit is commendable
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list