Is there a way to add a watch to an instance of a object, instead to a variable? I have an object that is passed through various functions via parameters, and the parameters name may change in each function, so I'd like to add a watch that would be 'fixed' to that instance, regardless of the variable its currently assigned to.
Does anyone knows a way to do that? I'm using Visual Studio 2012.
When you add the item to the Watch window, try right-clicking on that entry and choose Make Object ID. Then add a watch for the particular ID (1#, 2#, etc.) See this link for more info.
Related
For a build process template, we can add/remove/edit the argument list of it and use it as variables within the build/work-flow steps. I reading the nice guide here
I'm cloning the template DefaultTemplate.11.1.xaml to sayHello-DefaultTemplate.11.1.xaml and edit it via Visual Studio 2012. I first added one argument, called TestMessage. I check in my changeset to the Source Control.
Then I create a build definition sayHelloBuild based on this template. And when I go to the Process tab, I can see TestMessage in the Misc section. I save the build definition. Trying to queue it and it gets succeeded.
Here comes the issue. I added another argument for the template named ABBCCC and checkin the source code. But when I edit the build definition sayHelloBuild, I cannot see ABBCCC in the Process tab as MyArugment01 does.
How can I get the argument list refreshed?
Within the arugments there is a property called "Metadata" as shown in the picture below. Click on the button at the right end and a window should pop up as shown in the second picture. Enter the name of the new variable in the Parameter Name and enter the other details (Display name etc). Save and check-in the build definition and you should be good to go.
Use the below script to delete the registed build process template in Database:
use Tfs_YourTeamCollectionName;
delete from tbl_BuildProcessTemplate where ProcessTemplateID = 'Your ProcessTemplateID';
Create new build definition again.
The database name is your TFS team collection name e.g. Tfs_YourTeamCollection in the backend SQL Server of your TFS server. I'm using TFS 2012.
Hope it helps!
I'm trying to create an ItemTemplate with multiple files. So far, so good. Both of my files are created and they have the right name. Now, one of them is named as the user entered. The other must use that name. I think that's what $safeitemrootname$ is supposed to do. How ever I get the same result as $safeitemname$. How can I do?
Thanks
I'm trying to create a Visual Studio extension that works alongside the Sequence Diagram Designer, and I'd like to be able to register for an event that will notify me whenever the selection changes on the diagram. The IMonitorSelectionService interface appears to offer such an event, but I don't know how to get an instance of this service from a VSPackage.
What do I need to do in order to get an instance of this service, or is there some other more easily accessible event that I could use instead?
You should be able to do the following:
IMonitorSelectionService monitorSelectionService = ((IServiceProvider)store).GetService(typeof(IMonitorSelectionService)) as IMonitorSelectionService;
Where store is the Store of the diagram you're interested in.
I'm in VS2010, in a new Word Add-In project. This is my first attempt at Word development using VSTO. The example I'm trying has this line:
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
But when I add this line Visual Studio says it can't find "Factory". Indeed, it's not in Intellisense.
I've got references to:
Accessibility
Microsoft.Office.Interop.Word
Microsoft.Office.Tools.Common.v9.0
Microsoft.Office.Tools.v9.0
Microsoft.Office.Tools.Word.v9.0
Microsoft.VisualStudio.Tools.Applications.Runtime.v9.0
Office
and all the usual System references.
Where am I going wrong and why can't I get to "Factory"?
stdole
That example looks a bit weird to me. Never seen that sort of reference before.
Generally, with Vsto, you hook into EVENTS on, say, the main Word App object.
Then, from within the event, you usually are passed a reference to the particular DOC object that the event is occurring for (say, being opened or saved, etc). In that way, there shouldn't be any need for using the "globals" object or the "factory" object, whereever they might be.
What method is that code in? A little more context might help.
I think the recommended way of doing this is:
Globals.ThisAddin.Application.ActiveDocument
i have this little problem, i use the Application settings in VS 2010 to configure a path. now it would be convenient if i could add a variable there (its an argument) so it looks like this: C:\EXAMPLEDIR\... is there any way todo this?
Or should i change the settings at startup in code? is this even possible (i would like to avoid this).
thank you.
GuyFawkes.
You can also change the scope from Application to User. User settings can be modified at runtime. They are saved if/when you invoke the Save method.
I solved this by creating a method that catches the setting. For example SPECIALFOLDER\Subdir... and then replaces the SPECIALFOLDER with an Environment.SpecialFolder. Voila. Now i can e.g. access the system folder in NT, XP and 7. Plus i can add more custom MY VARIABLE items to replace them accordingly.
greetings