Page 1 of 2

'Access Denied' Error

Posted: Tue 21 May 2013 11:02
by t304pk
Hi

I just downloaded Entity Developer 5.5.105 yesterday and installed the trial. After successfully importing objects from a database, I tried to generate code (C# templates) but without success. The code generation dialog says "Access to Path 'xxxxx' is denied."
I tried several options (folder permissions, UAC - Run as Admin, Compatibility, etc) but no luck.

My machine is an HP Notebook with Intel Core i5 Processor, 8GB DDR3 RAM, 500 GB SATA HDD, running Windows 8 Ultimate x64 with Service Pack (6.2 Build 9200), VS 2012 x64 Update 2, SQL Server 2012 Express x64.

Re: 'Access Denied' Error

Posted: Fri 24 May 2013 16:20
by Shalex
1. Please post here the full call stack.
2. Try removing the ReadOnly attribute manually from the 'xxxxx' file (mentioned in the "Access to Path 'xxxxx' is denied." message).
3. Are you using TFS? Does the problem persist without TFS?

Re: 'Access Denied' Error

Posted: Mon 03 Jun 2013 19:02
by t304pk
1. I can't see a call stack on the message box. It appears in the Code Generation progress dialog.
2. 'xxxxx' in the message is the path (e.g. C:\User\ThisUser\Desktop\Output), not a file.
3. I'm not using TSF. VS 2012 Ultimate Update 1 only.

Re: 'Access Denied' Error

Posted: Mon 03 Jun 2013 22:42
by Joe Smith
I'm getting the same error.

My project uses "NHibernate" (C#), "Data Annotations Metadata" and "Repository And Unit of Work" templates. If I add a "MVC Controller" or "MVC View Advanced" template and try to generate the code from the ED IDE (I'm not using the VS add-in) I get the error "Access to Path 'xxxxx' is denied." where xxxxx is my project folder. As a result, no classes are generated.

The error message appears in the Code Generation progress dialog.

Obviously, ED has access to the project folder :wink:

Re: 'Access Denied' Error

Posted: Tue 04 Jun 2013 13:57
by Shalex
1. Try giving an access for Everyone to the project folder ('xxxxx' in the message).

2. Please obtain a call stack by attaching from Visual Studio (Debug | Attach to Proccess) to the process of Entity Developer. Before attaching don't forget to make these settings in your Visual Studio: a) in the (Debug | Exceptions) window select Common Language Runtime Exceptions; b) in the (Tools | Options) window, Debugging | General - clear Enable Just My Code (Managed Only).

Re: 'Access Denied' Error

Posted: Wed 05 Jun 2013 18:28
by Joe Smith
The folder has full access permissions because it's the project folder and ED can save the project with no errors.

Here is the stack trace:

Code: Select all

mscorlib.dll!System.IO.__Error.WinIOError(int errorCode = 258946908, string maybeFullPath = "C:\\Users\\MyUserName\\Documents\\EntityDeveloper Projects\\My Project Folder Name") + 0x169 byte	
 	mscorlib.dll!System.IO.FileStream.Init(string path, System.IO.FileMode mode, System.IO.FileAccess access = Write, int rights, bool useRights = false, System.IO.FileShare share, int bufferSize = 4096, System.IO.FileOptions options, Microsoft.Win32.Win32Native.SECURITY_ATTRIBUTES secAttrs, string msgPath, bool bFromProxy, bool useLongPath, bool checkHost) + 0x549 byte	
 	mscorlib.dll!System.IO.FileStream.FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options, string msgPath, bool bFromProxy, bool useLongPath, bool checkHost) + 0x43 byte	
 	mscorlib.dll!System.IO.StreamWriter.CreateFile(string path, bool append, bool checkHost) + 0x4a byte	
 	mscorlib.dll!System.IO.StreamWriter.StreamWriter(string path, bool append, System.Text.Encoding encoding = {System.Text.UTF8Encoding}, int bufferSize = 1024, bool checkHost) + 0x7d byte	
 	mscorlib.dll!System.IO.File.InternalWriteAllText(string path, string contents = "\r\n\r\n", System.Text.Encoding encoding, bool checkHost) + 0x41 byte	
 	mscorlib.dll!System.IO.File.WriteAllText(string path, string contents) + 0x2c byte	
 	EntityDeveloper.Orm.Common.dll!EntityDeveloper.CodeGenerationService.Save(string fileName, System.Text.StringBuilder source, EntityDeveloper.TemplateEngine.OverwriteMode overwriteMode) + 0x8a byte	
 	EntityDeveloper.Orm.Common.dll!EntityDeveloper.StandaloneCodeGenerationService.Save(System.Collections.Generic.List<EntityDeveloper.TemplateEngine.OutputFile> outputFiles = Count = 1) + 0x83 byte	
 	EntityDeveloper.Orm.Common.dll!EntityDeveloper.CodeGenerationService.Generate(bool save, System.Collections.Generic.IEnumerable<EntityDeveloper.ModelTemplate> templates) + 0x6a byte	
 	EntityDeveloper.Orm.Common.dll!EntityDeveloper.EditorDialogs.r.a(object A_0) + 0x73 byte	
 	mscorlib.dll!System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(object state) + 0x3e byte	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 byte	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 byte	
 	mscorlib.dll!System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() + 0x60 byte	
 	mscorlib.dll!System.Threading.ThreadPoolWorkQueue.Dispatch() + 0x149 byte	
 	mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x5 byte	
I hope this can help you fix the problem :wink:

Re: 'Access Denied' Error

Posted: Thu 06 Jun 2013 16:36
by Shalex
1. Are you using any custom (modified by you) template? If yes, try disabling it (them). Does it help?
2. Send us a test model (*.edml and *.edps) and specify all templates used in your model. If there are custom templates, send us them as well.

Re: 'Access Denied' Error

Posted: Tue 11 Jun 2013 21:18
by Joe Smith
Shalex wrote:1. Are you using any custom (modified by you) template? If yes, try disabling it (them). Does it help?
2. Send us a test model (*.edml and *.edps) and specify all templates used in your model. If there are custom templates, send us them as well.
1. No, I don't use any custom templates.
2. I've sended you a test project with a subset of my classes and all of the templates I use.

Re: 'Access Denied' Error

Posted: Fri 14 Jun 2013 14:13
by Shalex
Thank you for the test model. We have reproduced the error. We will post here when the problem is fixed.

Re: 'Access Denied' Error

Posted: Wed 19 Jun 2013 09:53
by Shalex
The bug with generating "Access Denied" error when using MVC templates is fixed. We will post here when the corresponding build of Entity Developer is available for download.

Re: 'Access Denied' Error

Posted: Thu 20 Jun 2013 16:03
by Shalex
New build of Entity Developer 5.5.130 is available for download now!
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=32&t=27378.

Re: 'Access Denied' Error

Posted: Fri 21 Jun 2013 17:28
by Joe Smith
The error is now gone but no code is generated for "MVC View Advanced" and "MVC Controller" templates :?

My project uses the following templates:
  • Data Annotations Metadata
  • MVC Controller
  • MVC View Advanced
  • NHibernate
  • Repository And Unit of Work

Re: 'Access Denied' Error

Posted: Mon 24 Jun 2013 16:07
by Shalex
Joe Smith wrote:no code is generated for "MVC View Advanced" and "MVC Controller" templates
Please set the "Output > Project" and "Output > Project Folder" properties of the "MVC View Advanced" and "MVC Controller" templates to specify the location of the generated code.

Re: 'Access Denied' Error

Posted: Mon 24 Jun 2013 16:48
by Joe Smith
Shalex wrote:Please set the "Output > Project" and "Output > Project Folder" properties of the "MVC View Advanced" and "MVC Controller" templates to specify the location of the generated code.
The output folder is set but no output is generated anyway

Re: 'Access Denied' Error

Posted: Tue 25 Jun 2013 12:16
by Shalex
1. Are you using predefined or custom "MVC View Advanced" and "MVC Controller" templates?
2. Please send us a small test project so that we can reproduce the issue in our environment.