How do I alter Database Item templates in VS 2010? - visual-studio-2010

I'd like to alter the "New Stored Procedure" template in VS 2010 so that it checks for the existence of the stored proc, deletes it if it exists, then does the Create.
Where do I find that template in VS 2010? It seems like it was easy in previous versions to just alter the template.
I found a template in "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Templates\Database Project Items", but that is not the one the IDE is using. (That one, in fact, matches what I want to do. Probably moved over from VS 2008 during the upgrade.)
I can't find a plausible candidate under "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates"
Any ideas?

Answered here: Visual Studio 2010: How to change stored procedure template.

Have you looked in My Documents\Visual Studio 2010\Templates\ItemTemplates

Try
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates
or
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates if you're NOT on a 64bit machine.

Related

Visual Studio - Page not found

Today I selected "Work Items" as I have a million times before but this time I was met with this error along the top of my "Team Explorer" tab:
"Page [some long GUID] not found."
This also happened for "Pending changes".
To fix the issue simply run the below command in an elevated command prompt as detailed here.
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe" /setup
My understanding is this command forces the recreation (what Microsoft refers to as "merging") of current VS settings into what is apparently a corrupt settings cache. On the surface, this is similar to deleting the directory path C:\Users\username\AppData\Local\Microsoft\VisualStudio\version and allowing visual studio to recreate it at launch. However, I prefer to not to delete this outright and instead rely on re-merge approach.
Recently I found this sometimes occurs when I launch several solutions at once (i.e. I have 1 or more Visual Studio instances loading a solution at the same time). I also have ReSharper, SQL Prompt, VSCommands and TFS Power Tools installed which I'm sure contribute to some degree.
UPDATE:
This fix should work for all versions of Visual Studio, however you will need to execute the command in the directory appropriate to your version. For example with Visual Studio 2015 the path would be:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /setup
Version mappings for Visual Studio (original version mapping answer here):
Visual Studio 2005 = 8
Visual Studio 2008 = 9.0
Visual Studio 2010 = 10.0
Visual Studio 2012 = 11.0
Visual Studio 2013 = 12.0
Visual Studio 2015 = 14.0
Visual Studio 2017 = Path has changed to: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE"
Deleting all files in ComponentModelCache folder worked for me
For Visual Studio 2013:
"C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache"
For Visual Studio 2015:
"C:\Users\username\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache"
or
%userprofile%\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
If you get this issue in VS2015 and running "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv" /setup doesn't fix you issue you can try the following:
Close all instances of VS
Delete all files in C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
run "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv" /setup
This happend also with my installation of VS '13 when I installed VS '15.
Removing the files at
"C:\Users\username\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache"
did the job for me.
I encounter the same problem with you, and resolved by run the VS as administrator
Here are the steps I followed. Please make sure you follow them in correct sequence. These steps are for VS 2015. Use 12.0 (instead of 14.0) for VS 2013 and 10.0 for VS 2010
Close all instances of VS
Delete all files in C:\Users{UserName}\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
Delete the folder C:\Users{UserName}\AppData\Roaming\Microsoft\VisualStudio\14.0
run "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv" /setup in a command prompt as administrator

Where can I find the natvis schema definition (for creating VC++ debugger visualizers)?

Various online sources tell me I can find it # %VSINSTALLDIR%\Xml\Schemas\natvis.xsd.
But I have not been able to find it in the said path. I have checked multiple VS2010 and VS2012 installations.
Can anyone paste the schema definition here?
Any additional documentation would be awesome
Hans Passant commented with the right answer, but it's not immediately obvious from his posting why you (or I) originally couldn't find it, which is:
The natvis XSD isn't found in \Schemas, but in \Schemas\1033.
You have to dig one level deeper to find it, because apparently Microsoft thinks it's code-page-localized or something. Anyway, here's where I located it in my copies of Visual Studio:
Visual Studio 2012:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Xml\Schemas\1033\natvis.xsd
Visual Studio 2013:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Xml\Schemas\1033\natvis.xsd
Also, for what it's worth, the URL that Microsoft provides for the schema, http://schemas.microsoft.com/vstudio/debugger/natvis/2010, is a 3xx redirect as of this writing, so don't bother looking there.
Visual Studio 2017:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Xml\Schemas\1033\natvis.xsd

Visual Studio 2010: How to change stored procedure template

How does one change the stored procedure templates for Visual Studio in 2010 2008 database projects? I've tried changing the templates in C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\Templates\Database Project Items. This doesn't seem to affect the stored procedures created from the Add Item wizards in the database project. Am I missing something or does this method of changing stored procedure templates not work anymore? Thanks in advance.
I know it's not the exact answer you're after, but as a workaround you can edit code snippets at C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Snippets\1033\Stored Procedure
When you add a new stored proc, remove the default code, right click in the code pane, and select "insert snippet".
I'll keep searching though for how to edit the new item templates though, as it's driving me nuts.
EDIT:
I kept searching, and found it:
C:\Program Files\Microsoft Visual Studio 10.0\VSTSDB\Extensions\SqlServer\Items
create a project using the existing template.
edit it the way you want.
export the new template.
http://msdn.microsoft.com/en-us/magazine/cc188697.aspx
For Visual Studio 2015 you will find the SQL templates in this location:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\Extensions\SqlServer\Items

Visual Studio 2010 doesn't start - missing ATL100.dll

After installing Visual Studio 2010 Premium and trying to start it, following error message pops up:
Program can't be started, ATL100.dll is missing. Reinstall program to solve the problem.
I searched for the ATL100.dll and found it in:
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\ia64\Microsoft.VC100.ATL"
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x64\Microsoft.VC100.ATL"
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\x86\Microsoft.VC100.ATL"
Copying the file to "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE" also won't work.
Any tips how to fix this problem so i can start VS 2010 ?
If ATL stands for "Active Type Library" then it could be some helper DLL for it. Because ATL also is a COM based framework, it could be necessary to register the DLL. Copying would not work in that case.
regsvr32 ATl100.dll
Just a hint for the next time.
FYI,
I had same problem.I couldn't run both Visual Studio 2010 (SP1) and 2012 (U1) due to same error.
I could fix by just repair/reinstalling Visual Studio Service Pack 1.
Here are details.
Repair/Reinstall Visual Studio 2010 -> didn't help
Reinstall Visual Studio 2010 Service Pack 1 -> fixed the problem of VS2010, but VS2012 still had problem
Reinstall Visual Studio 2012 Update 1 -> fixed the problem of VS2012
During no. 3, I couldn't see any GUI. So I just pressed enter key after launch the Update 1 setup.
It'works. I re-reinstalled it and deselected all C++ components during the installation.

iBatis schemas not working in Visual Studio 2010

iBatis comes with three schema files that provide intellisense to VS.Net.
According to the iBatis help docs, the location should be this:
C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml
or this if you have x64 installed:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml
They list two other alternatives, but neither of them seem relevant to 2010.
No dice so far. Is there a different schema folder for 2010? I'm sure I'm write on top of it.
The new MyBatis website doesn't have any docs that mention it.
Ok, I'm an idiot. I figured it out. The right location is:
C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas
or this if you have an x64 box:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Xml\Schemas
VS 2010 has that new nifty Xml Schemas dialogue box built right in. After I found that, the path was obvious.

Resources