How Can I Modify the Default UnitTest1.cs File Template in the Visual Studio 2010 C# Test Project Template?

你说的曾经没有我的故事 提交于 2021-02-07 09:35:56

问题


I know I can export my own project template, but I'd like to know how to edit the actual, Visual Studio Test Project template's C# UnitTest1.cs file. I've been unable to locate it in my C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE folder tree. Anybody know where this lives so I can modify it?


回答1:


Try C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\BasicUnitTest.zip

Or

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\SimpleUnitTest.zip

  1. Extract the files from Archive,
  2. Change the SimpleUnitTest.cs as you want
  3. Back up the old SimpleUnitTest.zip
  4. Zip back the now changed files and name the Archive SimpleUnitTest.zip and copy it to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\1033\ location.

After that:

  1. Back up the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\1033\SimpleUnitTest.zip folder
  2. copy the changed, unnpacked items (in your case SimpleUnitTest.cs) over to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\1033\SimpleUnitTest.zip.


来源:https://stackoverflow.com/questions/5434772/how-can-i-modify-the-default-unittest1-cs-file-template-in-the-visual-studio-201

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!