简体   繁体   中英

Project Runnig error Could not load file or assembly 'Microsoft.SqlServer.Management.SDK.SqlStudio, Version=14.0.0.0

I have a problem with my project. When I run it with ssms 2017 it's working. But when I want to run it with ssms 2018 I have error:

Could not load file or assembly 'Microsoft.SqlServer.Management.SDK.SqlStudio, Version=14.0.0.0.

public class WindowsActivationHandler
{
    public event WindowActivated RegisteredServerActivated;
    public event WindowActivated RegisteredServersDeactivated;
    public event WindowActivated ObjectExplorerActivated;
    public event WindowActivated ObjectExplorerDeactivated;
    public event WindowActivated SqlEditorActivated;
    public event WindowActivated SqlEditorDeactivated;
    public event WindowActivated WindowClosing;


    public WindowsActivationHandler()
    {
        var app = (DTE2)ServiceCache.ExtensibilityModel;
        app.Events.WindowEvents.WindowActivated += WindowEvents_WindowActivated;
        app.Events.WindowEvents.WindowClosing += WindowEvents_WindowClosing;
    }
}

I have error on this line:

var app = (DTE2)ServiceCache.ExtensibilityModel;

我相信这是因为14.0.0.0的程序集版本专用于SSMS2017。我认为新的参考应该是15.0.0.0的版本,它适用于SSMS 2018。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM