Solved

Missing partial modifier on declaration of type 'xxxxxxxx.cs' another partial declaration of this type exists

Posted on 2014-11-17
6
590 Views
Last Modified: 2014-11-26
Hello Experts,
I am trying to convert a Visual Studio 2003 project to VS 2010.   Everything is success until I try to compile.  Below are the compilation.  Please try to help.  All the errors are related to just 1 program.  Thank you in advance.  

1. Missing partial modifier on declaration of type 'DebitLoad.HelpXXXX'; another partial declaration of this type exists      C:\Projects\DebitLoad\trunk\src\main\Website\HelpXXXX.aspx.cs.

2. Ambiguity between 'DebitLoad.HelpManager.lblMsg' and 'DebitLoad.HelpXXXX.lblMsg'      C:\Projects\DebitLoad\trunk\src\main\Website\HelpXXXX.aspx.cs

3. Ambiguity between 'DebitLoad.HelpXXXX.fileUpload' and 'DebitLoad.HelpXXXX.fileUpload'      C:\Projects\DebitLoad\trunk\src\main\Website\HelpXXXX.aspx.cs
0
Comment
Question by:RadhaKrishnaKiJaya
6 Comments
 
LVL 18

Expert Comment

by:Richard Lee
ID: 40449324
There are several things you can try:

1. Cleaning Solution

Try cleaning the solution to remove conflicting assemblies in bin folder

2. Ensure consistency

Ensure that all classes have the partial modifier. See SO question http://stackoverflow.com/questions/23095067/missing-partial-modifier-on-declaration-of-type-class-name-another-partial-de

3. Clean Temporary Files

Clear the ASP.NET temporary files folder to avoid conflicts. http://stackoverflow.com/questions/8533473/missing-partial-modifier-on-declaration-of-type-x-another-partial-declaration-o
Hope this helps!
0
 
LVL 4

Expert Comment

by:ItWorked
ID: 40449527

1. Partial keyword in C#

If you see Partial Keyword in C#, you would find that each member has to be partial. so It's like if you have two classes with name of Bike  both has to be partial. If either is not mentioned as partial then it would give error you mentioned in 1

2. Ambiguity

Most probable reason is that a Type (class) is having same name in two different namespaces or libraries or assemblies. So you must use fully qualified name so that compiler can identify what you are referring to. So in your case for example, 'DebitLoad.HelpManager.lblMsg' and 'DebitLoad.HelpXXXX.lblMsg'; you must update your code such that places where you have mentioned lblMsg, Replace that with fully qualified name. Well that can be either of one you mentioned and you have to identify manually which is correct in your case.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 40449737
@ItWorked

Correction:

so It's like if you have two classes within the same namespace, both with name of Bike  both has to be partial.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Expert Comment

by:Vikram Singh Saini
ID: 40451473
The point I am suggesting might not be exact solution. But it helped me lot for fixing such annoying issues over 3 years of development.

I would recommend you to use JetBrains ReSharper. Trial can be used for 30 days.

How it helps

- Provide you option to fix things automatically (when possible). Or will provide you suggestion for how to fix.
- Also provide tips to improve code which help you to write clean code in last.

* Note - I'm not promoter for ReSharper who is paid for such things. It's just that I found it useful and so shared.
0
 

Accepted Solution

by:
RadhaKrishnaKiJaya earned 0 total points
ID: 40458319
Richard Lee, Vikram Singh Saini, kaufmed and ItWorked,
First of all than you for your time and help.  The issue is fixed.  The problem was, 1. I did not have a IIS setup.  2. The default.aspx was not set in the IIS and web.config file.  Once they were added, the website it is working fine.

Thank you again.
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 40466413
The reason is described.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question