C# 错误消息";要完成此操作,请将属性AssemblyName设置为;

C# 错误消息";要完成此操作,请将属性AssemblyName设置为;,c#,asp.net,sql-server,smo,C#,Asp.net,Sql Server,Smo,我正在尝试为数据库中的所有存储过程生成脚本,但它引发以下异常: 要完成此操作,请设置属性AssemblyName 这是我的密码 Server myServer = new Server("SHAIWAL-PC"); Scripter scripter = new Scripter(myServer); Database myAdventureWorks = myServer.Databases["MyDataBase"]; Urn[] DatabaseURNs = new Urn[] { myA

我正在尝试为数据库中的所有存储过程生成脚本,但它引发以下异常:

要完成此操作,请设置属性AssemblyName

这是我的密码

Server myServer = new Server("SHAIWAL-PC");
Scripter scripter = new Scripter(myServer);
Database myAdventureWorks = myServer.Databases["MyDataBase"];
Urn[] DatabaseURNs = new Urn[] { myAdventureWorks.Urn };

StringCollection scriptCollection = scripter.Script(DatabaseURNs);
string Script = string.Empty;
ScriptingOptions scriptOptions = new ScriptingOptions();
foreach (StoredProcedure mysp in myAdventureWorks.StoredProcedures)
{
    StringCollection spscript = mysp.Script(scriptOptions);

    spscript = mysp.Script();
    foreach (string script in spscript)
    {
        Script += script;
        Script += "<br/>";
    }
}
Server myServer=新服务器(“SHAIWAL-PC”);
Scripter Scripter=新的脚本编写器(myServer);
数据库myAdventureWorks=myServer.Databases[“MyDataBase”];
Urn[]DatabaseURNs=newurn[]{myAdventureWorks.Urn};
StringCollection scriptCollection=scripter.Script(DatabaseURNs);
字符串脚本=string.Empty;
ScriptingOptions scriptOptions=新建ScriptingOptions();
foreach(myAdventureWorks.StoredProcess中的StoredProcess mysp)
{
StringCollection spscript=mysp.Script(脚本选项);
spscript=mysp.Script();
foreach(spscript中的字符串脚本)
{
脚本+=脚本;
脚本+=“
”; } }

请帮助某人

哪行代码引发异常?堆栈跟踪是什么?此行抛出异常StringCollection spscript=mysp.Script(scriptOptions);我也有同样的问题。有什么解决办法吗?