crash when compiling a read-only lpt template

Posts   
 
    
arjanv
User
Posts: 512
Joined: 15-Nov-2006
# Posted on: 30-May-2007 16:33:35   

Hi,

The template studio generates an error when compiling an lpt template which is read-only. Pressing Ctrl-Shift-B causes the template studio to crash.

Debugging shows:

An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll

Additional information: Access to the path 'C:\Program Files\Solutions Design\LLBLGen Pro v2.0\Templates\SharedTemplates\Net2.x\C#\Orangehill\LocalizedString.lpt' is denied.

While choosing "Compile ....." from the Generate menu item opens the Exception Viewer of the template studio application showing the same error message. It would appear that the menu item has a try-catch block, but the short cut does not.

Regards, Arjan Vermunt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39777
Joined: 17-Aug-2003
# Posted on: 30-May-2007 22:22:41   

Will check it out, seems like a bug.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39777
Joined: 17-Aug-2003
# Posted on: 04-Jun-2007 19:01:21   

It's not a read-only template, I can compile read-only templates just fine. WHen I don;t have read-access to the template file, I get the exception, which shows the same exception as you got.

So make it possible that you can access that file and try again.

Frans Bouma | Lead developer LLBLGen Pro
arjanv
User
Posts: 512
Joined: 15-Nov-2006
# Posted on: 05-Jun-2007 10:16:15   

I don't see how it can be that I don't have read-access to the file when I have opened it in the template studio? Isn't that reading.... wink

the steps I took were: 1. In the templateBindings viewer tab I right clicked an lpt template and chose Edit selected files 2. Then I chose the menu item Generate --> Compile Lpt templates (Compile only)

(Edit) That resulted in the attached screen shot. Where is the attach file icon?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39777
Joined: 17-Aug-2003
# Posted on: 05-Jun-2007 11:13:15   

arjanv wrote:

I don't see how it can be that I don't have read-access to the file when I have opened it in the template studio? Isn't that reading.... wink

very likely wink

the steps I took were: 1. In the templateBindings viewer tab I right clicked an lpt template and chose Edit selected files 2. Then I chose the menu item Generate --> Compile Lpt templates (Compile only)

Is it that same template? It might be another process exclusively locked the file. I have no idea what caused this as I can't repro it here. (your steps result in normal compilation)

(Edit) That resulted in the attached screen shot. Where is the attach file icon?

THe paperclip at the top of the message

It appeared attachments were disabled in this forum. Enabled.

Frans Bouma | Lead developer LLBLGen Pro
arjanv
User
Posts: 512
Joined: 15-Nov-2006
# Posted on: 05-Jun-2007 11:31:18   

Is it that same template? It might be another process exclusively locked the file.

I find these lines in the stack trace in the exception viewer:

 at ActiproSoftware.SyntaxEditor.Document.SaveFile(String path, Encoding encoding, LineEndStyle lineEndStyle)
   at SD.LLBLGen.Pro.Tools.TemplateEditor.Controls.TextEditorMDIChild.SaveFile()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.Controls.TextEditorMDIChild.Save()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.MainForm.HandleSaveAll()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.MainForm.CompileLptTemplates()

Doesn't that indicate that the file is being tried to save?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39777
Joined: 17-Aug-2003
# Posted on: 05-Jun-2007 12:19:41   

arjanv wrote:

Is it that same template? It might be another process exclusively locked the file.

I find these lines in the stack trace in the exception viewer:

 at ActiproSoftware.SyntaxEditor.Document.SaveFile(String path, Encoding encoding, LineEndStyle lineEndStyle)
   at SD.LLBLGen.Pro.Tools.TemplateEditor.Controls.TextEditorMDIChild.SaveFile()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.Controls.TextEditorMDIChild.Save()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.MainForm.HandleSaveAll()
   at SD.LLBLGen.Pro.Tools.TemplateEditor.MainForm.CompileLptTemplates()

Doesn't that indicate that the file is being tried to save?

Ah, ok, so it can't save because it's readonly while you edited it. I didn't know that the save was the problem, I tried to check whether the compilation of readonly templates was ok or not.

So if you edit a readonly file, then yes, it cant save it. It saves files before it compiles them, similar to vs.net, it's not in-memory feeding the editor contents to the compiler, the content is read from disk.

For now, make the template writable if you want to edit them. I'll add a check and a popup to see if the file is writable.

ps: you don't have to wrap a picture that many times to attach it wink (zip -> word doc -> image wink )

Frans Bouma | Lead developer LLBLGen Pro
arjanv
User
Posts: 512
Joined: 15-Nov-2006
# Posted on: 05-Jun-2007 12:25:43   

ps: you don't have to wrap a picture that many times to attach it (zip -> word doc -> image )

I had nothing better to do. simple_smile Note that Ctrl-Shift-B causes a crash of the template studio. I think that no try catch block surrounds the short-cut command.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39777
Joined: 17-Aug-2003
# Posted on: 06-Jun-2007 11:31:10   

arjanv wrote:

ps: you don't have to wrap a picture that many times to attach it (zip -> word doc -> image )

I had nothing better to do. simple_smile Note that Ctrl-Shift-B causes a crash of the template studio. I think that no try catch block surrounds the short-cut command.

Very strange, as all exceptions have to end up in the application exception handler... Anyway, I'll fix this. For now, you should work with writable templates simple_smile

Frans Bouma | Lead developer LLBLGen Pro