Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a window application, the main form file name is 'MainForm.cs', it works well, however, one day I found there is one stange file (MianForm_hide.cs), which is located in my project file ! Can anyone help to provide the information of why it happens ? And can I remove this file ? Thanks.
Posted
Comments
krumia 14-Jun-12 4:25am    
Maybe someone else created it.

It's a new one on me - I have never heard of VS inventing source files.

Back up your project (just drag and drop the whole solution folder to a backup folder with the CTRL key held down) and have a look at it's content. If you don't recognise it as your code, delete it from the project and check it is gone from the project source folders. Then rebuild your project - any new errors? If not, then you didn't need it. If so, then you need to look at what those errors are and you should get a clue where it came from. You can always restore from the backup folder if you did need it.
 
Share this answer
 
If that form is not being used at any place in your project then you are good to remove it.

Also make sure that class name is same for both forms or not and Class name is used as partial class or not. Because in .Net you have provision of partial class concept where you can write partial code in one file and other code (of same class) is other files.

This is same like, system is creating a designer file for windows form.

System is not creating any file by it self so you have to make sure from above two scenarios and if those are not the case then you are good to remove.

Thanks
Rushikesh Joshi
 
Share this answer
 
Hi,

First, is this typo mistake or you have the same file name ? (MianForm_hide.cs) instead (MainForm_hide.cs) ?

there is no such auto generated file required. check what code you have written in it.

if there is some function inside this form then find all references to see if it is being used anywhere. also check the filename in your project if you are creating instance somewhere. once you confirm that it is not required. you can exclude that file for some time and once you are sure then you can delete it.

Thanks
-Amit
 
Share this answer
 
it may due to my mistake to add this file in my progrm, so delete it to solve this problem
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 9-May-13 0:52am    
Kuo, why did you post this where you would only allowed to post answers, solutions, something to help people?
Worse, why did you self-accept it formally?
Did you know that many lost their membership account for this kind of abuse, as this is often considered as cheating?

I don't want to bring it to the attention of the community (abuse forum) because you have only two such cases, but please undo it.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900