XmlException in designer

Posts   
 
    
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 03-May-2014 15:32:54   

I have a problem with the designer. It gives me a XmlException when I open a certain projectfile. This is caused by a table valued function call.

Steps to reproduce from scratch:

Create a table valued function in a new SQL database (I've used 2012):

CREATE FUNCTION test
(
    @param1 int,
    @param2 int
)
RETURNS @result TABLE(ID int, Item nvarchar(20), RowNum int) 
AS
BEGIN
    
    RETURN 
END

Create a new LLBLGen Pro Runtime project. Add relational model from the just created database. Right click the table valued function in the catalog explorer and click on Create call definitions.... Add the call to the project with the default settings. Save and close the project. Reopen the project.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 03-May-2014 15:45:54   

what version of the designer? DId you try the latest build?

Frans Bouma | Lead developer LLBLGen Pro
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 03-May-2014 15:54:36   

Sorry, I used version 4.1 March 12th. I find it strange that I've came across this now as I thought I've used this feature for quite some now. So I tried version 4.0 as well but this comes with the same error.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-May-2014 07:29:11   

I cannot reproduce it using the latest v4.1 build (March 12th) and your exact steps. If you still gets the exception please attach a .llblgenproj file that reproduces the problem, or check whether your steps actually reproduces the issue.

David Elizondo | LLBLGen Support Team
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 07:32:35   

Strange, I can reproduce it on my laptop and on my workstation. I've attached the project.

Attachments
Filename File size Added on Approval
test.llblgenproj 7,690 05-May-2014 07:32.48 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 05-May-2014 08:06:37   

Make sure you are using the latest build on both computers.

I see that your .llblgenproj's xml has some strange things, like: it doesn't have the TVF in the catalog but it has the mapping in the typedView, and thus the error. However I cannot reproduce it starting with a project from scratch.

David Elizondo | LLBLGen Support Team
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 08:52:15   

I've double checked the build on both computers. In the about windows it says version 4.1 Final. Released on March 12th, 2014.

I've used a local SQL 2012 database with a named instance on both machines.

El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 09:09:55   

I've tried it with version 4.0 and I got the same error. I can't be the first one to find this error in version 4.0 and 4.1. So it must be something I do or some config on both of my machines. My laptop is a windows 8.1 x64 and my workstation is windows 8 x64. I've tried the LLBLGenPro_x86.exe and it gives me the same error.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 05-May-2014 15:08:17   

When I load your project, it indeed gives an xml error that some element is missing. Did you merge projects by any chance?.

Frans Bouma | Lead developer LLBLGen Pro
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 15:15:38   

Nope, I created a new project from scratch and saved it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 05-May-2014 15:18:47   

El wrote:

Nope, I created a new project from scratch and saved it.

Hmm... using that function? Ok, we'll look into it.

Frans Bouma | Lead developer LLBLGen Pro
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 15:24:29   

Otis wrote:

El wrote:

Nope, I created a new project from scratch and saved it.

Hmm... using that function? Ok, we'll look into it.

OK, thanks. Please let me know whether I can be of any assistance.

In the mean time, can anybody create and attach a working project for this single function? Maybe I can manually correct the corrupted project file.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 05-May-2014 15:37:52   

Hmm, can reproduce it with your test function. Looking into it.

(edit) the whole catalog/schema isn't in the project file. I think it's a check to see whether data is in the catalog is buggy (read: it doesn't check tvfs in the schemas).

(edit) indeed. If you add 1 table to the project, it will save properly. Fixing...

(edit) yup flushed

public void SerializeToWriter(ISerializer serializer)
{
    if((this.Tables.Count <= 0) && (this.Views.Count <= 0) && (this.StoredProcedures.Count <= 0) && (this.Sequences.Count <= 0))
    {
        // empty
        return;
    }

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 05-May-2014 16:32:05   

Attached is the 4.1 fix.

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.DBDriverCore.dll 200,704 05-May-2014 16:32.16 Approved
Frans Bouma | Lead developer LLBLGen Pro
El Barto
User
Posts: 64
Joined: 09-Nov-2006
# Posted on: 05-May-2014 16:56:16   

Thanks. This fix works.