空间商迟迟没有解决?我建议空间商把临时目录下的我的aspnet临时目录删掉?是不是他们不愿意停掉IIS
我的错误信息如下:
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\368aa724\e2618b33\assembly\dl3\0be575cb\76fee7ab_4515c801\App_global.asax.DLL'
and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\368aa724\e2618b33\App_global.asax.bfwrpviw.dll'
我的错误信息如下:
Compiler Error Message: CS0433: The type 'ASP.global_asax' exists in both 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\368aa724\e2618b33\assembly\dl3\0be575cb\76fee7ab_4515c801\App_global.asax.DLL'
and 'c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\368aa724\e2618b33\App_global.asax.bfwrpviw.dll'
Global.asax
<%@ Application CodeBehind="Global.asax.cs" Inherits="counter2.Global" Language="c#" %>
app_code 下的 Global.asax.cs:
using System;using System.Collections; using System.ComponentModel; using System.Web; using System.Web.SessionState; using System.IO ;using _lib;namespace counter2 { public class Global : System.Web.HttpApplication {
protected void Application_Start(object sender, EventArgs e)
{
uint count = 0; StreamReader srd; string file_path = Server.MapPath("~/counter.txt"); srd = File.OpenText(file_path); while (srd.Peek() != -1)
{
string str = srd.ReadLine(); count = UInt32.Parse(str); } object obj = count; Application.Lock(); Application["counter"] = obj; Application.UnLock(); srd.Close();
} protected void Application_End(object sender, EventArgs e)
{
uint js = 0; js = (uint)Application["counter"]; string file_path = Server.MapPath("~/counter.txt"); StreamWriter fs = new StreamWriter(file_path, false); fs.WriteLine(js); fs.Close(); } protected void Session_Start(object sender, EventArgs e)
{ string strSql = "insert into t_hitsnum (aspname,ip) values(N'";
strSql += Request.Params["url"] + "',N'";
strSql += Request.UserHostAddress;
strSql += "')"; TSqlDB SetHitNum = new TSqlDB();
SetHitNum.Execute(strSql); Application.Lock(); uint jishu = 0; jishu = (uint)Application["counter"]; jishu = jishu + 1; object obj = jishu; Application["counter"] = obj; string file_path = Server.MapPath("~/counter.txt"); StreamWriter fs = new StreamWriter(file_path, false); fs.WriteLine(jishu); fs.Close(); Application.UnLock(); }protected void Application_BeginRequest(Object sender, EventArgs e) { } protected void Application_EndRequest(Object sender, EventArgs e) { } protected void Session_End(Object sender, EventArgs e) { }
} }
http://www.ebookit.cn/270.html
Global.asax.cs在我的项目中只有Global.asax引用了其它地方都没有使用??
网站刚开始的一段时间还是可以的,不知后来怎么不可以了
Global.asax.cs 是放在App_Code目录下
Global.asax 放在根目录下的
编译后生成
App_global.asax.dll
App_global.asax.compiled
1 下载他的一个什么包,用以往的vs 2003的发布方式成为一个程序集来发布 .这个包未经什么认证(ms说的)
2 调整web.config的那个预编译的时间间隔(会减少出错次数)
3 使用固定程序集的发布方式