求助:asp.net的 COM+事务(分布式事务)错误问题
当我调试以下程序的时候会报以下错误{"程序集“C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files\\website1\\2b1583f6\\d6e0c149\\App_Code.g2fzdwae.dll”没有强名称。"}
---------------------cs文件-----------------------------------------
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Security.Cryptography;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;
public partial class cs: System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DataAccess d = new DataAccess();
string s= d.testTransaction();
Response.Write(s);
}
}
---------------------DataAccess.cs------------------文件
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.EnterpriseServices;
using MySql.Data.MySqlClient;
/// <summary>
/// DataAccess 的摘要说明
/// </summary>
[Transaction(TransactionOption.Required)]
public class DataAccess:System.EnterpriseServices.ServicedComponent{
public string testTransaction()
{
try
{
ContextUtil.EnableCommit();
InsertARecord1();
InsertARecord2();
ContextUtil.SetComplete();
return "succeed!";
}
catch (Exception ex1)
{
ContextUtil.SetAbort();
return "failed!";
}
}
public void InsertARecord1()
{
MySqlConnection sqlConnection1 = new MySqlConnection("server=localhost;database=s;uid=root;pwd=root");
sqlConnection1.Open();
MySqlCommand sqlCommand1 = new MySqlCommand();
sqlCommand1.Connection = sqlConnection1;
sqlCommand1.CommandText = "insert into s values(0123)";
sqlCommand1.ExecuteNonQuery();
sqlCommand1.CommandText = "insert into s1 values(456)";
sqlCommand1.ExecuteNonQuery();
}
public void InsertARecord2()
{
MySqlConnection sqlConnection1 = new MySqlConnection("server=localhost;database=s1;uid=root;pwd=root");
sqlConnection1.Open();
MySqlCommand sqlCommand1 = new MySqlCommand();
sqlCommand1.Connection = sqlConnection1;
sqlCommand1.CommandText = "insert into s values(787)";
sqlCommand1.ExecuteNonQuery();
sqlCommand1.CommandText = "insert into s1 values(999)";
sqlCommand1.ExecuteNonQuery();
}
}
--------------------编程问答-------------------- 错误跟代码没关系。 --------------------编程问答-------------------- 没有强名称。
说 了 --------------------编程问答-------------------- 问题是什么解决啊
--------------------编程问答-------------------- 给你的Application Library一个强名称,就是你的g2fzdwae.dll,点你的Project右键属性,会找到设置强名称
补充:.NET技术 , ASP.NET