How to restore the default class1.cs file in a console application?

  • Thread starter Thread starter Jack Fu
  • Start date Start date
J

Jack Fu

I inadvertently changed the default class1.cs file that you get when you
create a new console project. How do I restore that default class1.cs file?
(That is, change some property or option so that when I create a new console
project, I get that default class1.cs file?)

Thanks!
 
Peter:

I'm sorry, I do not understand your answer. Could you please elaborate?

What I am trying to do is this: when I create a new console project, I want
visual studio to automatically give me a Class1.cs file that looks like
this:

Using System;
namespace < the name I entered >
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
}
}
}

Instead of getting this file, I get a more complicated one. I do not want to
more complicated one. I want the simple, default one shown above.

Thanks again for any help.
 
You said you modified the "default" class file, right? The default file is
simply part of a template used by VS.NET when a new project is created.

My suggestion was simply to get the default template from a VS.NET
installation that has not been modified and overrite the one on your
machine. Or you can reinstall VS.NET.

Jack Fu said:
Peter:

I'm sorry, I do not understand your answer. Could you please elaborate?

What I am trying to do is this: when I create a new console project, I
want visual studio to automatically give me a Class1.cs file that looks
like this:

Using System;
namespace < the name I entered >
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
}
}
}

Instead of getting this file, I get a more complicated one. I do not want
to more complicated one. I want the simple, default one shown above.

Thanks again for any help.


Peter Rilling said:
Grab the template from a friend.
 
I found a simple explanation of how to solve my problem here:
http://www.codeproject.com/dotnet/vs_templates.asp



Peter Rilling said:
You said you modified the "default" class file, right? The default file
is simply part of a template used by VS.NET when a new project is created.

My suggestion was simply to get the default template from a VS.NET
installation that has not been modified and overrite the one on your
machine. Or you can reinstall VS.NET.

Jack Fu said:
Peter:

I'm sorry, I do not understand your answer. Could you please elaborate?

What I am trying to do is this: when I create a new console project, I
want visual studio to automatically give me a Class1.cs file that looks
like this:

Using System;
namespace < the name I entered >
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
static void Main(string[] args)
{
//
// TODO: Add code to start application here
//
}
}
}

Instead of getting this file, I get a more complicated one. I do not want
to more complicated one. I want the simple, default one shown above.

Thanks again for any help.


Peter Rilling said:
Grab the template from a friend.

I inadvertently changed the default class1.cs file that you get when you
create a new console project. How do I restore that default class1.cs
file? (That is, change some property or option so that when I create a
new console project, I get that default class1.cs file?)

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top