Print Page | Close Window

Save File Error when saving a new model

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1555
Printed Date: 08-Apr-2025 at 8:33pm


Topic: Save File Error when saving a new model
Posted By: zinovate
Subject: Save File Error when saving a new model
Date Posted: 12-Nov-2009 at 2:17pm

I am currently running Devforce 5.2.3.1

When I create a new Silverlight Devforce application I receive the following error when attempting to save the model for the first time.

---------------------------

Save File Error

---------------------------

Failed to save model file: 'C:\Users\Ben\Documents\Visual Studio 2008\Projects\SilverlightApplication3\SilverlightApplication3Web\SilverlightApplication3Web.ibedmx'.

Code generation compiler error: Running transformation: System.InvalidOperationException: Sequence contains no elements

at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)

at IdeaBlade.VisualStudio.OM.DomainModelTemplateBase.Generate()

at Microsoft.VisualStudio.TextTemplating32D922B347BF7ED4B134DB672D544EB5.GeneratedTextTransformation.TransformText() in c:\Users\Ben\AppData\Local\Temp\o9f5ze5f.0.cs:line 24

---------------------------

OK

---------------------------




Replies:
Posted By: zinovate
Date Posted: 12-Nov-2009 at 2:21pm
I opened one of the samples "\100SLV_SimpleSilverlightApp\CodeCS" and I am able to save that model without issue. I have tried creating solutions in several locations with no luck..
Ben


Posted By: zinovate
Date Posted: 12-Nov-2009 at 6:00pm
Issue resolved,
head slapper..
 
If you open the DevForce tool in VS and try to save without assigning an entity model or web service, you will get the error posted above.
Makes total sence:
 
From the error:
Code generation compiler error: Running transformation: System.InvalidOperationException: Sequence contains no elements.
 
The generator looks like it fires the t4 template with an empty set of elements.
I'd like to see a friendlier warning, maybe catching that the "model" file had no EM or webservice and don't attempt to code gen.
 
Thanks.
Ben


Posted By: kimj
Date Posted: 13-Nov-2009 at 4:00pm
This is actually a bug, since an InvalidOperationException like that shouldn't be bubbling up to the user.   We have this fixed in current bits, and thanks for letting us know about it.



Print Page | Close Window