Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a VS C# project (project1) that compiles and works fine without any errors. I have created a second project (project2) that adds a number of files as links from the first project. I've added all the necessary references etc. I've created a conditional compilation symbol for project2. Project2 is giving one error:
There is no argument given that corresponds to the required formal parameter 'info' of 'Curve.Curve(SerializationInfo, StreamingContext)'

 public CurveCollection(List<Rhino.Geometry.Curve> curves) 
{
     this.CurveList = this.CurveList;            
}

I've searched through the forums to try and find why this error is being caused, and I'm at a loss.
Can someone shed some light on what I may be missing?

What I have tried:

I've searched through the forums to try and find why this error is being caused, and I'm at a loss. I've tried relinking the file but that didn't solve the issue.
Posted
Updated 8-Aug-18 19:27pm

this.CurveList = this.CurveList; 


You're (probably) assigning a (generic) list "to itself"; which is not initialized; triggering constructors that require parameters.

You probably wanted to:

C#
this.CurveList = curves;
 
Share this answer
 
Comments
Member 8571531 9-Aug-18 10:10am    
Hi Gerry Schmitz,
Thanks for the feedback. At first glance your suggestion was obvious to me but when I tried that it didn't solve the issue, even after I initialized the CurveList as a new list.
I'm not convinced that the code you show is where the error is, or if it is that you are looking at the same version of the files.

The error is saying that you are trying to create a Curve instance, and the class has only a formal constructor that requires at least one parameter, which is a SerializationInfo object - presumably you are trying to construct it using a parameterless constructor which doesn't exist.
But that code - despite doing nothing at all unless you have got very unpleasant with the CurveList property setter and started constructing objects in it - doesn't show any use of Curve instances. All it does is set a value to itself and ignore the formal parameter value completely.

I'd start by wondering exactly what you are doing: "adding a number of files as links from another project" is not the way I would go - I'd add the whole project as a reference and then use it's objects directly so there is less risk of incompatible changes occuring. What I suspect is that the "file links" ty=you think you have established are actually copies, and they aren't the same any more - so the line you think you are referencing to look at the error is not what (or where) you believe it is ...
 
Share this answer
 
Comments
Member 8571531 9-Aug-18 10:07am    
Hi OriginalGriff,
Thanks for the feedback. To shed a little more light around the problem, I've inherited a VS project (project1) that builds a DLL for a specific application (hostApp1). There is now a new version of the host application (hostApp1 v2.0) which has some SDK breaks. In the same VS solution, I've created a new VS project (project2) which links a number of files from project1 since they are still valid, and I've added a conditional compilation symbol that allows for 99.9% of the code in project1 to be reused. This also allows me to manage one code base that is shared between two projects, while still being able to compile two separate dll's.

I agree with you that the root of the error might be elsewhere but I've been unable to find where it might be. More puzzling is why the code listed above works for project1 but not for project2.
[no name] 11-Aug-18 18:27pm    
Most "cross-linked" projects have been a headache for me; including copying (the link goes, but not the file). Eventually, you wind up updating the same project from different places and contexts; and are not even aware of it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900