0

I am using Visual Studio 2012 and Codesmith tools with the csla framework.

I recently regenerated my classes and now I am getting the strangest errors.In one of my aspx.cs files, after build, it says

"X does not contain a definition for Y"

However in the X class there is a definition for Y. In fact I can right click the method and navigate to it and it does exist. Visual Studio suggest generating a method for it and I do that.However now the error says

"X already defines a member called Y with the same parameter types "

i.e. the method already existed.

This makes no sense since these class files were not change what so ever with the regenerate.I know this since our files are under subversion.

Has anyone seen this problem before and have any suggestions on how to fix it?

2
  • Can you repro on a clean box? Feb 4, 2013 at 16:42
  • Are all of the reference projects building? Sometimes I see errors like this in a project which references other projects that did not build correctly. Feb 4, 2013 at 17:46

1 Answer 1

1

For anyone who finds this in the future. The problem was in the regenerate using the codesmith "Entities.csp". Turns out Class X was editable root before the regeneration however somehow managed to become an editable child instead. Although the code was still there, the combination of the X.cs, X.DataAccess, and X.generated did not have the Methods that were missing.

1
  • I wrote the CSLA templates and work for CodeSmith. If you can send support a sample that can reproduce this behavior, I'll take a look into this. Usually this error is caused by an old file that needs to be deleted. I recently fixed a bug where this could potentially happen if you didn't open your csp (Manage Outputs), view the properties, and click save after running the quickstart... Feb 8, 2013 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.