Solved

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

Posted on 2014-11-17
6
564 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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