Solved

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

Posted on 2014-11-17
6
455 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 74

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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now