标签: vsix

使用MSI安装程序部署VSIX

anyony可以帮助我"如何使用MSI安装程序安装VSIX".

对于msi安装程序,我正在使用visual studio Installer安装项目.

当我使用VSIX与扩展管理器时它工作正常.

我希望将它作为安装程序(使用msi)而不是使用enstension管理器.

或者任何最好的安装和卸载VSIX文件

c# visual-studio vsix c#-4.0

9
推荐指数
1
解决办法
4740
查看次数

VSIX:在VS启动时执行代码

当visual studio加载解决方案时,我想从VSIX扩展中调用一些代码,我该怎么做?仅当用户第一次按下我的插件按钮时才调用Package :: Initialize.

visual-studio-2010 vsix

9
推荐指数
1
解决办法
1979
查看次数

有关调试器使用的调试引擎的信息

在Visual Studio中,如果要将调试器附加到任何进程,则可以选择一些特定的引擎(代码类型)或要使用的引擎集:

在此输入图像描述

接下来(在您选择任何引擎和进程之后),如果单击" 附加"按钮,则启动调试器附加操作.然后还会触发与调试相关的事件.IDebugEventCallback2::Event可用于获取此类事件(例如,提取调试器实际附加到的进程的名称):

public int Event(IDebugEngine2 engine, IDebugProcess2 process, IDebugProgram2 program,
                 IDebugThread2 thread, IDebugEvent2 debugEvent, ref Guid riidEvent, 
                 uint attributes)
{
    if (debugEvent is IDebugProcessCreateEvent2)
    {
        string processname;
        if(process != null)
            process.GetName((uint) enum_GETNAME_TYPE.GN_FILENAME, out processname);
        //...
    }
}
Run Code Online (Sandbox Code Playgroud)

有没有类似的方法来获取有关已选择的引擎的一些信息?

更新:更详细的代码:

public class DebugEventsHunter : IVsDebuggerEvents, IDebugEventCallback2
{
    private readonly IVsDebugger _debugger;
    private uint _cookie;

    public DebugEventsHunter(IVsDebugger debugger) { _debugger = debugger; }

    public void Start()
    {
        _debugger.AdviseDebuggerEvents(this, out _cookie); …
Run Code Online (Sandbox Code Playgroud)

.net vspackage visual-studio envdte vsix

9
推荐指数
1
解决办法
645
查看次数

Visual Studio扩展不会在实验实例中加载

我正在VS2013中开发Visual Studio扩展,但我可以在实验实例中加载它.

我可以在我当前的实例(来自vsix文件)中手动安装它,它工作正常,但我无法调试它.

ActivityLog中没有任何错误消息也没有任何内容.我的扩展程序没有加载.(这不仅仅是我的扩展.同样的事情发生在项目模板的新扩展中)

我试图删除/重置实验实例没有运气.

我还尝试通过安装我的扩展程序从当前实例创建实验实例来调试我的扩展.然后,扩展在实验实例中的"扩展和更新"中显示为"已禁用".

试图搜索在实验实例中如何执行扩展注册但找不到任何内容.仅找到对"将VSIX内容部署到实验实例以进行调试"设置的引用,而不是设置的内容.

目前我的测试工作很喜欢这样:

  1. 放入MessageBox和/或WriteLine并编译代码
  2. 在"扩展和更新"中删除以前的扩展实例
  3. 关闭Visual Studio
  4. 从vsix文件安装扩展
  5. 启动Visual Studio
  6. 测试扩展

这当然需要很长时间.

vspackage vsix visual-studio-extensions visual-studio-2013

9
推荐指数
1
解决办法
3975
查看次数

VSIX - 使用"托管兼容模式"调试引擎

有人知道我们如何使用"托管兼容模式"调试器,从VS2015内部的VSIX包代码中附加进程?我们目前使用以下代码来查找"Managed 4.0"引擎,但似乎无法找到"托管兼容模式"引擎.

foreach (EnvDTE80.Transport tr in Debugger.Transports)
    foreach (EnvDTE80.Engine eng in tr.Engines)
    {
        if (VisualStudioDebugEngines.Managed40.Equals(new Guid(eng.ID)))
        {
            transport = tr;
            engine = eng;
        }
    }

process.Attach2(engine);
Run Code Online (Sandbox Code Playgroud)

换句话说:如何在代码中执行此操作:

托管兼容模式

c# visual-studio visual-studio-debugging vsix

9
推荐指数
0
解决办法
857
查看次数

VSIX - XmlEditingScope.Complete()上的死锁

我们使用Microsoft.VisualStudio.XmlEditor命名空间(https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.xmleditor.aspx)中的类来修改Visual Studio扩展中的xml文档.

由于某种原因,在调用XmlEditingScope.Complete()方法后发生死锁.在Visual Studio的状态栏中,我们看到消息"等待解析完成..."

这是死锁UI线程的堆栈跟踪:

WindowsBase.dll!System.Windows.Threading.DispatcherSynchronizationContext.Wait(System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)   
mscorlib.dll!System.Threading.SynchronizationContext.InvokeWaitMethodHelper(System.Threading.SynchronizationContext syncContext, System.IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)     
[Native to Managed Transition]   
[Managed to Native Transition]   
mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext)   
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext)  
Microsoft.VisualStudio.Package.LanguageService.14.0.dll!Microsoft.VisualStudio.Package.LanguageService.ParseWaitHandle.WaitOne(int millisecondsTimeout, bool exitContext)    
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.XmlLanguageService.WaitForParse(System.IAsyncResult result, Microsoft.XmlEditor.StatusBarIndicator indicator)    
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.XmlLanguageService.WaitForParse()    
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.XmlParserLock.XmlParserLock(Microsoft.XmlEditor.XmlLanguageService service)  
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.Transaction.PushToEditorTreeAndBuffer()  
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.Transaction.Complete()   
XmlEditingScope.Complete() Line 64
Run Code Online (Sandbox Code Playgroud)

并且Visual Studio解析线程:

mscorlib.dll!System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle waitableSafeHandle, long millisecondsTimeout, bool hasThreadAffinity, bool exitContext) + 0x21 bytes  
mscorlib.dll!System.Threading.WaitHandle.WaitOne(int millisecondsTimeout, bool exitContext) + 0x28 bytes     
Microsoft.XmlEditor.dll!Microsoft.XmlEditor.LockManager.Lock(object …
Run Code Online (Sandbox Code Playgroud)

c# deadlock visual-studio vsix visual-studio-extensions

9
推荐指数
1
解决办法
162
查看次数

如何在VSIX项目中的解决方案文件夹中获取项目

您好我有一个问题,在Visual Studio扩展中有自定义生成任务.我需要识别我的自定义项目类型的项目.如果它们位于解决方案的根目录下,我可以做到这一点,但是当它在解决方案文件夹中时会出现问题.我可以将解决方案文件夹作为EnvDTE.Project获取,但我不确定如何从该文件夹中获取项目.

我以为我可以从项目Collection属性中获取它,但这是null.

任何帮助将不胜感激.

if (Scope == EnvDTE.vsBuildScope.vsBuildScopeSolution)
{
    DTE2 dte2 = Package.GetGlobalService(typeof(EnvDTE.DTE)) as DTE2;
    var sol = dte2.Solution;
    EnvDTE.DTE t = dte2.DTE;
    var x = t.Solution.Projects;
    foreach(var proj in x)
    {
       try
       {
           var project = proj as EnvDTE.Project;
           var guid = GetProjectTypeGuids(project);
           if (guid.Contains("FOLDERGUID"))
           {
               //here is where I would get the project from the folder
           }
Run Code Online (Sandbox Code Playgroud)

c# vsix visual-studio-extensions

9
推荐指数
1
解决办法
2191
查看次数

VSIXInstaller.NoApplicableSKUsException:此扩展程序无法安装在任何当前安装的产品上

我最近尝试在visual studio 2015中安装企业库6.0,但安装程序抛出错误'VSIXInstaller.NoApplicableSKUsException:此扩展不能安装在任何当前安装的产品上'.我无法解决它.

19-Dec-16 9:59:48 AM - Microsoft VSIX Installer
19-Dec-16 9:59:48 AM - -------------------------------------------
19-Dec-16 9:59:48 AM - Initializing Install...
19-Dec-16 9:59:48 AM - Extension Details...
19-Dec-16 9:59:48 AM -  Identifier         : A42E118F-C41F-47A2-ADB5-04CDEBF8EB90
19-Dec-16 9:59:48 AM -  Name               : EnterpriseLibrary.Config.v6
19-Dec-16 9:59:48 AM -  Author             : Microsoft
19-Dec-16 9:59:48 AM -  Version            : 6.0.1304.1
19-Dec-16 9:59:48 AM -  Description        : Launches the Microsoft Enterprise Library v6 Configuration Console
19-Dec-16 9:59:48 AM -  Locale             : en-US
19-Dec-16 9:59:48 AM - …
Run Code Online (Sandbox Code Playgroud)

installation enterprise-library visual-studio vsix visual-studio-2015

9
推荐指数
3
解决办法
3万
查看次数

将VSIX功能添加到C#类库

我有一个现有的单文件生成器(位于C#类库中).如何将VSIX项目级功能添加到此项目中?最终目标是编译我的类库项目并获得VSIX.

(我实际上回答了我自己的问题.这与Visual Studio 2017中的SIngle文件生成器更改有关 - 但这个问题并没有问我在这里回答什么.)

c# visual-studio vsix single-file-generator

9
推荐指数
1
解决办法
1689
查看次数

如何使用Visual Studio扩展创建绿色(或蓝色)波浪装饰

我有一个Visual Studio扩展,显示红色错误波形.我也想提供其他颜色的曲线,例如黄色警告.

创建红色波浪线可以通过扩展ITagger类来完成:

internal sealed class MySquigglesTagger : ITagger<IErrorTag> {
    public IEnumerable<ITagSpan<IErrorTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
        foreach (IMappingTagSpan<MyTokenTag> myTokenTag in this._aggregator.GetTags(spans))        
            SnapshotSpan tagSpan = myTokenTag.Span.GetSpans(this._sourceBuffer)[0];
            yield return new TagSpan<IErrorTag>(tagSpan, new ErrorTag("Error", "some info about the error"));
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我尝试过的:

  1. 我的直觉(错误地)说,返回一个具有不同errorType的ErrorTag可能会产生不同类型的标记,但无论你传递什么字符串,波形都会保持红色.例如.新的ErrorTag("警告")给出了红色的波浪形.MSDN文档几乎不存在.请参阅ErrorTag.
  2. Tagging命名空间中,没有提到实现ITag的不同Tag类.我希望有一个WarningTag或InfoTag.
  3. 当被问及在MSDN论坛的一个问题在这里.

问题:如何制作绿色(或蓝色或黄色)花边装饰品?可悲的是,即使是神秘或复杂的解决方案也值得赞赏......

我的目标是VS2015和VS2017.

编辑:在输入此问题时,MSDN论坛上有人回复说无法使用当前的API完成.在Visual Studio中制作黄色波浪线真的不可能吗?!

.net c# visual-studio vs-extensibility vsix

9
推荐指数
1
解决办法
562
查看次数