Error: Unable to load file via resource SqlMap.config as resource.
Hello All! After many successful website deployments using Ibatis, I am for the first time trying to deploy a Windows Application using Ibatis. (VB.NET using Visual Studio 2005) I'm sure that this is a very simple problem, but I seem to be really stuck. I can't seem to get the SqlMap.config and providers.config files to be installed in the correct place for the application to find them at runtime. My initial attempt was to, as the documentation suggested, put them in the bin/Debug folder. This works fine on my development machine but fails with the Error: Unable to load file via resource SqlMap.config as resource. message when I install it on a client machine. So far, I've been unable to figure out how to tell Visual Studio to include these files in the correct location to make them work once installed. I also tried manually copying the sqlmap.config and providers.config files to the bin/Debug folder within the publish folder before running setup.exe, but to no avail. Has anyone successfully deployed a windows application to client machines this way? Thanks! --Erin
RE: Error: Unable to load file via resource SqlMap.config as resource.
Thank you! I was able to get it working by doing that, although it still copies my Sql Map files to the wrong place and I have to manually move them but hopefully I will get that figured out here this morning. All symptoms of my lack of familiarity with windows applications, I'm sure. Again, thank you! From: Nicholas L. Piasecki [mailto:nicho...@piasecki.name] Sent: Thursday, December 11, 2008 4:27 PM To: user-cs@ibatis.apache.org Subject: RE: Error: Unable to load file via resource SqlMap.config as resource. Under the Project menu, choose Show All Files and include your config files in your project. Click on one of the files in Solution Explorer and in the Properties pane, change Copy to Output Directory from Do not copy to Copy if newer. If it's a ClickOnce deployment (and it sounds like it is), also change the Build Action from None to Content-otherwise, mage won't automatically pick it up. Hope that helps. V/R, Nicholas Piasecki From: Erin Rollenhagen [mailto:e...@entrepreneurialtechnologies.com] Sent: Thursday, December 11, 2008 4:25 PM To: user-cs@ibatis.apache.org Subject: Error: Unable to load file via resource SqlMap.config as resource. Hello All! After many successful website deployments using Ibatis, I am for the first time trying to deploy a Windows Application using Ibatis. (VB.NET using Visual Studio 2005) I'm sure that this is a very simple problem, but I seem to be really stuck. I can't seem to get the SqlMap.config and providers.config files to be installed in the correct place for the application to find them at runtime. My initial attempt was to, as the documentation suggested, put them in the bin/Debug folder. This works fine on my development machine but fails with the Error: Unable to load file via resource SqlMap.config as resource. message when I install it on a client machine. So far, I've been unable to figure out how to tell Visual Studio to include these files in the correct location to make them work once installed. I also tried manually copying the sqlmap.config and providers.config files to the bin/Debug folder within the publish folder before running setup.exe, but to no avail. Has anyone successfully deployed a windows application to client machines this way? Thanks! --Erin
RE: Error: Unable to load file via resource SqlMap.config as resource.
It now works smoothly. Thank you, Nicholas, for your help! In case anyone else has a similar problem, here is what finally fixed the last issue, the SqlMap files themselves not being found at runtime: I had the SqlMaps files in a folder called SqlMaps and was referencing them as such in the SqlMap.config file. It seemed to me that the ClickOnce deployment tool did not create this SqlMaps folder in the installation directory, which seemed to be causing the problem. When I moved the map files outside of the folder, and made sure they were set to Include on the Application Files page in the Publish wizard and then set the Build Action to Content and the Copy to Output Directory to Copy if newer as you suggested for the config files, it works correctly as installed. Thank you again for your help, especially since my problems really had more to do with unfamiliarity with the Windows App. side of VS2005 than SqlMaps. From: Erin Rollenhagen [mailto:e...@entrepreneurialtechnologies.com] Sent: Friday, December 12, 2008 7:56 AM To: user-cs@ibatis.apache.org Subject: RE: Error: Unable to load file via resource SqlMap.config as resource. Thank you! I was able to get it working by doing that, although it still copies my Sql Map files to the wrong place and I have to manually move them but hopefully I will get that figured out here this morning. All symptoms of my lack of familiarity with windows applications, I'm sure. Again, thank you! From: Nicholas L. Piasecki [mailto:nicho...@piasecki.name] Sent: Thursday, December 11, 2008 4:27 PM To: user-cs@ibatis.apache.org Subject: RE: Error: Unable to load file via resource SqlMap.config as resource. Under the Project menu, choose Show All Files and include your config files in your project. Click on one of the files in Solution Explorer and in the Properties pane, change Copy to Output Directory from Do not copy to Copy if newer. If it's a ClickOnce deployment (and it sounds like it is), also change the Build Action from None to Content-otherwise, mage won't automatically pick it up. Hope that helps. V/R, Nicholas Piasecki From: Erin Rollenhagen [mailto:e...@entrepreneurialtechnologies.com] Sent: Thursday, December 11, 2008 4:25 PM To: user-cs@ibatis.apache.org Subject: Error: Unable to load file via resource SqlMap.config as resource. Hello All! After many successful website deployments using Ibatis, I am for the first time trying to deploy a Windows Application using Ibatis. (VB.NET using Visual Studio 2005) I'm sure that this is a very simple problem, but I seem to be really stuck. I can't seem to get the SqlMap.config and providers.config files to be installed in the correct place for the application to find them at runtime. My initial attempt was to, as the documentation suggested, put them in the bin/Debug folder. This works fine on my development machine but fails with the Error: Unable to load file via resource SqlMap.config as resource. message when I install it on a client machine. So far, I've been unable to figure out how to tell Visual Studio to include these files in the correct location to make them work once installed. I also tried manually copying the sqlmap.config and providers.config files to the bin/Debug folder within the publish folder before running setup.exe, but to no avail. Has anyone successfully deployed a windows application to client machines this way? Thanks! --Erin
Anyone successfully using Ibatis.NET under medium trust?
I'm using Ibatis.Net DataMapper version 1.6.2 . When attempting the first query on a site hosted with GoDaddy, I get the following exception. Given what a hassle it has been to work with GoDaddy so far, I am ready to throw in the towel and ask the client to switch to a better host, but I thought I'd try the mailing list first. I did see where someone else had asked a similar question earlier but it didn't seem like there was a clear consensus on whether or not this should work in a medium-trust environment. Given how prevalent GoDaddy hosting accounts are, I'm guessing someone else must have run into this. If you have gotten it work, I'd love to hear from you. Thanks! [SecurityException: That assembly does not allow partially trusted callers.] EntrepreneurialTechnologies.DatabaseHelper.SelectMapperClient.selectObject(S tring selectName, Object params) in SelectMapperClient.vb:26 EntrepreneurialTechnologies.Security.UserService.LogInUser(String userName, Int32 applicationId, String password, TimeSpan revalidation, Int16 maxAttempts) in UserService.vb:18 Login.LoginButton_Click(Object sender, EventArgs e) +349 System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +90 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +76 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.Rai sePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +177 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213 System.Web.UI.Page.ProcessRequest() +86 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.login_aspx.ProcessRequest(HttpContext context) +4 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionSte p.Execute() +358 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean completedSynchronously) +64
RE: Is IBATIS-NET still alive?
Personally I think it's a fantastic tool and would love to see it continue (and don't know what I'd do without it!) -Original Message- From: Clinton Begin [mailto:clinton.be...@gmail.com] Sent: Wednesday, May 06, 2009 8:47 AM To: user-cs@ibatis.apache.org Subject: Re: Is IBATIS-NET still alive? It's an Apache project. It lives as long as there's a community willing to support it. Why don't you all discuss options and vote a new team in. I wish I had time to work on it, as iBATIS.NET has all the potential to be even better than the Java version. Clinton On 2009-05-06, Sal Bass salbass...@hotmail.com wrote: Same here. My team is on the verge of using it on a new project which is going to have a long lifespan. Getting a little concerned. Date: Wed, 6 May 2009 16:04:50 +0800 Subject: Is IBATIS-NET still alive? From: sky...@gmail.com To: user-cs@ibatis.apache.org No activities in the trunk/cs for more than six months !!! I cannot stop worrying if the ibatis-net is still alive. On Sun, Apr 19, 2009 at 6:23 AM, Sal Bass salbass...@hotmail.com wrote: What are the most significant changes between the 1.6.2 build and the 3 build? Can you briefly summarize for me? Thanks! From: vap...@hotmail.com To: user-cs@ibatis.apache.org Subject: Re: 1.6.2 / V3 ??? Date: Sat, 18 Apr 2009 15:02:34 -0400 If it matters to anyone: I have been using the v3 build for months in a high traffic production environment with no problems. - Original Message - From: Sal Bass To: user-cs@ibatis.apache.org Sent: Saturday, April 18, 2009 11:22 AM Subject: RE: 1.6.2 / V3 ??? Should we take the silence as people have been too busy to work on the .Net project, or the .Net project is not moving forward anytime soon? Either way, Ibatis has been the absolute ideal solution for my team. Nhibernate was not an option, and the flexiblity of Ibatis + code gen'ing mapping files has worked brilliantly for us. Date: Thu, 16 Apr 2009 22:11:09 -0600 Subject: Re: 1.6.2 / V3 ??? From: clinton.be...@gmail.com To: user-cs@ibatis.apache.org Hey all, Gilles was making good progress on V3, and I think there are a few people already using the source build. I'm not sure why everything went quiet all of a sudden... Gilles? Ron? Clinton On Thu, Apr 16, 2009 at 9:30 PM, Yaojian sky...@gmail.com wrote: I asked the same question serveral months ago ... still waiting for an answer. On Fri, Apr 17, 2009 at 2:14 AM, Sal Bass salbass...@hotmail.com wrote: Hello, It seems there is a great deal of development in the java version, but not the .NET version. The last thing released was the 1.6.2 beta and a full release was supposed to follow soon after. Is the .NET version still in active development? Windows LiveT: Life without walls. Check it out. Rediscover HotmailR: Get e-mail storage that grows with you. Check it out. Windows LiveT: Keep your life in sync. Check it out. _ Insert movie times and more without leaving HotmailR. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutori al_QuickAdd1_052009 -- Sent from my mobile device
RE: Ibatis.Net - A Call to Arms
I've always been pretty shy about piping up in the group but I'd be willing to help as well. Ibatis is a great tool. From: Nick Zdunic [mailto:n_zdu...@yahoo.com.au] Sent: Monday, May 25, 2009 8:36 PM To: user-cs@ibatis.apache.org Subject: RE: Ibatis.Net - A Call to Arms Not sure myself. MS are putting a lot of effort into Entity Framework and the version coming out in .NET 4.0 looks good so far. I like that it supports POCO's better as well as other more intrusive mechanisms. iBatis is simple which has its merits, but with Linq in EF I think iBatis is falling behind somewhat. It may be yesterday's technology. _ From: Juan Pablo Araya [mailto:juanpablo.ar...@gmail.com] Sent: Tuesday, 26 May 2009 11:30 AM To: user-cs@ibatis.apache.org Subject: Re: Ibatis.Net - A Call to Arms Sal you can count on my support. Don't know if I can make a very good job on coding but it's a matter of time and effort. I you want, you can list me in the development team. Greetings and sorry for my poor english! On Mon, May 25, 2009 at 5:07 PM, Sal Bass salbass...@hotmail.com wrote: Per Clinton's suggestion, I am making this post to find out if we can keep Ibatis.Net going. As we all know, Ibatis fills an important niche and is still very relevant. We need people to take charge and to commit time for development. So, who's in? If we don't do this there is nothing to keep it going. _ HotmailR has a new way to see what's up with your friends. Check it out. http://windowslive.com/Tutorial/Hotmail/WhatsNew?ocid=TXT_TAGLM_WL_HM_Tutor ial_WhatsNew1_052009
Medium Trust Environments
Hi Everyone, I know I've brought this up before but I don't think there was ever an answer.I got around it at the time by switching from a GoDaddy account to a HostMySite account that was running in a higher-trust environment. Now my host has sent out an email saying that they're switching to medium trust in a week. I decided to test this out by setting the trust level to medium in my application, and sure enough, my ibatis calls no longer work. I've tried marking the EntrepreneurialTechnologies.DatabaseHelper class (which calls Ibatis) with the AllowPartiallyTrustedCallers attribute and signing it, but to no avail. I still get the security exception. What I'd like to know is if this is something that just cannot be done, if Ibatis is fundamentally incompatible with medium-trust environments, or if there is a way to configure things so that it will run in medium trust. Does anyone have this working currently? If this is something obvious that I am not getting about how medium trust works, please forgive me. I've never had to deal with this much before. Any and all guidance is appreciated. Here is the stack trace: [SecurityException: That assembly does not allow partially trusted callers.] EntrepreneurialTechnologies.DatabaseHelper.SelectMapperClient.selectList(Str ing selectName, Object params) +0 ET.IowaChiropracticSociety.HomePageBannerService.getActive() +82 _DefaultPage.Page_Load(Object sender, EventArgs e) +308 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e) +15 System.Web.UI.Control.LoadRecursive() +8683053 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.default_aspx.ProcessRequest(HttpContext context) +37 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionSte p.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean completedSynchronously) +75 Thanks! Erin Rollenhagen Entrepreneurial Technologies 12257 University Avenue, Suite 200 Clive, Iowa 50325 515.440.1242 e...@entretechno.com http://www.entretechno.com http://www.entretechno.com/
RE: Medium Trust Environments
Ok, I very preliminarily have some signs of hope that this might be possible. However, I had to make several changes to the Ibatis source code so now I have this mutant project that will not match what everyone else has and will be a problem when I want to upgrade to a new version. Here are the steps that I've completed so far: 1. Recompiled Ibatis dlls with a strong name key and with AllowPartiallyTrustedCallers attribute set in assemlyinfo.cs 2. Updated the references to Castle.Dynamic proxy to a newer version that allows partially trusted callers 3. Added a custom trust.config file in the root of my website to allow Reflection within my medium trust environment and configured it in the web.config file. This of course removed the reflection error (am I missing something, or is this a fundamental issue with medium trust and Ibatis? I couldn't see any way around needing Reflection permissions - I'll just have to hope I can talk the hosting company into it) This brought me to a securitypermissions error that I posted in a previous message. 4. The last step: When digging into exactly where the error was occurring, I noticed that it was in the CallContextSessionStore class which has a note at the top NOT to use it in web scenarios. I am of course using a web scenario. So I started looking around for a different method to call on the mapper that would not call into that class. Here is the line of code that seems to be causing the issue: ISqlMapSession session = _sessionStore.LocalSession; However, a few lines below this, the code is setting the session variable to a local session if one was not set from the call to _sessionStore.LocalSession. I decided to try removing the call to _sessionStore.LocalSession and see if that would solve my issue. A quick recompile and voila! The site seems to be up and running again. Does anyone have any thoughts/suggestions/improvements on what I cobbled together to make this work? I don't want to be doing something stupid that will end up biting me a few months down the road and I don't feel like I'm comfortable enough with Ibatis to be sure that I'm not messing something up. Thanks! --Erin From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 8:02 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments I'm not around a compiler at the moment; but I do recall reading someplace that the Castle.DynamicProxy (old version) as is doesn't allow partially trusted calls. You'd either have to link it to a version that does or ILMerge it into the iBatis DLL. It's a pain. On Tue, Jul 28, 2009 at 5:39 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: An update: I've now recompiled the Ibatis.Net dlls using AllowPartiallyTrustedCallers and have come up with a new exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, 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() +58 System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark stackMark, Boolean skipVisibility) +191 System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49 IBatisNet.Common.Utilities.Objects.Members.DelegatePropertySetAccessor..ctor (Type targetObjectType, String propName) +700 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateDynamicP ropertySetAccessor(Type targetType, String propertyName) +235 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateSetAcces sor(Type targetType, String name) +453 IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.Initialize(C onfigurationScope configScope, Type resultClass) +336 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.GetChildNode(Conf igurationScope configScope) +1570 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Config urationScope configScope) +194 I've Googled around a bit and it seems the solution to this is making any members that need to be reflected public. This doesn't really seem realistic - does anyone have any ideas? From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 7:29 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments What type of ado.net driver are you using? On Tue, Jul 28, 2009 at 4:08 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: Hi Everyone, I know I've brought this up before but I don't think there was ever an answer.I got around it at the time by switching from a GoDaddy account to a HostMySite account that was running in a higher-trust environment. Now my host
RE: Medium Trust Environments
I actually didn't send the security exception in a previous email. Here it is: [SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] IBatisNet.DataMapper.SessionStore.CallContextSessionStore.get_LocalSession() +0 IBatisNet.DataMapper.SqlMapper.QueryForList(String statementName, Object parameterObject) +107 EntrepreneurialTechnologies.DatabaseHelper.SelectMapperClient.selectList(Str ing selectName, Object params) +143 ET.IowaChiropracticSociety.HomePageBannerService.getActive() +81 _DefaultPage.Page_Load(Object sender, EventArgs e) +309 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e) +15 System.Web.UI.Control.LoadRecursive() +8683053 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context) +49 ASP.default_aspx.ProcessRequest(HttpContext context) +37 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionSte p.Execute() +181 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean completedSynchronously) +75 From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 8:02 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments I'm not around a compiler at the moment; but I do recall reading someplace that the Castle.DynamicProxy (old version) as is doesn't allow partially trusted calls. You'd either have to link it to a version that does or ILMerge it into the iBatis DLL. It's a pain. On Tue, Jul 28, 2009 at 5:39 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: An update: I've now recompiled the Ibatis.Net dlls using AllowPartiallyTrustedCallers and have come up with a new exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, 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() +58 System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark stackMark, Boolean skipVisibility) +191 System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49 IBatisNet.Common.Utilities.Objects.Members.DelegatePropertySetAccessor..ctor (Type targetObjectType, String propName) +700 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateDynamicP ropertySetAccessor(Type targetType, String propertyName) +235 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateSetAcces sor(Type targetType, String name) +453 IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.Initialize(C onfigurationScope configScope, Type resultClass) +336 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.GetChildNode(Conf igurationScope configScope) +1570 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Config urationScope configScope) +194 I've Googled around a bit and it seems the solution to this is making any members that need to be reflected public. This doesn't really seem realistic - does anyone have any ideas? From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 7:29 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments What type of ado.net driver are you using? On Tue, Jul 28, 2009 at 4:08 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: Hi Everyone, I know I've brought this up before but I don't think there was ever an answer.I got around it at the time by switching from a GoDaddy account to a HostMySite account that was running in a higher-trust environment. Now my host has sent out an email saying that they're switching to medium trust in a week. I decided to test this out by setting the trust level to medium in my application, and sure enough, my ibatis calls no longer work. I've tried marking the EntrepreneurialTechnologies.DatabaseHelper class (which calls Ibatis) with the AllowPartiallyTrustedCallers attribute and signing it, but to no avail. I still get the security exception. What I'd like to know is if this is something that just cannot be done, if Ibatis is fundamentally incompatible with medium-trust environments, or if there is a way to configure things so that it will run in medium trust. Does anyone have
RE: Medium Trust Environments
Bingo!!! That solved the reflection error. Thank you! From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Wednesday, July 29, 2009 10:35 PM To: user-cs@ibatis.apache.org; mich...@mccurrey.com Subject: Re: Medium Trust Environments I think there is a setting / to turn off the IL optimizations which means you can't use any of the lazy loading. _ From: Michael McCurrey mmccur...@gmail.com To: user-cs@ibatis.apache.org Sent: Tuesday, July 28, 2009 9:02:13 PM Subject: Re: Medium Trust Environments I'm not around a compiler at the moment; but I do recall reading someplace that the Castle.DynamicProxy (old version) as is doesn't allow partially trusted calls. You'd either have to link it to a version that does or ILMerge it into the iBatis DLL. It's a pain. On Tue, Jul 28, 2009 at 5:39 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: An update: I’ve now recompiled the Ibatis.Net dlls using AllowPartiallyTrustedCallers and have come up with a new exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, 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() +58 System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark stackMark, Boolean skipVisibility) +191 System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49 IBatisNet.Common.Utilities.Objects.Members.DelegatePropertySetAccessor..ctor(Type targetObjectType, String propName) +700 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateDynamicPropertySetAccessor(Type targetType, String propertyName) +235 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateSetAccessor(Type targetType, String name) +453 IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.Initialize(ConfigurationScope configScope, Type resultClass) +336 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.GetChildNode(ConfigurationScope configScope) +1570 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(ConfigurationScope configScope) +194 I’ve Googled around a bit and it seems the solution to this is making any members that need to be reflected public. This doesn’t really seem realistic – does anyone have any ideas? From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 7:29 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments What type of ado.net driver are you using? On Tue, Jul 28, 2009 at 4:08 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: Hi Everyone, I know I’ve brought this up before but I don’t think there was ever an answer…I got around it at the time by switching from a GoDaddy account to a HostMySite account that was running in a higher-trust environment. Now my host has sent out an email saying that they’re switching to medium trust in a week. I decided to test this out by setting the trust level to medium in my application, and sure enough, my ibatis calls no longer work. I’ve tried marking the EntrepreneurialTechnologies.DatabaseHelper class (which calls Ibatis) with the AllowPartiallyTrustedCallers attribute and signing it, but to no avail. I still get the security exception. What I’d like to know is if this is something that just cannot be done, if Ibatis is fundamentally incompatible with medium-trust environments, or if there is a way to configure things so that it will run in medium trust. Does anyone have this working currently? If this is something obvious that I am not getting about how medium trust works, please forgive me. I’ve never had to deal with this much before. Any and all guidance is appreciated. Here is the stack trace: [SecurityException: That assembly does not allow partially trusted callers.] EntrepreneurialTechnologies.DatabaseHelper.SelectMapperClient.selectList(String selectName, Object params) +0 ET.IowaChiropracticSociety.HomePageBannerService.getActive() +82 _DefaultPage.Page_Load(Object sender, EventArgs e) +308 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e) +15 System.Web.UI.Control.LoadRecursive() +8683053 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 System.Web.UI.Page.ProcessRequest() +80 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 System.Web.UI.Page.ProcessRequest(HttpContext context
RE: Medium Trust Environments
It's version 1.1.5.433 I just downloaded it from the site a couple of days ago. From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Thursday, July 30, 2009 9:57 AM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments Which version number of DynamicProxy did you switch to? On Thu, Jul 30, 2009 at 7:43 AM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: Bingo!!! That solved the reflection error. Thank you! From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Wednesday, July 29, 2009 10:35 PM To: user-cs@ibatis.apache.org; mich...@mccurrey.com Subject: Re: Medium Trust Environments I think there is a setting / to turn off the IL optimizations which means you can't use any of the lazy loading. _ From: Michael McCurrey mmccur...@gmail.com To: user-cs@ibatis.apache.org Sent: Tuesday, July 28, 2009 9:02:13 PM Subject: Re: Medium Trust Environments I'm not around a compiler at the moment; but I do recall reading someplace that the Castle.DynamicProxy (old version) as is doesn't allow partially trusted calls. You'd either have to link it to a version that does or ILMerge it into the iBatis DLL. It's a pain. On Tue, Jul 28, 2009 at 5:39 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: An update: I've now recompiled the Ibatis.Net dlls using AllowPartiallyTrustedCallers and have come up with a new exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, 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() +58 System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark stackMark, Boolean skipVisibility) +191 System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49 IBatisNet.Common.Utilities.Objects.Members.DelegatePropertySetAccessor..ctor (Type targetObjectType, String propName) +700 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateDynamicP ropertySetAccessor(Type targetType, String propertyName) +235 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateSetAcces sor(Type targetType, String name) +453 IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.Initialize(C onfigurationScope configScope, Type resultClass) +336 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.GetChildNode(Conf igurationScope configScope) +1570 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Config urationScope configScope) +194 I've Googled around a bit and it seems the solution to this is making any members that need to be reflected public. This doesn't really seem realistic - does anyone have any ideas? From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Tuesday, July 28, 2009 7:29 PM To: user-cs@ibatis.apache.org Subject: Re: Medium Trust Environments What type of ado.net driver are you using? On Tue, Jul 28, 2009 at 4:08 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: Hi Everyone, I know I've brought this up before but I don't think there was ever an answer.I got around it at the time by switching from a GoDaddy account to a HostMySite account that was running in a higher-trust environment. Now my host has sent out an email saying that they're switching to medium trust in a week. I decided to test this out by setting the trust level to medium in my application, and sure enough, my ibatis calls no longer work. I've tried marking the EntrepreneurialTechnologies.DatabaseHelper class (which calls Ibatis) with the AllowPartiallyTrustedCallers attribute and signing it, but to no avail. I still get the security exception. What I'd like to know is if this is something that just cannot be done, if Ibatis is fundamentally incompatible with medium-trust environments, or if there is a way to configure things so that it will run in medium trust. Does anyone have this working currently? If this is something obvious that I am not getting about how medium trust works, please forgive me. I've never had to deal with this much before. Any and all guidance is appreciated. Here is the stack trace: [SecurityException: That assembly does not allow partially trusted callers.] EntrepreneurialTechnologies.DatabaseHelper.SelectMapperClient.selectList(Str ing selectName, Object params) +0 ET.IowaChiropracticSociety.HomePageBannerService.getActive() +82 _DefaultPage.Page_Load(Object sender, EventArgs e) +308 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Adapters.ControlAdapter.OnLoad(EventArgs e) +15 System.Web.UI.Control.LoadRecursive() +8683053 System.Web.UI.Page.ProcessRequestMain(Boolean
RE: Medium Trust Environments
I use very simple objects (it's just a CMS) so the lazy loading is probably ok to lose. Since we use shared hosting, I don't have any control over what the host decides to allow or not allow so I have to make accommodations in my program. Thank you for pointing out the potential downfalls though. -Ms. Erin Rollenhagen From: Carlos Peix [mailto:peix-lis...@praxia.com.ar] Sent: Thursday, July 30, 2009 12:48 PM To: user-cs@ibatis.apache.org Subject: RE: Medium Trust Environments Oh, sorry for the analogy. I understood that Erin was happy to solve the problem deactivating lazy loading. I tried to call his attention on the fact that lazy loading is a very powerful tool and would be bad to loose it. He should investigate further to try to make it work in his environment. Sadly I can't help him. Regards Carlos Peix _ De: Dustin Aleksiuk [mailto:dustin.aleks...@huskyenergy.com] Enviado el: Jueves, 30 de Julio de 2009 01:35 p.m. Para: user-cs@ibatis.apache.org Asunto: RE: Medium Trust Environments Hi Carlos, I know what lazy loading is, I didn't understand what you meant by resigning it and I'm not familiar enough with chess to understand your analogy. Dustin From: Carlos Peix [mailto:peix-lis...@praxia.com.ar] Sent: Thursday, July 30, 2009 9:51 AM To: user-cs@ibatis.apache.org Subject: RE: Medium Trust Environments Hi Dustin, Lazy loading is a very powerful optimization technique that allows you not to load full object graphs when you need just one. There are a lot of articles on the web about this topic, check [1] for basic information or [2] for details on IBatis [1] http://www.google.com/search?q=lazy+loading [2] http://www.google.com/search?q=ibatis+lazy+loading Regards Carlos Peix _ De: Dustin Aleksiuk [mailto:dustin.aleks...@huskyenergy.com] Enviado el: Jueves, 30 de Julio de 2009 12:00 p.m. Para: user-cs@ibatis.apache.org Asunto: RE: Medium Trust Environments What do you mean by this? Thanks, Dustin From: Carlos Peix [mailto:peix-lis...@praxia.com.ar] Sent: Thursday, July 30, 2009 8:54 AM To: user-cs@ibatis.apache.org; mich...@mccurrey.com Subject: RE: Medium Trust Environments Erin, Be careful, resigning lazy loading nowadays is equivalent to resign the Queen and two Bishops in chess. Just as a warning. Regards. Carlos Peix _ De: Erin Rollenhagen [mailto:e...@entrepreneurialtechnologies.com] Enviado el: Jueves, 30 de Julio de 2009 11:43 a.m. Para: user-cs@ibatis.apache.org; mich...@mccurrey.com Asunto: RE: Medium Trust Environments Bingo!!! That solved the reflection error. Thank you! From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Wednesday, July 29, 2009 10:35 PM To: user-cs@ibatis.apache.org; mich...@mccurrey.com Subject: Re: Medium Trust Environments I think there is a setting / to turn off the IL optimizations which means you can't use any of the lazy loading. _ From: Michael McCurrey mmccur...@gmail.com To: user-cs@ibatis.apache.org Sent: Tuesday, July 28, 2009 9:02:13 PM Subject: Re: Medium Trust Environments I'm not around a compiler at the moment; but I do recall reading someplace that the Castle.DynamicProxy (old version) as is doesn't allow partially trusted calls. You'd either have to link it to a version that does or ILMerge it into the iBatis DLL. It's a pain. On Tue, Jul 28, 2009 at 5:39 PM, Erin Rollenhagen e...@entrepreneurialtechnologies.com wrote: An update: I've now recompiled the Ibatis.Net dlls using AllowPartiallyTrustedCallers and have come up with a new exception: [SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, 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() +58 System.Reflection.Emit.DynamicMethod.PerformSecurityCheck(Module m, StackCrawlMark stackMark, Boolean skipVisibility) +191 System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) +49 IBatisNet.Common.Utilities.Objects.Members.DelegatePropertySetAccessor..ctor (Type targetObjectType, String propName) +700 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateDynamicP ropertySetAccessor(Type targetType, String propertyName) +235 IBatisNet.Common.Utilities.Objects.Members.SetAccessorFactory.CreateSetAcces sor(Type targetType, String name) +453 IBatisNet.DataMapper.Configuration.ResultMapping.ResultProperty.Initialize(C onfigurationScope configScope, Type resultClass) +336 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.GetChildNode(Conf igurationScope configScope) +1570 IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.Initialize(Config
RE: SPAM-HIGH: [vote] Promote DataMapper 1.6 to General Availability
+1 Erin Rollenhagen -Original Message- From: Michael McCurrey [mailto:mmccur...@gmail.com] Sent: Monday, August 03, 2009 8:41 AM To: user-cs@ibatis.apache.org Subject: SPAM-HIGH: [vote] Promote DataMapper 1.6 to General Availability Sorry for the delay in calling the vote - lot of stuff going on. Since there have been no major issues reported, I would like to call for a vote to promote ibatis.net datamapper 1.62 beta to release status. I'd like to close voting on 1/8/09 I'll cast mine now,+1 -- Michael J. McCurrey - To unsubscribe, e-mail: user-cs-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-cs-h...@ibatis.apache.org - To unsubscribe, e-mail: user-cs-unsubscr...@ibatis.apache.org For additional commands, e-mail: user-cs-h...@ibatis.apache.org