Visual Studio 2010 Log file - visual-studio-2010

I wanna track visual studio activities like projects opened, files opened in visual studio ide and projects build etc. How can i achieve the same?

Start your visual studio IDE using /Log switch.
>devenv /Log c:\log_devenv.xml

To write the user activities into isolated shell of studio use the activitylog service which is exposed by studio. Sample is given below.
IVsActivityLog log = GetService(typeof(SVsActivityLog)) as IVsActivityLog;
if (log == null) return;
int hr = log.LogEntry((UInt32)__ACTIVITYLOG_ENTRYTYPE.ALE_INFORMATION,this.ToString(),string.Format(CultureInfo.CurrentCulture,"Entering initializer for: {0}", this.ToString()));
For more details use this link How to: Write to the Activity Log

Related

Stop Visual Studio generating log files

Using Visual Studio 2019 Community Edition on Windows 10. Simply open and close Visual Studio, and every time one or two new .tsv log files are generated at C:\Users\USER\AppData\Local\Microsoft\VisualStudio\SettingsLogs.
The name of the log files are:
DATE-TIME-devenv-XXXX.tsv (XXXX is a 4-digit number like "3688")
DATE-TIME-ServiceHub.SettingsHost-XXXX.tsv (XXXX as above)
In Visual Studio, Help > Send Feedback > Settings has been set to "No, I would not like to participate". Every time Visual Studio runs, multiple processes can be seen starting in Task Manager with names like:
Microsoft.ServiceHub.Controller
ServiceHub.Host.CLR.x86
ServiceHub.SettingsHost
ServiceHub.IdentityHost
These shut down when Visual Studio is closed.
Is it possible to stop these log files from being generated? Can these anciliary processes be prevented from starting?

Get visual studio debug event in VS extension

How do I write an extension to Visual Studio that will run during debug?
I saw kinds of UI or code editor options, but not the software events.
DTE.Events.DebuggerEvents gives you access to VS debugger events:
events = DTE.Events;
debuggerEvents = events.DebuggerEvents;
debuggerEvents.OnEnterRunMode += OnEnterRunMode;

Is it possible to start Visual Studio and open a .sln file from a browser?

I'm building a website where students can complete exercises. When a students starts an exercise I add a solution to the students TFS repository. I want to open this solution in Visual Studio from the browser. If it works students will only need to click once to start an exercise.
It is possible to open Visual Studio from the TFS dashboard:
href="vsweb://vs/?Product=Visual_Studio&EncFormat=UTF8&tfslink=<base64encodedstring>"
The decoded base64encodedstring looks like this:
vstfs:///Framework/TeamProject/<GUID>?url=<url to teamproject>
Googling the vstfs protocol doesn't give me much extra info. The best resource I found was:
https://msdn.microsoft.com/en-us/library/bb130164.aspx?f=255&MSPPError=-2147217396
This page only explains some general concepts:
vstfs:///<tooltype>/<artifacttype>/<tool-specific id>
The different possibilities for tooltype are not explained.
What would be the correct vstfs command to not only open Visual Studio but open a solution as well?
I'm using TFS 2015 (on prem) and Visual Studio 2015.
To start Visual Studio and open a .sln file from a TFS 2015 web page, this could be achieved by following the steps below:
If you are using TFVC version control type, please let your students map down the solution in Visual Studio first. If you use Git version control, please let your student to clone the git repository to their machine first.
In TFS web page, find the .sln file and click it. Then click the VS button show in the picture below.

Is it possible to override Visual Studio 2013 Notification window

Notification window is a new added feature in visual studio 2013. I have an isolated shell application created using visual studio 2013 shell.
Is it possible to extend the Notification window and show notification or information related to our isolated shell application ?
The answer to your question would be yes, however Microsoft does not expose the functionality officially. You can expose these structures yourself, if you're super interested.
The way you can do it, is kind of hackish, but it will work, at least for VS2013. Basically, you need to either reference an internal dll (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\Microsoft.VisualStudio.Shell.UI.Internal.dll), or just copy/paste the relevant structures into your own program, as Kevin has done: User Notifications in the Visual Studio 2013 SDK.
If that is done, you can exploit the interfaces: https://github.com/kevfromireland/visual-studio-2013-notifications-example/blob/master/UserNotificationDemo/UserNotificationDemoPackage.cs
var notificationService = (IVsUserNotificationsService)GetService(
typeof(SVsUserNotificationsService));
var notifcationManager = notificationService.
GetUserNotificationsManagerAsync()
.GetResult();
var vsUserNotificationsManager = (IVsUserNotificationsManager) notifcationManager;
var pic = new RedditPicProvider().GetAwwPicture();
vsUserNotificationsManager.
AddUserNotification(ExampleProvider.Guid,
pic.Url,
pic.Title,
pic.Url,
(uint) NotificationServerity.Critical, isTransient: true);
RegisterNotificationProvider(vsUserNotificationsManager);

Visual Studio 2008 SP1 with GDR2 - DBMDL could not be created

I get the following dialog when I try to load any DB project in Visual Studio.
There is nothing else locking it, nor are the permissions on that specific folder restrictive.
This used to work, but I re-installed VS2008, then Sp1, a few hot fixes and GDR2.
Now, when I try to load any DB project, I get the dialog above.
When I open VS, I get the following dialog; it's different, but message is the same..
Try opening Visual Studio as Administrator.
You can check locks on files by using process explorer:
http://windowsxp.mvps.org/processlock.htm
You can download process explorer here:
http://technet.microsoft.com/en-us/sysinternals/bb896653

Resources