Quantcast
Channel: Visual Studio Integrate forum
Viewing all 4410 articles
Browse latest View live

How do I set the IVsTextView default font?

$
0
0

I am writing a Visual Studio 2010 extension that uses the IVsTextView to edit acustom content type. I'm using MEF extensions (I wish to avoid writing an implementation for ILanguageService).

I defined 3 classifiers and appropriate ClassificationFormatDefintions, which provide the color and font for the tags.

However, the text also contains 'unclassified' content. I was not able to change its color nor its font.

  • I tried changing the 'Plain Text' item in the "Text Editor" category, but it did not have any effect.
  • I tried applying properties on the IEditorFormatMap interface, but the properties I tried did not have an effect. I'm not even sure they were correct properties.

I also thought about (though did not try) adding an 'unclassified' classifier and provide the appropriate tagger info for it. But this seems like the wrong way to do it.

So, how do I set the font for the unclassified content?

Alternatively, how do I relate the IVsTextView to the items in "Text Editor" font and colors category?


Get all preprocessor definitions from VCProject

$
0
0

I have succeeded in getting some of the VCProject options in a Visual Studio Extension that I am writing. I see that I can use VCCLCompilerTool.FullIncludePath to get the set of directories used to search for header files.

I also see VCCLCompilerTool.PreprocessorDefinitions, but this only has the preprocessor definitions defined in the project, not inherited values such as UNICODE and _UNICODE.  How would I get the full set of preprocessor definitions, including inherited values?

Project folder created after deleting with IWizard extension

$
0
0

Hi guys

I've got a custom VS solution template that calls a library that implements IWizard.  Within RunFinished() I've got some code that does the following:

  1. Creates a new folder called MAIN just under the new project folder root
  2. Saves everthing in the solution
  3. Closes the solution
  4. Runs a PowerShell script which moves eveyrthing to MAIN
  5. Re-opens the solution from the new MAIN folder

Through a series of MessageBox.Shows I'm able to see everything is happening as I want, but once the IWizard library is done running, something is creating another folder of the same project name at the same level as MAIN.

Here's an example:

  1. Create new project called Foo under D:\VS_Projects
  2. D:\VS_Projects now has a folder called Foo and another folder under Foo called Foo
  3. IWizard library runs and creates MAIN under D:\VS_Projects\Foo
  4. The very last line of my IWizard library does a MessageBox.Show saying "All done".  I look at the folder structure before closing the messagebox popup and it's exactly what I want - d:\vs_projects\Foo\Main\...
  5. IWizard exits and then I get a new folder created beside MAIN called Foo.  So now I have D:\VS_Projects\Foo\MAIN AND D:\VS_Projects\Foo\Foo

Any ideas where this folder is being created from and how to disable?

Tks


Steven

Exception from Visual Studio Extension Gallery Service

$
0
0

I'm trying to make my extension automatically update itself when new versions are pushed to the Visual Studio Gallery. There are a few guides on how one may achieve this, but they are a couple years old and may not apply.

I'm trying to query the IVsExtensionRepository as follows:

var _extensionRepository = (IVsExtensionRepository)Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsExtensionRepository));
var query = _extensionRepository.CreateQuery<VSGalleryEntry>(false, true)
                .OrderByDescending(n => n.Ranking)
                .Skip(0)
                .Take(25) as IVsExtensionRepositoryQuery<VSGalleryEntry>;

query.ExecuteCompleted += Query_ExecuteCompleted;
query.ExecuteAsync();


At Query_ExecuteCompleted I'm receiving an exception from the server: The remote server returned an error: (400) Bad Request.

A stack trace is provided:

Server stack trace: 

at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeEndService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: 

The service is hosted at: https://visualstudiogallery.msdn.microsoft.com/services/dev12/extension.svc

Does anyone know how I can use this service? Either through the IVsExtensionRepository or manually?





Macro to Find and Replace

$
0
0

Hi All,

Performing and record macro to find the selected string in open .RESX file and get the key and replace it on selection string.Below is the recorded macro with one modification for find what...

The problem with the below macro is that when run it does not copy the key from the .RESX file.

Can you please suggest or refer to achieve this?

 Sub genResx()
        DTE.ActiveDocument.Selection.Copy()
        DTE.Windows.Item("Resources.resx").Activate()
        DTE.ExecuteCommand("Edit.Find")
        DTE.ExecuteCommand("Edit.Paste")
        DTE.Find.MatchCase = True
        DTE.Find.FindWhat = DTE.ActiveDocument.Selection.Copy()
        DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
        DTE.Find.MatchWholeWord = False
        DTE.Find.Backwards = False
        DTE.Find.MatchInHiddenText = False
        DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
        DTE.Find.Action = vsFindAction.vsFindActionFind
        If (DTE.Find.Execute() = vsFindResult.vsFindResultNotFound) Then
            Throw New System.Exception("vsFindResultNotFound")
        End If
        DTE.Windows.Item("Program.cs").Activate()
        DTE.ActiveDocument.Selection.Paste()
        DTE.ActiveDocument.Save()
    End Sub

Thanks & Regards,

ShailShin

VSPackage Deployment: Custom Installer with VS Gallery Auto Updates

$
0
0

I have a VSPackage with a custom editor. I want it to show up in the solution explorer with a custom icon, which will require a custom deployment step.

Here are my deployment requirements:

  • As explained here, allow users to easily update to new versions of my extension using the Visual Studio Gallery (In VS Tools > "Extensions and Updates" > Updates).
  • As explaned here, I need to run a custom installation step to set up the custom icon in the registry (outside the VS registry hive, which means PKGDEF files can't do it).

As explained here and here, instead of using a VSIX file, I could create a custom installer that places the extension files directly in the user/machine-wide extension folder on the target machine.

Problem is I think the easy extension update process from the VS Gallery would not work. Can I get both of the requirements above? If so, how?

As a workaround, could I check if the icon is set up correctly in the package Initialize method, and if not, run some custom code to set up the registry settings?  In this case I can stick with VSIX deployment and the auto-updates work.

Alternatively, if I create a custom installer that deals with updates and copies new versions of the extension files to the extension folder, how do I register it so that VS "Extensions and Updates" checks the VS Gallery version number for updates?

Updating threads name from VS 2013 Threads window (after a breakpoint is hit?)

$
0
0

Hi all,

as we already know, the RaiseException approach is generally used for setting the thread name inside the VS IDE Threads window.

This works fine for the case when the number of thread name changes is low.

Otherwise the time while debugging grows up to 4-5x times (in our case) due to the thread name updates.


I am not familiar with VS integration approaches for my problem. However I would happily ask here if there is an event based approach for updating the thread name inside the VS 2013 Threads window from outside my C++ application, after a debugger break-point is hit or something similar.  This would eliminate the need of setting the thread name each time in my C++ code and would be done only when the debugger break-point is hit -- and thus will not influence performance.

Basically this "plugin/addon" would have to:

- wait for a breakpoint to be hit

- iterate through all available threads in the active process

   - grab the thread name from a private member (Thread::_name)

   - update the VS IDE Threads window with the above thread name.

Any ideas if such a plugin/addon is already available? .. or how it could be created?

Kind regards,

Marius



vsixmanifest for all: VS 2010, 2012 and 2013

$
0
0

Hi,

         I have A vsix project that supports vs2012 now, i need to provide support in vs2010,12 and 13.for that i have changed the target version range to[10.0,12.0).But when installing the vsix the target version list contains only 2012 and 2013 , i cant find 2010 in the target list.My package manifest version is =2.0.0. Please give me a solution on this.


Kani


Programmatically getting current visual studio addin version

$
0
0

Hi I am creating a menu add-in vs ,when i choose the menu the action will be performed like below

If add-in is used from vs2010 it should perform some specific actions

if it is used from vs2012 it should perform different set  of action and so on

What i need is how to  diagrammatically find the version of visual studio from which add-in is accessed?

Thanks


Kani


Template: Solution Template Wizard

$
0
0

Is it possible to create a custom solution template wizard? If so, how?

To provide some context, I need to customize the solution creation process by which steps such as source control branching must occur before the solution is created.  I am NOT trying to create a multi-project solution (which I know how to do). In addition to the precreation steps, I need fine control over when and where the solution (*.sln) is created on disk.

I've had partial success using a project template wizard, but I'm really fighting Visual Studio because those wizards are intended for projects and items, not solutions. I've considered creating a package which adds a custom menu to kick-off the process, but I'd rather have it be via the "New Project" dialog to retain fidelity with the standard developer experience.

The process is effectively:

  1. Collect information about the new solution such as name
  2. Select a local working directory
  3. Branch baseline for solution (by policy). The SCC information would be passed via the template wizard data.
  4. Map branch to selected local working directory
  5. Pull latest bits
  6. Run local build environment initialization (from pulled bits)
  7. Create solution under local working directory
  8. Add solution to source control
  9. Open the solution

I know how to build and execute all the steps, I just can't get it integrated into Visual Studio the way I want.  The experience should be File -> New Project -> New "My Team Solution".

Any suggestions or guidance is much appreciated.

Team Explorer Visual Studio 2013: External Tools arguments are empty

$
0
0

Hi,

We're using Microsoft Team Explorer for Visual Studio 2013, update 3 has been applied

I'd like to add external commands to the tools menu; every time the external arguments are empty

Simple example is to add "open file location" command:

Command: explorer.exe
Arguments: $(ItemPath)

Every possible argument choice passes empty strings to the external command.  I could not get this to work in Team Explorer VS 2012 or Team Explorer VS 2013 Update 3.

Any suggestions?

Thanks

How to Collapse the Visual studio project items tree programmatically through Extension projects.

$
0
0

Hi,

I need the c# code for collapsing the Visual studio project items tree programmatically in the Extension projects. Can you please any one suggest the code regarding this. I have attached the snap for this in below,

Thanks,

Abbas K


- Abbas K


How to consume service made in java in Multi-device hybrid App

$
0
0
I'm doing a project in the newly launched Multi-Device Hybrid App and I need to consume existing wsdl services made in java. But I'm not able to find the way to add the service reference as can be done in other project types. Please Enlighten me.

Enable drag drop support in solution explorer of VS2013

$
0
0

I have created a custom language service using MPF for Projects - Visual Studio 2013.

The drag & drop is disabled when trying to copy or move a file or folder from the Project Explorer.

How can I enable drag drop support in solution explorer?


How to hook to toolbox item selection events or How to integrate to F1 for my custom toolbox items

$
0
0

Hi All,

Extention type  : Isolated shell

Visual studio version : Visual studio 2010

My main goal is to be able to provide F1 help for my toolbox item , i reviewed this artical http://social.msdn.microsoft.com/Forums/vstudio/en-US/88554df3-cff1-4605-8b3f-017228b6f77f/toolbox-how-to-add-f1-help-keyword-to-toolbox-items?forum=vsx

but , the issue i am having is that when i press F1 on the toolbox item a help page is opened for the previos page i open (for example help page for ProjectNode). this made me think i need to update and track my selection with ITrackSelection interface. Am i right ?

How do i hook to the toolbox item selection change event ? 

Please advise .

Thanks



Open Disassembly Window And Go to a particular address during Debugging

$
0
0

We have a VS 2010 based isolated shell application.  I have a tool window that displays a subset of addresses during debugging (In debugger break state). When user selects a particular address ,  I am trying to open the Disassembly window and navigate to the user selected address.  

Is there any way to open the Disassembly window and navigate to a particular addressduring debugging? Please suggest.

Thanks

Jo


WebSocket support in VSO Rest API

$
0
0

Does the VSO REST Api support WebSocket? And what about SignalR?

Thanks!

Move Project Folder - Access Violation

$
0
0

Hi there,

I want to move a project that is within a solution.

So I remove that project in my package. After it was removed I save the solution file.

Then I move the folder and re-add the project.

This works in 70-80% of the times I try it. But sometimes I get a AccessViolation that I can't move the folder because it is not accessible. 

And I have absolutely no clue why this happens. Everything is saved.

Is there a way to determine how it is blocked? I've used some SysInternals tools and it says that the Visual Studio process is blocking the directory. Can I do something more? I thought saving the solution file and removing the project is all I can do.

Maybe someone can help.

Thanks,
Fabian


The Visual Studio Settings-Switcher! Visit http://visualstudiogallery.msdn.microsoft.com/a79072f7-3109-44a0-95c0-9c50e729d6a3

Access violation exiting an Isolated Shell application

$
0
0

My Isolated Shell app is now suddenly giving this crash on exit that I have no idea of where it comes from.

Here are the details Windows give:

  Problem Event Name:APPCRASH

  Application Name:<omitted>.exe

  Application Version:1.0.0.1

  Application Timestamp:541c3849

  Fault Module Name:msenv.dll

  Fault Module Version:12.0.30723.0

  Fault Module Timestamp:53cf6f1e

  Exception Code:c0000005

  Exception Offset:0001e974

  OS Version:6.1.7601.2.1.0.256.4

  Locale ID:1033

  Additional Information 1:0a9e

  Additional Information 2:0a9e372d3b4ad19135b953a78882e789

  Additional Information 3:0a9e

  Additional Information 4:0a9e372d3b4ad19135b953a78882e789

When I debug this isolated shell from VS, the same access violation occurs, and the file crtexe.c opens up. Again, not even close to any part of my code.

The only thing I did recently was installing the VS 2013 Update 3, since I had to install the Azure SDK and it forced me to update VS.

So now I am running VS 2013 Pro v12.0.30723.00 Update 3. My Isolated Shell app consists of a few VSPackages deriving from the Managed Project Framework. I am developing it for a full year now, and never had this kind of problem before.

Another, perhaps related, question is if Microsoft will ever release updates the VS 2013 Isolated Shell redistributable like its doing with VS 2013. I dont know if this can be a problem, but my appenvstub.dll is still on version 12.0.21005.1.

EDIT 1: Even creating a new Isolated Shell from scratch gives the same result. It always crash on exit. Next thing on my list is running a repair/reinstall of Visual Studio and all of its updates, which will consume at least half of my day :(

Visual Studio Package: Expand/Collpase State of Items

$
0
0

Hi there,

I want to manipulate the expand/collapse state of TreeView items in the solution explorer in my package.

I want to save the current state, do some stuff with the projects and items (for example delete and readd) and then set the previous expand/collapse state so that the states are as they were before my manipulation.

Is there an easy way to do this? I think I need another way of doing this as I did before to get project and item data.

Thx,
Fabian


The Visual Studio Settings-Switcher! Visit http://visualstudiogallery.msdn.microsoft.com/a79072f7-3109-44a0-95c0-9c50e729d6a3

Viewing all 4410 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>