?
Solved

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

Posted on 2014-11-17
6
Medium Priority
?
712 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

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!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

777 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