SPSF SharePoint Software Factory Linq to SharePoint creating context error!

Sep 4, 2013 at 1:23 PM
Edited Sep 4, 2013 at 1:25 PM
I am using SPSF to create Linq to SharePoint context class and I get this error:

At first it was working fine, but after a several recreations of the same class to add the list definitions I got this error! Please help!

Microsoft.Practices.RecipeFramework.ActionExecutionException: An exception occurred during the binding of reference or execution of recipe LinqToSharePoint.
Error was: Action RunCommand failed to execute:
Command 'C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\spmetal.exe /web:"http://testsp:1306/" /parameters:"C:\Users\test1\Desktop\SharePoint 2010 LOA\IWSP2010\LTSP\LTSPContext.xml"
/language:csharp /namespace:IWSP2010 /code:"C:\Users\test1\AppData\Local\Temp\2\tmp67A8.tmp"' failed.
You can remove the reference to this recipe through the Guidance Package Manager. --->
System.Exception: Command 'C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\spmetal.exe
/web:"http://testsp:1306/" /parameters:"C:\Users\test1\Desktop\SharePoint 2010 LOA\IWSP2010\LTSP\LTSPContext.xml" /language:csharp /namespace:IWSP2010 /code:"C:\Users\test1\AppData\Local\Temp\2\tmp67A8.tmp"' failed
at SPALM.SPSF.Library.Helpers.RunProcess(DTE dte, String command, String parameters, Boolean WaitForExit, String WorkingDirectory, Boolean ClearScreen)
at SPALM.SPSF.Library.Helpers.RunProcess(DTE dte, String command, String parameters, Boolean WaitForExit, Boolean ClearScreen)
at SPALM.SPSF.Library.Actions.RunCommand.Execute()
at Microsoft.Practices.RecipeFramework.Recipe.Microsoft.Practices.RecipeFramework.Services.IActionExecutionService.Execute(String actionName, Dictionary2 inputValues)
at Microsoft.Practices.RecipeFramework.Recipe.Microsoft.Practices.RecipeFramework.Services.IActionExecutionService.Execute(String actionName)
at SPALM.SPSF.Library.Coordinators.ConditionalCoordinator.Run(Dictionary
2 declaredActions, XmlElement coordinationData)
at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
--- End of inner exception stack trace ---
at Microsoft.Practices.RecipeFramework.Recipe.UndoExecutedActionsAndRethrow(Exception ex)
at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.ExecuteFromTemplate(String recipe, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.ExecuteRecipe(Boolean executeActions)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.RunFinished()

Sep 4, 2013 at 1:24 PM
I tried fixing this error by Activating/Deactivating SPSF from Guidance Package Manager, but it didn't work for me as it worked for other developers.
Coordinator
Sep 4, 2013 at 1:55 PM
Hi, did you try to run the command C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\spmetal.exe /web:"http://testsp:1306/" /parameters:"C:\Users\test1\Desktop\SharePoint 2010 LOA\IWSP2010\LTSP\LTSPContext.xml" directly on cmdline?

SPSF is just executing SPMetal here, so obviously that one fails.
Maybe the file is read-only because it is not yet checked out from Source Control?
Sep 4, 2013 at 2:11 PM
Edited Sep 4, 2013 at 2:13 PM
Hi Matein78,

I've just done your proposal and I got this error in cmd:

I've run this cmdline:

C:(location)> SPMETAL.EXE /web:"http://testsp:1306/" /parameters:"C:\Users\test1\Desktop\SharePoint 2010 LOA\IWSP2010\LTSP\LTSPContext.xml" /language:csharp

Error: Value can not be null.
Parameter Name: key

Coordinator
Sep 5, 2013 at 6:54 AM
Hm, the call seems to be right, so it might e a problem somewhere else.
If you cannot run SPMetal directly then the error is unrelated to SPSF.

It might have to do with a change in your web which SPMetal cannot handle.

As I cannot reproduce the error maybe you can check a simlar command on another web.
Find more info about SPMetal here and here
Sep 5, 2013 at 8:32 AM
Hi matein78,

Thank you for your answers. I created new SharePoint Web Application and now works fine. We'll see until when it's going to stay like that. In mean time I'll try to find a solution with SPMetal.exe and if found it I'll write it here.

Thank you
Coordinator
Sep 5, 2013 at 8:41 AM
Thanks a lot for your feedback! :)
Hoping using SPSF benefits you!