Solved

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

Posted on 2014-11-17
6
528 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

810 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