为什么无法找到Microsoft.SqlServer.Management.Smo.Restore [英] why Microsoft.SqlServer.Management.Smo.Restore could not be found

查看:336
本文介绍了为什么无法找到Microsoft.SqlServer.Management.Smo.Restore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我查看代码项目中的教程在应用程序部署期间还原数据库之后[ ^ ]



i已经引用了Microsoft.SqlServer.Management.Smo.dll并声明了命名空间



但是以下内容代码显示错误类型或命名空间名称'无法找到'恢复'



after i looked the tutorial in code project Restore Database during Application Deployment[^]

i have already make referenced to Microsoft.SqlServer.Management.Smo.dll and declare namespace

but the following code shows the error type or namespace name 'Restore' could not be found

Restore sqlRestore = new Restore();

            BackupDeviceItem deviceItem = new BackupDeviceItem(filePath, DeviceType.File);
            sqlRestore.Devices.Add(deviceItem);
            sqlRestore.Database = databaseName;





如何解决此错误



how to solve this error

推荐答案

请参阅此 StackOverflow答案 [ ^ ]。



似乎您需要添加更多参考资料才能正常工作。
See this StackOverflow answer[^].

Seems you need to add some more references for it to work.


右键单击在项目上,打开引用并再次检查是否有感叹号。

在这种情况下,找不到dll或者可能存在.Net框架版本不匹配。
Right click on project, open references and check if there is an exclamation mark again this dll.
In this case, either the dll is not found or maybe there is a .Net framework version mismatch.


这篇关于为什么无法找到Microsoft.SqlServer.Management.Smo.Restore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆