System.Security.SecurityException

eldiego
Posts: 3
Joined: Fri Jan 11, 2013 3:42 am

System.Security.SecurityException

Postby eldiego » Fri Jan 11, 2013 3:51 am

Hi, I am getting a System.Security.SecurityException with WURFL .Net API at Line 32

Code: Select all

Line 30:   var wurflPatchFile = HttpContext.Current.Server.MapPath(WurflPatchFilePath);
Line 31:   var configurer = new InMemoryConfigurer().MainFile(wurflDataFile).PatchFile(wurflPatchFile);
Line 32:   var manager = WURFLManagerBuilder.Build(configurer);
Here the stack trace:

Code: Select all

[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +61
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +644
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access) +67
   WURFL.Resource.WURFLResources.WurflResource.GetStream() +29
   WURFL.Resource.WurflParser.ParsePatches(IEnumerable`1 patchesPath) +105
   WURFL.Resource.WurflParser.Parse(IWurflResource wurflResource, IWurflResource[] patchResources) +71
   WURFL.Devices.DeviceRepositoryBuilder.Build(String wurflFile, String[] patchFiles, MatchMode matchMode) +45
   WURFL.WURFLManagerBuilder.BuildFrom(Configuration configuration, ICache`2 cache) +81
   WURFL.WURFLManagerBuilder.Build(IWURFLConfigurer configurer) +49
My Web.Config has full trust level and the wurlf.zip file have full access.

Can anyone help me?

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: System.Security.SecurityException

Postby kamermans » Sun Jan 13, 2013 11:35 pm

Hi,

We are looking into the issue, but in the meantime, can you verify that your application's user has access to the WURFL file you are using?
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: System.Security.SecurityException

Postby kamermans » Mon Jan 14, 2013 12:01 pm

It seems the only explanation is that the trust level is too low, however, as of API 1.4.3 we support the Medium and Full trust levels, so I'm at a loss as to what the problem could be. Note that we released version 1.4.4 on Friday evening, so I would recommend using the new version anyway.

Download:
http://sourceforge.net/projects/wurfl/f ... API/1.4.4/

NuGet:
http://www.nuget.org/packages/WURFL_Official_API
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!

eldiego
Posts: 3
Joined: Fri Jan 11, 2013 3:42 am

Re: System.Security.SecurityException

Postby eldiego » Wed Jan 16, 2013 4:54 am

Thanks for the reply. Now I download the new version 1.4.4 and check again.

eldiego
Posts: 3
Joined: Fri Jan 11, 2013 3:42 am

Re: System.Security.SecurityException

Postby eldiego » Fri Feb 08, 2013 9:18 am

Hi,
version 1.4.4 did not solve the issue. I'm using WURFL in a cluster evironment and the solution is to add wurfl.dll to the Windows GAC. This can be done using caspol.exe or simply drag&drop the dll into c:\windows\assembly folder.

kamermans
Posts: 393
Joined: Mon Jun 06, 2011 9:50 am

Re: System.Security.SecurityException

Postby kamermans » Fri Feb 08, 2013 12:26 pm

Thanks for the feedback, we will find an appropriate place in the documentation to add this tip.
Thanks,

Steve Kamerman
ScientiaMobile

Make sure you check out our WURFL Cloud, WURFL InSight and WURFL InFuze products!


Who is online

Users browsing this forum: No registered users and 13 guests