asp.net iis上工具生成的代码与vs2005上生成的代码不同,怎么解决?
vs2005 上面 :public image_aspx() {
string[] dependencies;
#line 912304 "F:\AJAXEnabledWebSite2\Image.aspx.cs"
((System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/Image.aspx";
#line default
#line hidden
if ((global::ASP.image_aspx.@__initialized == false)) {
dependencies = new string[2];
dependencies[0] = "~/Image.aspx";
dependencies[1] = "~/Image.aspx.cs";
global::ASP.image_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
global::ASP.image_aspx.@__initialized = true;
}
this.Server.ScriptTimeout = 30000000;
}
发布到iis上之后:
[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
行 106: public class image_aspx : global::Image, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
行 107:
行 108: private static bool @__initialized;
行 109:
行 110: private static object @__fileDependencies;
行 111:
行 112: public image_aspx() {
行 113: string[] dependencies;
行 114: ((Image)(this)).AppRelativeVirtualPath = "~/Image.aspx";
行 115: if ((global::ASP.image_aspx.@__initialized == false)) {
行 116: dependencies = new string[1];
行 117: dependencies[0] = "~/Image.aspx";
行 118: global::ASP.image_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
行 119: global::ASP.image_aspx.@__initialized = true;
行 120: }
行 121: this.Server.ScriptTimeout = 30000000;
行 122: }
最后报错:
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误信息: CS0030: 无法将类型“ASP.image_aspx”转换为“System.Web.UI.WebControls.Image”
源错误:
行 112: public image_aspx() {
行 113: string[] dependencies;
行 114: ((Image)(this)).AppRelativeVirtualPath = "~/Image.aspx";
行 115: if ((global::ASP.image_aspx.@__initialized == false)) {
行 116: dependencies = new string[1];
源文件: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\1f621c1d\a260b240\App_Web_image.aspx.cdcab7d2.lhkokn7l.0.cs 行: 114
我用的框架是这个版本:
// <auto-generated>
行 4: // 此代码由工具生成。
行 5: // 运行库版本:2.0.50727.42
行 6: //
行 7: // 对此文件的更改可能会导致不正确的行为,并且如果
行 8: // 重新生成代码,这些更改将会丢失。
行 9: // </auto-generated>
--------------------编程问答-------------------- 没用过
是沙发吗
帮顶。。。。。。。。。。 --------------------编程问答--------------------
真的是沙发 再帮你顶下吧。。。。。。。。。 --------------------编程问答-------------------- 帮顶…
补充:.NET技术 , ASP.NET