CSLA .NET Contrib News Feed 
Tuesday, April 22, 2014  |  From CSLA .NET Contrib

Good day.


i would like to get some help on the following. i am working in a WinForms environment application, i have a "Save" button but i would like to enable/disable the button is my object has been changed. i would think that i would need to check the 'IsDirty' flag of my object, is this correct?


if so, how would i get a raised event when my 'IsDirty' property gets changed so that i can enable/disable my save button accordingly?


any help with on this would be much appreciated.

Monday, April 21, 2014  |  From CSLA .NET Contrib

How to prevent user to edit child object?


I have class with f.ex "orders" property. This is "BusinessBindingListBase" which contains "Order" objects.


I thought I can add "authorization rule" (AuthorizationActions.EditObject) that implements some logic. But it never executes. I can edit this child object and even save it. It looks wierd. How to prevent child object editing?

Saturday, April 19, 2014  |  From CSLA .NET Contrib

Hello


We have a class that contains property X with some expensive rules associated to it. We want all rules to fire if the value of property X gets changed, but we would like to suppress some of its rule if the rules are being fired due to an explicit call to ‘CheckRules(X)’ or due to property X having dependencies with other properties.



In other words, we need context to know why are the businesses rules being fired so we can determine whether to run them or not.



I took a quick look at the business rule runtime information and couldn’t find anything that could give me that context. Am I missing something or is it not possible to do what we want to do.



By the way, we already have a work around that solves our issue but I was wondering if I am missing something and there is a formal way of doing what we are doing the proper way.



We are currently using CSLA 4.2.2.0



Thanks.

Monday, April 14, 2014  |  From CSLA .NET Contrib

Hello everyone,


I am giving serious thought to replacing this current forum with a new and more modern set of software.


This forum runs on something called Community Server, and has gotten quite "long in the tooth". You might notice that it looks somewhat old, doesn't work well on phones, and spam is an increasing problem. What you _can't_ see is that behind the scenes fewer and fewer features are actually working at an admin level.


In other words, the current software is approaching any reasonable end of its life.


I don't yet know what I'll use to replace it, and if you have any suggestions of great/inexpensive forum hosting please let me know.


I _am_ considering using something called Discourse, which is a new open source forum project on GitHub. It looks like I can host it in Azure for a relatively small cost - hopefully low enough that the ads on the site will pay for the hosting.


I'm open to comments/thoughts/suggestions - this is your community as much as mine, and I value your input.

Wednesday, April 09, 2014  |  From CSLA .NET Contrib

When my private backing field SetProperty is called...even though it is ByRef, the value in mDTO.EvidNum does not change until AFTER the PropertyHasChanged runs.


This means that a simple rule like StringRequired runs and sees an empty string and the rule stays broken.  But the next step after rules running is that the mDTO.EvidNum property setter is called.  So you look at the business object and the rule is broken but there is a value there.


Any ideas?  I assume the CSLA code assumes a private backing field is just a string not a Class.StringProperty.


 


I have the following code:


    Private Shared EvidNumPropertyInfo As PropertyInfo(Of String) = RegisterProperty(Of String)(Function(c) c.EvidNum, RelationshipTypes.PrivateField)


    Public Property EvidNum() As String


        Get


            Return GetProperty(EvidNumPropertyInfo, mDTO.EvidNum)


        End
Get


        Set(ByVal value As String)


            SetProperty(EvidNumPropertyInfo,
mDTO.EvidNum, value)


        End
Set













Normal
0




false
false
false

EN-US
JA
X-NONE






















































































































































































    End
Property


 

Monday, April 07, 2014  |  From CSLA .NET Contrib

I am not sure if I posted this question before or somebody posted it, but somehow I cannot find the discussion.


We had lots of in-house applications that uses CSLA 3.0.6, .NET Framework 3.5/4, VS2010.  Would it possible to upgrade all of those to the latest CSLA version (4.5.501), .NET Framework 4.5 and VS 2012?


One our concern are there lots of validation and business rules in any of the project.


Thanks.

Monday, April 07, 2014  |  From CSLA .NET Contrib

So CSLA with iOS is in "beta" or in the initial stages of becoming possible - I do believe by looking at a pamphlet from Xamarin that they also drive Mac OS native applications.  I have a question out to someone at Xamarin as to whether these would be two different projects and native app buildouts in the solution (I'm guessing they would be).


In thinking about advocating for the Xamarin approach here, I wanted to see what the envisioned CSLA support for Mac OS would be.  Is that basically done when iOS became potentially supported or is this another ball of wax?

Thursday, April 03, 2014  |  From CSLA .NET Contrib

Hello everyone,


I have developed wcf .net 4 REST service that uses the wcf dataportal. Both services
are hosted in IIS 7 in same web app.  Parts of the web.config are enclosed at the end of this message.  


My wcf service runs successfully on ASP.NET developer server, but not in the IIS web server.  When accessing an API from web browser on port 80, I keep receiving this exception message:


Exception has been thrown by the target of an invocation


Would you have any ideas why could this be happening?  


 


The web,config:


<?xml version="1.0"?>


<configuration>


  <appSettings>


    <add key="MyDbName" value="MY_DB" />


    <add key="CslaAuthentication" value="Csla"/>


  </appSettings>


  <connectionStrings/>


  <system.serviceModel>


    <protocolMapping>


      <add scheme="http" binding="webHttpBinding" />


    </protocolMapping>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WebServiceBehavior">


          <serviceMetadata httpGetEnabled="true"/>


          <serviceDebug includeExceptionDetailInFaults="true"/>


        </behavior>


        <behavior name="returnFaults">


          <serviceDebug includeExceptionDetailInFaults="true" />


        </behavior>


      </serviceBehaviors>


      <endpointBehaviors>


        <behavior name="RESTEndpointBehavior">


          <webHttp />


        </behavior>


      </endpointBehaviors>


    </behaviors>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />


    <services>


      <service behaviorConfiguration="WebServiceBehavior" name="Something">


        <endpoint address="" binding="webHttpBinding" contract="ISomethingContract" behaviorConfiguration="RESTEndpointBehavior" />


        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>


        <host>


          <baseAddresses>


            <add baseAddress="http://localhost:8000" />


          </baseAddresses>


        </host>


      </service>


      <service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">


        <endpoint binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="WSHttpBinding_IWebService"/>


      </service>


    </services>


    <bindings>


      <wsHttpBinding>


        <binding name="WSHttpBinding_IWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">


          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>


          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>


          <security mode="None">


            <transport clientCredentialType="None"/>


          </security>


        </binding>


      </wsHttpBinding>


    </bindings>    


  </system.serviceModel>


  <system.web>


    <sessionState mode="InProc" cookieless="true" regenerateExpiredSessionId="false" timeout="20"/>


    <compilation debug="true" targetFramework="4.0">


    </compilation>


    <authentication mode="Windows"/>


       <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>


  </system.web> 



</configuration>



 


Thank you in advance,
Tanja


PS. The web site is setup in the ASP.NET v4.0 Application pool  (Integrated managed pipeline mode and ApplicationPoolIdentity for indenty) and the WcfPortal.svc is located in the same location where my svc file is.

Friday, March 28, 2014  |  From CSLA .NET Contrib

Hi,


 


I am new to CSLA. And got stuck up.


 


i am getting the following error when using the Entity frameework.


 


Error 1 The type 'ShasPatho.DalEf.ShasPathoEntities' cannot be used as type parameter 'C' in the generic type or method 'Csla.Data.ObjectContextManager<C>'. There is no implicit reference conversion from 'ShasPatho.DalEf.ShasPathoEntities' to 'System.Data.Objects.ObjectContext'.


 


any help would be great.


 


regards


 


ashish


Wednesday, March 26, 2014  |  From CSLA .NET Contrib

Microsoft is interested in buying Xamarian.  More MVVM frameworks are now working better with PCL and multi platform solutions such as MVVMCROSS.  With these changes in the multi platform arena, has there been any readdressing of the issue of building a CSLA Core module compatible with Portable Class Libraries?  I am now having to face the decision of leaving behind my beloved CSLA.

Tuesday, March 25, 2014  |  From CSLA .NET Contrib

I have a created a Read Only Lists that inherits from CSLA ReadOnlyListBase. I am calling a BeginGet method passing in a criteria class (both classes have been marked as serializable).


This fetch does work on the first call, however any subsequent calls of the same method are causing the error below:


ERROR MESSAGE:


{: at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) : Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplayClassa.b_9(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass4.b_0(Object sendState) }


My breakpoint on the DataPortal_Fetch method is not being hit (after the first fetch) on the server side, as the error indicates. 


Any advice to help me solve this would be appreciated.

Friday, March 21, 2014  |  From CSLA .NET Contrib

Hi guys,


I think I have an interesting one.  I have been reading many, many discussions on this topic and altering my code and have found an interesting quirk.  Below are the most useful discussions I've read and taken ideas from.


http://forums.lhotka.net/forums/p/12036/56156.aspx


http://forums.lhotka.net/forums/p/8931/42494.aspx


I have a .NET 4.5, CSLA 4.5.40, Silverlight 5, IIS 7.5 application that has been working terrifically locally but I've been trying to deploy to a webserver.  My AppPool settings have gone through every possible permutation but I have settled with Integrated and Identity: LocalSystem.  If I change the identity it gives similar results as mentioned below but with a different system account.  IIS site authentication only has ASP .NET Impersonation and Windows Authentication Enabled.


Here is the web.config with all the tags that have been identified as required:


<?xml version="1.0" encoding="utf-8"?>


<configuration>


  <appSettings>


    <add key="EventLogName" value="GreyDev" />


    <add key="CslaAuthentication" value="Windows"/>


    <add key="CslaWriter" value="Csla.Serialization.Mobile.CslaBinaryWriter, Csla" />


    <add key="CslaReader" value="Csla.Serialization.Mobile.CslaBinaryReader, Csla" />


  </appSettings>


  <connectionStrings>


PRIVATE :)


  </connectionStrings>


  <system.web>


    <compilation debug="true" targetFramework="4.5" />


    <authentication mode="Windows" />


    <identity impersonate="true" />


    <pages controlRenderingCompatibilityVersion="4.0"/>


  </system.web>


  <system.webServer>


    <validation validateIntegratedModeConfiguration="false" />


  </system.webServer>


  <system.serviceModel>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />


    <services>


      <service behaviorConfiguration="WcfPortalBehavior" name="Business.Compression.CompressedHost">


        <endpoint binding="basicHttpBinding" contract="Csla.Server.Hosts.Mobile.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal" />


      </service>


    </services>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WcfPortalBehavior">


          <serviceDebug includeExceptionDetailInFaults="true" />


 <serviceAuthorization impersonateCallerForAllOperations="true" />


        </behavior>


      </serviceBehaviors>


    </behaviors>


    <bindings>


      <basicHttpBinding>


        <binding name="BasicHttpBinding_IWcfPortal" 


maxReceivedMessageSize="2147483647"


                   maxBufferPoolSize="2147483647"


                   maxBufferSize="2147483647" >


          <readerQuotas maxBytesPerRead="2147483647"


                          maxArrayLength="2147483647"


                          maxStringContentLength="2147483647"


                          maxNameTableCharCount="2147483647"


                          maxDepth="2147483647" />


          <security mode="TransportCredentialOnly">


            <transport clientCredentialType="Windows" />


          </security>


        </binding>


      </basicHttpBinding>


    </bindings>


  </system.serviceModel>


</configuration>




On to my results.  In my AppIdentity class I call the CSLA method PopulateWindowsIdentity().  Digging into this method I found that the main call to retrieve the impersonated windows user is:  var currentUser = System.Security.Principal.WindowsIdentity.GetCurrent();

No matter what config, IIS or AppPool settings I have changed, the returned WindowsIdentity.Name is always "NT AUTHORITY\SYSTEM" (this varies when changing the AppPool Identity as mentioned before).  It never impersonated the user, in my case 'speters' (my AD name).  I have made a small ASP web app with the same config and IIS settings and in that app, Impersonation works!  In that application, I have found that the web.config setting <identity impersonate="true" /> directly turns off or on the Impersonation with the true/false setting.


After 3 days of trying every setting I could find, reading every article I could find, I decided to call another method in my AppIdentity class, var cslaname = Csla.ApplicationContext.User.Identity.Name.

This Csla.ApplicationContext call successfully retreives my Impersonated AD credentials.  With this information I have managed to check the result of both Identity calls and choose the one that is needed, so technically my applicaton is working.  However, I still would love to know what it takes to get the WindowsIdentity to properly Impersonate.


In Summary, with all the above settings:

System.Security.Principal.WindowsIdentity.GetCurrent().Name; Does NOT Impersonate Client User AD

Csla.ApplicationContext.User.Identity.Name;  Does Impersonate/Fetch Client User AD


Any thoughts on whats happening here?

 

Friday, March 21, 2014  |  From CSLA .NET Contrib

I've noticed that
short-circuiting rules in CSLA 4.5.501.0 is not working. That is when I
set prioritization to my business rules then set the
ProcessThroughPriority. When I query the Broken Rules I get all invalid
rules even those that has higher priority than ProcessThroughPriority
value. Is there a newer way of doing it?

Thursday, March 20, 2014  |  From CSLA .NET Contrib

Hi,


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred.  There is no detail as to the problem.  What is the method that people are using to return the original message such as a table update failed back to the client?


Todd Haehn

Wednesday, March 19, 2014  |  From CSLA .NET Contrib

I had assumed that SafeDataReader would convert any null strings coming from SQL Server into String.Empty.

But after finding some app exceptions logged, I have confirmed that null values from the database are being set to Nothing (vb.net) in their properties. I don't want to have to deal with null/Nothing in string properties.

Am I doing something wrong?

The code I am using was generated by CodeSmith, using encapsulated implementation. It uses a SafeDataReader, and in this case it passes it to a Map routine.

Something like this:

LoadProperty(_LongDescriptionProperty, reader.Item("LongDescription"))


Will break my app if I try something like:

Foo.LongDescription.Trim, because it will throw an exception.

Am I doing something wrong? I'd hate to have to write a bunch of code to check for null values, and convert them to empty strings.


Thanks.

FWIW, I'm a longtime user of CSLA (since VB6 days). Not on every project, but on quite a few, in different industries. It's a great tool.


 


 

Wednesday, March 19, 2014  |  From CSLA .NET Contrib

Hi there,


Need some clarification on this statement from previous post:


My key issue is that there is a LOT you must make sure to NOT use, such as the standard rules, the CslaContrib rules 
or the CslaGenFork rules.

Refresh of my situation:


  • I am using DTO from my DAL as a private field in BusinessBase object.  The individual PropertyInfo objects are marked with PrivateField and the Getters/Setters use the GetProperty and SetProperty.
  • I cannot bring myself to write a LoadProperty/ReadProperty overload for every property!  It is too unmaintainable unless I only had a couple properties.

Currently I am using the CommonRules and they work great!!  Only the DataAnnotation rules do not work.  I debugged the CommonRule, the execution does a Using ByPassPropertyChecks and then calls my getter on the primary property using the DynamicMethodGetter.


Given the following parameters (question below)


  • I do not use Async rules
  • I do not use the CSLAContrib or CSLAGenFork rules
  • I do not use Input or OutputProperties
  • I do not target async clients (WinRt, WPhone, Silverlight)
  • If I DO ever write an async rule with no Target access OR if I use input/output properties I will do Load/ReadProperty overload for the few relevant properties

Am I missing something?  Thanks for patience as I understand the guts of what is going on. 


This code is screaming fast and I like not having to load my business object properties one by one from the DAL layer at fetch and update!  Yes my DTO is tied into my BusinessLayer, but I am willing to live with that for the benefit.


Extra benefit is I want to spin up a ReadOnly version I can transfer the DTO to a ReadOnly Friend factory method and viola!

Tuesday, March 18, 2014  |  From CSLA .NET Contrib

Hi,


Hopefully this question will have better success than the last....


I have table called GP. 
Two of the fields are called IsCurrentOption and GPPracticeId .


The GPPracticeId is a foreign key to the GPPractice
table.  A GPPractice also has an IsCurrentOption
field.


I have a rule that if the GP record is related to a GPPractice
with the IsCurrentOption  = false then
the GP must have IsCurrentOption = false.


I’ve created a Dynamic Root List based on the GP table.  This has rules in places to deal with the
scenario above and that all works well.


In my list I want to stop the user from being able to edit
the IsCurrentOption field if the associated GPPractice is IsCurrentOption  = false.


I created a custom Authorization rule to deal with that
scenario. 


When the list is loaded the rule is evaluated and the IsCurrentOption
property is readonly where appropriate.


If the GPPractice is changed to a GPPractice that has IsCurrentOption
 = true my Authorization rule is not checked.  Instead the BusinessBase will consult its
cache and get the value from the last time the rule was checked.  It’s not until the BusinessBase is saved (I’m
assuming  putting the BusinessBase  through the data portal loses its cache as the
caches are not serialised), will the rule be checked and return the correct
result.


I couldn’t see any way of forcing my rule to be checked when
the properties are changed.


 


Any idea’s how I can resolve this issue? 


Many thanks,


Nathan

Tuesday, March 18, 2014  |  From CSLA .NET Contrib

I said sometime this week, and Kevin really worked hard on this, so the 4.5.580 pre-release with iOS support (via Xamarin tools) is now on nuget and GitHub:


http://www.lhotka.net/weblog/CSLANETBetaReleaseSupportingIOS.aspx


 

Monday, March 17, 2014  |  From CSLA .NET Contrib

We're closing in on a version of CSLA .NET that works on iOS using the Xamarin tools.


This is the result of a lot of work by Stuart Bale, Kevin Ford, and myself, and Kevin is getting very close to where we can release a beta version - hopefully yet this week.


If you have Xamarin for iOS I hope you'll help us test this out, but we're very excited!!

Sunday, March 16, 2014  |  From CSLA .NET Contrib

Rockford Lhotka says:


"Collections do not support direct declaration of properties, so you can’t implement properties in this class. If properties are required in addition to the list of child objects, you should create an editable parent object that contains the collection, along with those other properties and their rules."


 


So, I decided to check this out.


I've declared simply property in my inherited BusinessBindingListBase. Somethink like this:


property long DocId { get; set; }


 


I can do "Fetch" and "Update". And it works. My custom property always persist.


But I'm working with 2-tier mode.


 


Maybe it will not work in 3-tier? What reasons could stop me from using custom properties in BusinessBindingListBase?

 CSLA .NET Contrib News Feed 

 Code-gen Templates News Feed 
Tuesday, April 22, 2014  |  From Code-gen Templates

Good day.


i would like to get some help on the following. i am working in a WinForms environment application, i have a "Save" button but i would like to enable/disable the button is my object has been changed. i would think that i would need to check the 'IsDirty' flag of my object, is this correct?


if so, how would i get a raised event when my 'IsDirty' property gets changed so that i can enable/disable my save button accordingly?


any help with on this would be much appreciated.

Monday, April 21, 2014  |  From Code-gen Templates

How to prevent user to edit child object?


I have class with f.ex "orders" property. This is "BusinessBindingListBase" which contains "Order" objects.


I thought I can add "authorization rule" (AuthorizationActions.EditObject) that implements some logic. But it never executes. I can edit this child object and even save it. It looks wierd. How to prevent child object editing?

Saturday, April 19, 2014  |  From Code-gen Templates

Hello


We have a class that contains property X with some expensive rules associated to it. We want all rules to fire if the value of property X gets changed, but we would like to suppress some of its rule if the rules are being fired due to an explicit call to ‘CheckRules(X)’ or due to property X having dependencies with other properties.



In other words, we need context to know why are the businesses rules being fired so we can determine whether to run them or not.



I took a quick look at the business rule runtime information and couldn’t find anything that could give me that context. Am I missing something or is it not possible to do what we want to do.



By the way, we already have a work around that solves our issue but I was wondering if I am missing something and there is a formal way of doing what we are doing the proper way.



We are currently using CSLA 4.2.2.0



Thanks.

Monday, April 14, 2014  |  From Code-gen Templates

Hello everyone,


I am giving serious thought to replacing this current forum with a new and more modern set of software.


This forum runs on something called Community Server, and has gotten quite "long in the tooth". You might notice that it looks somewhat old, doesn't work well on phones, and spam is an increasing problem. What you _can't_ see is that behind the scenes fewer and fewer features are actually working at an admin level.


In other words, the current software is approaching any reasonable end of its life.


I don't yet know what I'll use to replace it, and if you have any suggestions of great/inexpensive forum hosting please let me know.


I _am_ considering using something called Discourse, which is a new open source forum project on GitHub. It looks like I can host it in Azure for a relatively small cost - hopefully low enough that the ads on the site will pay for the hosting.


I'm open to comments/thoughts/suggestions - this is your community as much as mine, and I value your input.

Wednesday, April 09, 2014  |  From Code-gen Templates

When my private backing field SetProperty is called...even though it is ByRef, the value in mDTO.EvidNum does not change until AFTER the PropertyHasChanged runs.


This means that a simple rule like StringRequired runs and sees an empty string and the rule stays broken.  But the next step after rules running is that the mDTO.EvidNum property setter is called.  So you look at the business object and the rule is broken but there is a value there.


Any ideas?  I assume the CSLA code assumes a private backing field is just a string not a Class.StringProperty.


 


I have the following code:


    Private Shared EvidNumPropertyInfo As PropertyInfo(Of String) = RegisterProperty(Of String)(Function(c) c.EvidNum, RelationshipTypes.PrivateField)


    Public Property EvidNum() As String


        Get


            Return GetProperty(EvidNumPropertyInfo, mDTO.EvidNum)


        End
Get


        Set(ByVal value As String)


            SetProperty(EvidNumPropertyInfo,
mDTO.EvidNum, value)


        End
Set













Normal
0




false
false
false

EN-US
JA
X-NONE






















































































































































































    End
Property


 

Monday, April 07, 2014  |  From Code-gen Templates

I am not sure if I posted this question before or somebody posted it, but somehow I cannot find the discussion.


We had lots of in-house applications that uses CSLA 3.0.6, .NET Framework 3.5/4, VS2010.  Would it possible to upgrade all of those to the latest CSLA version (4.5.501), .NET Framework 4.5 and VS 2012?


One our concern are there lots of validation and business rules in any of the project.


Thanks.

Monday, April 07, 2014  |  From Code-gen Templates

So CSLA with iOS is in "beta" or in the initial stages of becoming possible - I do believe by looking at a pamphlet from Xamarin that they also drive Mac OS native applications.  I have a question out to someone at Xamarin as to whether these would be two different projects and native app buildouts in the solution (I'm guessing they would be).


In thinking about advocating for the Xamarin approach here, I wanted to see what the envisioned CSLA support for Mac OS would be.  Is that basically done when iOS became potentially supported or is this another ball of wax?

Thursday, April 03, 2014  |  From Code-gen Templates

Hello everyone,


I have developed wcf .net 4 REST service that uses the wcf dataportal. Both services
are hosted in IIS 7 in same web app.  Parts of the web.config are enclosed at the end of this message.  


My wcf service runs successfully on ASP.NET developer server, but not in the IIS web server.  When accessing an API from web browser on port 80, I keep receiving this exception message:


Exception has been thrown by the target of an invocation


Would you have any ideas why could this be happening?  


 


The web,config:


<?xml version="1.0"?>


<configuration>


  <appSettings>


    <add key="MyDbName" value="MY_DB" />


    <add key="CslaAuthentication" value="Csla"/>


  </appSettings>


  <connectionStrings/>


  <system.serviceModel>


    <protocolMapping>


      <add scheme="http" binding="webHttpBinding" />


    </protocolMapping>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WebServiceBehavior">


          <serviceMetadata httpGetEnabled="true"/>


          <serviceDebug includeExceptionDetailInFaults="true"/>


        </behavior>


        <behavior name="returnFaults">


          <serviceDebug includeExceptionDetailInFaults="true" />


        </behavior>


      </serviceBehaviors>


      <endpointBehaviors>


        <behavior name="RESTEndpointBehavior">


          <webHttp />


        </behavior>


      </endpointBehaviors>


    </behaviors>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />


    <services>


      <service behaviorConfiguration="WebServiceBehavior" name="Something">


        <endpoint address="" binding="webHttpBinding" contract="ISomethingContract" behaviorConfiguration="RESTEndpointBehavior" />


        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>


        <host>


          <baseAddresses>


            <add baseAddress="http://localhost:8000" />


          </baseAddresses>


        </host>


      </service>


      <service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">


        <endpoint binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="WSHttpBinding_IWebService"/>


      </service>


    </services>


    <bindings>


      <wsHttpBinding>


        <binding name="WSHttpBinding_IWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">


          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>


          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>


          <security mode="None">


            <transport clientCredentialType="None"/>


          </security>


        </binding>


      </wsHttpBinding>


    </bindings>    


  </system.serviceModel>


  <system.web>


    <sessionState mode="InProc" cookieless="true" regenerateExpiredSessionId="false" timeout="20"/>


    <compilation debug="true" targetFramework="4.0">


    </compilation>


    <authentication mode="Windows"/>


       <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>


  </system.web> 



</configuration>



 


Thank you in advance,
Tanja


PS. The web site is setup in the ASP.NET v4.0 Application pool  (Integrated managed pipeline mode and ApplicationPoolIdentity for indenty) and the WcfPortal.svc is located in the same location where my svc file is.

Friday, March 28, 2014  |  From Code-gen Templates

Hi,


 


I am new to CSLA. And got stuck up.


 


i am getting the following error when using the Entity frameework.


 


Error 1 The type 'ShasPatho.DalEf.ShasPathoEntities' cannot be used as type parameter 'C' in the generic type or method 'Csla.Data.ObjectContextManager<C>'. There is no implicit reference conversion from 'ShasPatho.DalEf.ShasPathoEntities' to 'System.Data.Objects.ObjectContext'.


 


any help would be great.


 


regards


 


ashish


Wednesday, March 26, 2014  |  From Code-gen Templates

Microsoft is interested in buying Xamarian.  More MVVM frameworks are now working better with PCL and multi platform solutions such as MVVMCROSS.  With these changes in the multi platform arena, has there been any readdressing of the issue of building a CSLA Core module compatible with Portable Class Libraries?  I am now having to face the decision of leaving behind my beloved CSLA.

Tuesday, March 25, 2014  |  From Code-gen Templates

I have a created a Read Only Lists that inherits from CSLA ReadOnlyListBase. I am calling a BeginGet method passing in a criteria class (both classes have been marked as serializable).


This fetch does work on the first call, however any subsequent calls of the same method are causing the error below:


ERROR MESSAGE:


{: at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) : Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplayClassa.b_9(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass4.b_0(Object sendState) }


My breakpoint on the DataPortal_Fetch method is not being hit (after the first fetch) on the server side, as the error indicates. 


Any advice to help me solve this would be appreciated.

Friday, March 21, 2014  |  From Code-gen Templates

Hi guys,


I think I have an interesting one.  I have been reading many, many discussions on this topic and altering my code and have found an interesting quirk.  Below are the most useful discussions I've read and taken ideas from.


http://forums.lhotka.net/forums/p/12036/56156.aspx


http://forums.lhotka.net/forums/p/8931/42494.aspx


I have a .NET 4.5, CSLA 4.5.40, Silverlight 5, IIS 7.5 application that has been working terrifically locally but I've been trying to deploy to a webserver.  My AppPool settings have gone through every possible permutation but I have settled with Integrated and Identity: LocalSystem.  If I change the identity it gives similar results as mentioned below but with a different system account.  IIS site authentication only has ASP .NET Impersonation and Windows Authentication Enabled.


Here is the web.config with all the tags that have been identified as required:


<?xml version="1.0" encoding="utf-8"?>


<configuration>


  <appSettings>


    <add key="EventLogName" value="GreyDev" />


    <add key="CslaAuthentication" value="Windows"/>


    <add key="CslaWriter" value="Csla.Serialization.Mobile.CslaBinaryWriter, Csla" />


    <add key="CslaReader" value="Csla.Serialization.Mobile.CslaBinaryReader, Csla" />


  </appSettings>


  <connectionStrings>


PRIVATE :)


  </connectionStrings>


  <system.web>


    <compilation debug="true" targetFramework="4.5" />


    <authentication mode="Windows" />


    <identity impersonate="true" />


    <pages controlRenderingCompatibilityVersion="4.0"/>


  </system.web>


  <system.webServer>


    <validation validateIntegratedModeConfiguration="false" />


  </system.webServer>


  <system.serviceModel>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />


    <services>


      <service behaviorConfiguration="WcfPortalBehavior" name="Business.Compression.CompressedHost">


        <endpoint binding="basicHttpBinding" contract="Csla.Server.Hosts.Mobile.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal" />


      </service>


    </services>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WcfPortalBehavior">


          <serviceDebug includeExceptionDetailInFaults="true" />


 <serviceAuthorization impersonateCallerForAllOperations="true" />


        </behavior>


      </serviceBehaviors>


    </behaviors>


    <bindings>


      <basicHttpBinding>


        <binding name="BasicHttpBinding_IWcfPortal" 


maxReceivedMessageSize="2147483647"


                   maxBufferPoolSize="2147483647"


                   maxBufferSize="2147483647" >


          <readerQuotas maxBytesPerRead="2147483647"


                          maxArrayLength="2147483647"


                          maxStringContentLength="2147483647"


                          maxNameTableCharCount="2147483647"


                          maxDepth="2147483647" />


          <security mode="TransportCredentialOnly">


            <transport clientCredentialType="Windows" />


          </security>


        </binding>


      </basicHttpBinding>


    </bindings>


  </system.serviceModel>


</configuration>




On to my results.  In my AppIdentity class I call the CSLA method PopulateWindowsIdentity().  Digging into this method I found that the main call to retrieve the impersonated windows user is:  var currentUser = System.Security.Principal.WindowsIdentity.GetCurrent();

No matter what config, IIS or AppPool settings I have changed, the returned WindowsIdentity.Name is always "NT AUTHORITY\SYSTEM" (this varies when changing the AppPool Identity as mentioned before).  It never impersonated the user, in my case 'speters' (my AD name).  I have made a small ASP web app with the same config and IIS settings and in that app, Impersonation works!  In that application, I have found that the web.config setting <identity impersonate="true" /> directly turns off or on the Impersonation with the true/false setting.


After 3 days of trying every setting I could find, reading every article I could find, I decided to call another method in my AppIdentity class, var cslaname = Csla.ApplicationContext.User.Identity.Name.

This Csla.ApplicationContext call successfully retreives my Impersonated AD credentials.  With this information I have managed to check the result of both Identity calls and choose the one that is needed, so technically my applicaton is working.  However, I still would love to know what it takes to get the WindowsIdentity to properly Impersonate.


In Summary, with all the above settings:

System.Security.Principal.WindowsIdentity.GetCurrent().Name; Does NOT Impersonate Client User AD

Csla.ApplicationContext.User.Identity.Name;  Does Impersonate/Fetch Client User AD


Any thoughts on whats happening here?

 

Friday, March 21, 2014  |  From Code-gen Templates

I've noticed that
short-circuiting rules in CSLA 4.5.501.0 is not working. That is when I
set prioritization to my business rules then set the
ProcessThroughPriority. When I query the Broken Rules I get all invalid
rules even those that has higher priority than ProcessThroughPriority
value. Is there a newer way of doing it?

Thursday, March 20, 2014  |  From Code-gen Templates

Hi,


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred.  There is no detail as to the problem.  What is the method that people are using to return the original message such as a table update failed back to the client?


Todd Haehn

Wednesday, March 19, 2014  |  From Code-gen Templates

I had assumed that SafeDataReader would convert any null strings coming from SQL Server into String.Empty.

But after finding some app exceptions logged, I have confirmed that null values from the database are being set to Nothing (vb.net) in their properties. I don't want to have to deal with null/Nothing in string properties.

Am I doing something wrong?

The code I am using was generated by CodeSmith, using encapsulated implementation. It uses a SafeDataReader, and in this case it passes it to a Map routine.

Something like this:

LoadProperty(_LongDescriptionProperty, reader.Item("LongDescription"))


Will break my app if I try something like:

Foo.LongDescription.Trim, because it will throw an exception.

Am I doing something wrong? I'd hate to have to write a bunch of code to check for null values, and convert them to empty strings.


Thanks.

FWIW, I'm a longtime user of CSLA (since VB6 days). Not on every project, but on quite a few, in different industries. It's a great tool.


 


 

Wednesday, March 19, 2014  |  From Code-gen Templates

Hi there,


Need some clarification on this statement from previous post:


My key issue is that there is a LOT you must make sure to NOT use, such as the standard rules, the CslaContrib rules 
or the CslaGenFork rules.

Refresh of my situation:


  • I am using DTO from my DAL as a private field in BusinessBase object.  The individual PropertyInfo objects are marked with PrivateField and the Getters/Setters use the GetProperty and SetProperty.
  • I cannot bring myself to write a LoadProperty/ReadProperty overload for every property!  It is too unmaintainable unless I only had a couple properties.

Currently I am using the CommonRules and they work great!!  Only the DataAnnotation rules do not work.  I debugged the CommonRule, the execution does a Using ByPassPropertyChecks and then calls my getter on the primary property using the DynamicMethodGetter.


Given the following parameters (question below)


  • I do not use Async rules
  • I do not use the CSLAContrib or CSLAGenFork rules
  • I do not use Input or OutputProperties
  • I do not target async clients (WinRt, WPhone, Silverlight)
  • If I DO ever write an async rule with no Target access OR if I use input/output properties I will do Load/ReadProperty overload for the few relevant properties

Am I missing something?  Thanks for patience as I understand the guts of what is going on. 


This code is screaming fast and I like not having to load my business object properties one by one from the DAL layer at fetch and update!  Yes my DTO is tied into my BusinessLayer, but I am willing to live with that for the benefit.


Extra benefit is I want to spin up a ReadOnly version I can transfer the DTO to a ReadOnly Friend factory method and viola!

Tuesday, March 18, 2014  |  From Code-gen Templates

Hi,


Hopefully this question will have better success than the last....


I have table called GP. 
Two of the fields are called IsCurrentOption and GPPracticeId .


The GPPracticeId is a foreign key to the GPPractice
table.  A GPPractice also has an IsCurrentOption
field.


I have a rule that if the GP record is related to a GPPractice
with the IsCurrentOption  = false then
the GP must have IsCurrentOption = false.


I’ve created a Dynamic Root List based on the GP table.  This has rules in places to deal with the
scenario above and that all works well.


In my list I want to stop the user from being able to edit
the IsCurrentOption field if the associated GPPractice is IsCurrentOption  = false.


I created a custom Authorization rule to deal with that
scenario. 


When the list is loaded the rule is evaluated and the IsCurrentOption
property is readonly where appropriate.


If the GPPractice is changed to a GPPractice that has IsCurrentOption
 = true my Authorization rule is not checked.  Instead the BusinessBase will consult its
cache and get the value from the last time the rule was checked.  It’s not until the BusinessBase is saved (I’m
assuming  putting the BusinessBase  through the data portal loses its cache as the
caches are not serialised), will the rule be checked and return the correct
result.


I couldn’t see any way of forcing my rule to be checked when
the properties are changed.


 


Any idea’s how I can resolve this issue? 


Many thanks,


Nathan

Tuesday, March 18, 2014  |  From Code-gen Templates

I said sometime this week, and Kevin really worked hard on this, so the 4.5.580 pre-release with iOS support (via Xamarin tools) is now on nuget and GitHub:


http://www.lhotka.net/weblog/CSLANETBetaReleaseSupportingIOS.aspx


 

Monday, March 17, 2014  |  From Code-gen Templates

We're closing in on a version of CSLA .NET that works on iOS using the Xamarin tools.


This is the result of a lot of work by Stuart Bale, Kevin Ford, and myself, and Kevin is getting very close to where we can release a beta version - hopefully yet this week.


If you have Xamarin for iOS I hope you'll help us test this out, but we're very excited!!

Sunday, March 16, 2014  |  From Code-gen Templates

Rockford Lhotka says:


"Collections do not support direct declaration of properties, so you can’t implement properties in this class. If properties are required in addition to the list of child objects, you should create an editable parent object that contains the collection, along with those other properties and their rules."


 


So, I decided to check this out.


I've declared simply property in my inherited BusinessBindingListBase. Somethink like this:


property long DocId { get; set; }


 


I can do "Fetch" and "Update". And it works. My custom property always persist.


But I'm working with 2-tier mode.


 


Maybe it will not work in 3-tier? What reasons could stop me from using custom properties in BusinessBindingListBase?

 Code-gen Templates News Feed 

 VS Templates News Feed 
Tuesday, April 22, 2014  |  From VS Templates

Good day.


i would like to get some help on the following. i am working in a WinForms environment application, i have a "Save" button but i would like to enable/disable the button is my object has been changed. i would think that i would need to check the 'IsDirty' flag of my object, is this correct?


if so, how would i get a raised event when my 'IsDirty' property gets changed so that i can enable/disable my save button accordingly?


any help with on this would be much appreciated.

Monday, April 21, 2014  |  From VS Templates

How to prevent user to edit child object?


I have class with f.ex "orders" property. This is "BusinessBindingListBase" which contains "Order" objects.


I thought I can add "authorization rule" (AuthorizationActions.EditObject) that implements some logic. But it never executes. I can edit this child object and even save it. It looks wierd. How to prevent child object editing?

Saturday, April 19, 2014  |  From VS Templates

Hello


We have a class that contains property X with some expensive rules associated to it. We want all rules to fire if the value of property X gets changed, but we would like to suppress some of its rule if the rules are being fired due to an explicit call to ‘CheckRules(X)’ or due to property X having dependencies with other properties.



In other words, we need context to know why are the businesses rules being fired so we can determine whether to run them or not.



I took a quick look at the business rule runtime information and couldn’t find anything that could give me that context. Am I missing something or is it not possible to do what we want to do.



By the way, we already have a work around that solves our issue but I was wondering if I am missing something and there is a formal way of doing what we are doing the proper way.



We are currently using CSLA 4.2.2.0



Thanks.

Monday, April 14, 2014  |  From VS Templates

Hello everyone,


I am giving serious thought to replacing this current forum with a new and more modern set of software.


This forum runs on something called Community Server, and has gotten quite "long in the tooth". You might notice that it looks somewhat old, doesn't work well on phones, and spam is an increasing problem. What you _can't_ see is that behind the scenes fewer and fewer features are actually working at an admin level.


In other words, the current software is approaching any reasonable end of its life.


I don't yet know what I'll use to replace it, and if you have any suggestions of great/inexpensive forum hosting please let me know.


I _am_ considering using something called Discourse, which is a new open source forum project on GitHub. It looks like I can host it in Azure for a relatively small cost - hopefully low enough that the ads on the site will pay for the hosting.


I'm open to comments/thoughts/suggestions - this is your community as much as mine, and I value your input.

Wednesday, April 09, 2014  |  From VS Templates

When my private backing field SetProperty is called...even though it is ByRef, the value in mDTO.EvidNum does not change until AFTER the PropertyHasChanged runs.


This means that a simple rule like StringRequired runs and sees an empty string and the rule stays broken.  But the next step after rules running is that the mDTO.EvidNum property setter is called.  So you look at the business object and the rule is broken but there is a value there.


Any ideas?  I assume the CSLA code assumes a private backing field is just a string not a Class.StringProperty.


 


I have the following code:


    Private Shared EvidNumPropertyInfo As PropertyInfo(Of String) = RegisterProperty(Of String)(Function(c) c.EvidNum, RelationshipTypes.PrivateField)


    Public Property EvidNum() As String


        Get


            Return GetProperty(EvidNumPropertyInfo, mDTO.EvidNum)


        End
Get


        Set(ByVal value As String)


            SetProperty(EvidNumPropertyInfo,
mDTO.EvidNum, value)


        End
Set













Normal
0




false
false
false

EN-US
JA
X-NONE






















































































































































































    End
Property


 

Monday, April 07, 2014  |  From VS Templates

I am not sure if I posted this question before or somebody posted it, but somehow I cannot find the discussion.


We had lots of in-house applications that uses CSLA 3.0.6, .NET Framework 3.5/4, VS2010.  Would it possible to upgrade all of those to the latest CSLA version (4.5.501), .NET Framework 4.5 and VS 2012?


One our concern are there lots of validation and business rules in any of the project.


Thanks.

Monday, April 07, 2014  |  From VS Templates

So CSLA with iOS is in "beta" or in the initial stages of becoming possible - I do believe by looking at a pamphlet from Xamarin that they also drive Mac OS native applications.  I have a question out to someone at Xamarin as to whether these would be two different projects and native app buildouts in the solution (I'm guessing they would be).


In thinking about advocating for the Xamarin approach here, I wanted to see what the envisioned CSLA support for Mac OS would be.  Is that basically done when iOS became potentially supported or is this another ball of wax?

Thursday, April 03, 2014  |  From VS Templates

Hello everyone,


I have developed wcf .net 4 REST service that uses the wcf dataportal. Both services
are hosted in IIS 7 in same web app.  Parts of the web.config are enclosed at the end of this message.  


My wcf service runs successfully on ASP.NET developer server, but not in the IIS web server.  When accessing an API from web browser on port 80, I keep receiving this exception message:


Exception has been thrown by the target of an invocation


Would you have any ideas why could this be happening?  


 


The web,config:


<?xml version="1.0"?>


<configuration>


  <appSettings>


    <add key="MyDbName" value="MY_DB" />


    <add key="CslaAuthentication" value="Csla"/>


  </appSettings>


  <connectionStrings/>


  <system.serviceModel>


    <protocolMapping>


      <add scheme="http" binding="webHttpBinding" />


    </protocolMapping>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WebServiceBehavior">


          <serviceMetadata httpGetEnabled="true"/>


          <serviceDebug includeExceptionDetailInFaults="true"/>


        </behavior>


        <behavior name="returnFaults">


          <serviceDebug includeExceptionDetailInFaults="true" />


        </behavior>


      </serviceBehaviors>


      <endpointBehaviors>


        <behavior name="RESTEndpointBehavior">


          <webHttp />


        </behavior>


      </endpointBehaviors>


    </behaviors>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="1" />


    <services>


      <service behaviorConfiguration="WebServiceBehavior" name="Something">


        <endpoint address="" binding="webHttpBinding" contract="ISomethingContract" behaviorConfiguration="RESTEndpointBehavior" />


        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>


        <host>


          <baseAddresses>


            <add baseAddress="http://localhost:8000" />


          </baseAddresses>


        </host>


      </service>


      <service name="Csla.Server.Hosts.WcfPortal" behaviorConfiguration="returnFaults">


        <endpoint binding="wsHttpBinding" contract="Csla.Server.Hosts.IWcfPortal" bindingConfiguration="WSHttpBinding_IWebService"/>


      </service>


    </services>


    <bindings>


      <wsHttpBinding>


        <binding name="WSHttpBinding_IWebService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">


          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>


          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>


          <security mode="None">


            <transport clientCredentialType="None"/>


          </security>


        </binding>


      </wsHttpBinding>


    </bindings>    


  </system.serviceModel>


  <system.web>


    <sessionState mode="InProc" cookieless="true" regenerateExpiredSessionId="false" timeout="20"/>


    <compilation debug="true" targetFramework="4.0">


    </compilation>


    <authentication mode="Windows"/>


       <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>


  </system.web> 



</configuration>



 


Thank you in advance,
Tanja


PS. The web site is setup in the ASP.NET v4.0 Application pool  (Integrated managed pipeline mode and ApplicationPoolIdentity for indenty) and the WcfPortal.svc is located in the same location where my svc file is.

Friday, March 28, 2014  |  From VS Templates

Hi,


 


I am new to CSLA. And got stuck up.


 


i am getting the following error when using the Entity frameework.


 


Error 1 The type 'ShasPatho.DalEf.ShasPathoEntities' cannot be used as type parameter 'C' in the generic type or method 'Csla.Data.ObjectContextManager<C>'. There is no implicit reference conversion from 'ShasPatho.DalEf.ShasPathoEntities' to 'System.Data.Objects.ObjectContext'.


 


any help would be great.


 


regards


 


ashish


Wednesday, March 26, 2014  |  From VS Templates

Microsoft is interested in buying Xamarian.  More MVVM frameworks are now working better with PCL and multi platform solutions such as MVVMCROSS.  With these changes in the multi platform arena, has there been any readdressing of the issue of building a CSLA Core module compatible with Portable Class Libraries?  I am now having to face the decision of leaving behind my beloved CSLA.

Tuesday, March 25, 2014  |  From VS Templates

I have a created a Read Only Lists that inherits from CSLA ReadOnlyListBase. I am calling a BeginGet method passing in a criteria class (both classes have been marked as serializable).


This fetch does work on the first call, however any subsequent calls of the same method are causing the error below:


ERROR MESSAGE:


{: at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result) at System.ServiceModel.ClientBase1.ChannelBase1.EndInvoke(String methodName, Object[] args, IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.WcfPortalClientChannel.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.Csla.WcfPortal.IWcfPortal.EndFetch(IAsyncResult result) at Csla.WcfPortal.WcfPortalClient.OnEndFetch(IAsyncResult result) at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result) : Error HRESULT E_FAIL has been returned from a call to a COM component. at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) at System.Net.Browser.BrowserHttpWebRequest.<>c_DisplayClassa.b_9(Object sendState) at System.Net.Browser.AsyncHelper.<>c_DisplayClass4.b_0(Object sendState) }


My breakpoint on the DataPortal_Fetch method is not being hit (after the first fetch) on the server side, as the error indicates. 


Any advice to help me solve this would be appreciated.

Friday, March 21, 2014  |  From VS Templates

Hi guys,


I think I have an interesting one.  I have been reading many, many discussions on this topic and altering my code and have found an interesting quirk.  Below are the most useful discussions I've read and taken ideas from.


http://forums.lhotka.net/forums/p/12036/56156.aspx


http://forums.lhotka.net/forums/p/8931/42494.aspx


I have a .NET 4.5, CSLA 4.5.40, Silverlight 5, IIS 7.5 application that has been working terrifically locally but I've been trying to deploy to a webserver.  My AppPool settings have gone through every possible permutation but I have settled with Integrated and Identity: LocalSystem.  If I change the identity it gives similar results as mentioned below but with a different system account.  IIS site authentication only has ASP .NET Impersonation and Windows Authentication Enabled.


Here is the web.config with all the tags that have been identified as required:


<?xml version="1.0" encoding="utf-8"?>


<configuration>


  <appSettings>


    <add key="EventLogName" value="GreyDev" />


    <add key="CslaAuthentication" value="Windows"/>


    <add key="CslaWriter" value="Csla.Serialization.Mobile.CslaBinaryWriter, Csla" />


    <add key="CslaReader" value="Csla.Serialization.Mobile.CslaBinaryReader, Csla" />


  </appSettings>


  <connectionStrings>


PRIVATE :)


  </connectionStrings>


  <system.web>


    <compilation debug="true" targetFramework="4.5" />


    <authentication mode="Windows" />


    <identity impersonate="true" />


    <pages controlRenderingCompatibilityVersion="4.0"/>


  </system.web>


  <system.webServer>


    <validation validateIntegratedModeConfiguration="false" />


  </system.webServer>


  <system.serviceModel>


    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />


    <services>


      <service behaviorConfiguration="WcfPortalBehavior" name="Business.Compression.CompressedHost">


        <endpoint binding="basicHttpBinding" contract="Csla.Server.Hosts.Mobile.IWcfPortal" bindingConfiguration="BasicHttpBinding_IWcfPortal" />


      </service>


    </services>


    <behaviors>


      <serviceBehaviors>


        <behavior name="WcfPortalBehavior">


          <serviceDebug includeExceptionDetailInFaults="true" />


 <serviceAuthorization impersonateCallerForAllOperations="true" />


        </behavior>


      </serviceBehaviors>


    </behaviors>


    <bindings>


      <basicHttpBinding>


        <binding name="BasicHttpBinding_IWcfPortal" 


maxReceivedMessageSize="2147483647"


                   maxBufferPoolSize="2147483647"


                   maxBufferSize="2147483647" >


          <readerQuotas maxBytesPerRead="2147483647"


                          maxArrayLength="2147483647"


                          maxStringContentLength="2147483647"


                          maxNameTableCharCount="2147483647"


                          maxDepth="2147483647" />


          <security mode="TransportCredentialOnly">


            <transport clientCredentialType="Windows" />


          </security>


        </binding>


      </basicHttpBinding>


    </bindings>


  </system.serviceModel>


</configuration>




On to my results.  In my AppIdentity class I call the CSLA method PopulateWindowsIdentity().  Digging into this method I found that the main call to retrieve the impersonated windows user is:  var currentUser = System.Security.Principal.WindowsIdentity.GetCurrent();

No matter what config, IIS or AppPool settings I have changed, the returned WindowsIdentity.Name is always "NT AUTHORITY\SYSTEM" (this varies when changing the AppPool Identity as mentioned before).  It never impersonated the user, in my case 'speters' (my AD name).  I have made a small ASP web app with the same config and IIS settings and in that app, Impersonation works!  In that application, I have found that the web.config setting <identity impersonate="true" /> directly turns off or on the Impersonation with the true/false setting.


After 3 days of trying every setting I could find, reading every article I could find, I decided to call another method in my AppIdentity class, var cslaname = Csla.ApplicationContext.User.Identity.Name.

This Csla.ApplicationContext call successfully retreives my Impersonated AD credentials.  With this information I have managed to check the result of both Identity calls and choose the one that is needed, so technically my applicaton is working.  However, I still would love to know what it takes to get the WindowsIdentity to properly Impersonate.


In Summary, with all the above settings:

System.Security.Principal.WindowsIdentity.GetCurrent().Name; Does NOT Impersonate Client User AD

Csla.ApplicationContext.User.Identity.Name;  Does Impersonate/Fetch Client User AD


Any thoughts on whats happening here?

 

Friday, March 21, 2014  |  From VS Templates

I've noticed that
short-circuiting rules in CSLA 4.5.501.0 is not working. That is when I
set prioritization to my business rules then set the
ProcessThroughPriority. When I query the Broken Rules I get all invalid
rules even those that has higher priority than ProcessThroughPriority
value. Is there a newer way of doing it?

Thursday, March 20, 2014  |  From VS Templates

Hi,


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred.  There is no detail as to the problem.  What is the method that people are using to return the original message such as a table update failed back to the client?


Todd Haehn

Wednesday, March 19, 2014  |  From VS Templates

I had assumed that SafeDataReader would convert any null strings coming from SQL Server into String.Empty.

But after finding some app exceptions logged, I have confirmed that null values from the database are being set to Nothing (vb.net) in their properties. I don't want to have to deal with null/Nothing in string properties.

Am I doing something wrong?

The code I am using was generated by CodeSmith, using encapsulated implementation. It uses a SafeDataReader, and in this case it passes it to a Map routine.

Something like this:

LoadProperty(_LongDescriptionProperty, reader.Item("LongDescription"))


Will break my app if I try something like:

Foo.LongDescription.Trim, because it will throw an exception.

Am I doing something wrong? I'd hate to have to write a bunch of code to check for null values, and convert them to empty strings.


Thanks.

FWIW, I'm a longtime user of CSLA (since VB6 days). Not on every project, but on quite a few, in different industries. It's a great tool.


 


 

Wednesday, March 19, 2014  |  From VS Templates

Hi there,


Need some clarification on this statement from previous post:


My key issue is that there is a LOT you must make sure to NOT use, such as the standard rules, the CslaContrib rules 
or the CslaGenFork rules.

Refresh of my situation:


  • I am using DTO from my DAL as a private field in BusinessBase object.  The individual PropertyInfo objects are marked with PrivateField and the Getters/Setters use the GetProperty and SetProperty.
  • I cannot bring myself to write a LoadProperty/ReadProperty overload for every property!  It is too unmaintainable unless I only had a couple properties.

Currently I am using the CommonRules and they work great!!  Only the DataAnnotation rules do not work.  I debugged the CommonRule, the execution does a Using ByPassPropertyChecks and then calls my getter on the primary property using the DynamicMethodGetter.


Given the following parameters (question below)


  • I do not use Async rules
  • I do not use the CSLAContrib or CSLAGenFork rules
  • I do not use Input or OutputProperties
  • I do not target async clients (WinRt, WPhone, Silverlight)
  • If I DO ever write an async rule with no Target access OR if I use input/output properties I will do Load/ReadProperty overload for the few relevant properties

Am I missing something?  Thanks for patience as I understand the guts of what is going on. 


This code is screaming fast and I like not having to load my business object properties one by one from the DAL layer at fetch and update!  Yes my DTO is tied into my BusinessLayer, but I am willing to live with that for the benefit.


Extra benefit is I want to spin up a ReadOnly version I can transfer the DTO to a ReadOnly Friend factory method and viola!

Tuesday, March 18, 2014  |  From VS Templates

Hi,


Hopefully this question will have better success than the last....


I have table called GP. 
Two of the fields are called IsCurrentOption and GPPracticeId .


The GPPracticeId is a foreign key to the GPPractice
table.  A GPPractice also has an IsCurrentOption
field.


I have a rule that if the GP record is related to a GPPractice
with the IsCurrentOption  = false then
the GP must have IsCurrentOption = false.


I’ve created a Dynamic Root List based on the GP table.  This has rules in places to deal with the
scenario above and that all works well.


In my list I want to stop the user from being able to edit
the IsCurrentOption field if the associated GPPractice is IsCurrentOption  = false.


I created a custom Authorization rule to deal with that
scenario. 


When the list is loaded the rule is evaluated and the IsCurrentOption
property is readonly where appropriate.


If the GPPractice is changed to a GPPractice that has IsCurrentOption
 = true my Authorization rule is not checked.  Instead the BusinessBase will consult its
cache and get the value from the last time the rule was checked.  It’s not until the BusinessBase is saved (I’m
assuming  putting the BusinessBase  through the data portal loses its cache as the
caches are not serialised), will the rule be checked and return the correct
result.


I couldn’t see any way of forcing my rule to be checked when
the properties are changed.


 


Any idea’s how I can resolve this issue? 


Many thanks,


Nathan

Tuesday, March 18, 2014  |  From VS Templates

I said sometime this week, and Kevin really worked hard on this, so the 4.5.580 pre-release with iOS support (via Xamarin tools) is now on nuget and GitHub:


http://www.lhotka.net/weblog/CSLANETBetaReleaseSupportingIOS.aspx


 

Monday, March 17, 2014  |  From VS Templates

We're closing in on a version of CSLA .NET that works on iOS using the Xamarin tools.


This is the result of a lot of work by Stuart Bale, Kevin Ford, and myself, and Kevin is getting very close to where we can release a beta version - hopefully yet this week.


If you have Xamarin for iOS I hope you'll help us test this out, but we're very excited!!

Sunday, March 16, 2014  |  From VS Templates

Rockford Lhotka says:


"Collections do not support direct declaration of properties, so you can’t implement properties in this class. If properties are required in addition to the list of child objects, you should create an editable parent object that contains the collection, along with those other properties and their rules."


 


So, I decided to check this out.


I've declared simply property in my inherited BusinessBindingListBase. Somethink like this:


property long DocId { get; set; }


 


I can do "Fetch" and "Update". And it works. My custom property always persist.


But I'm working with 2-tier mode.


 


Maybe it will not work in 3-tier? What reasons could stop me from using custom properties in BusinessBindingListBase?

 VS Templates News Feed 

Last edited Jan 18, 2007 at 6:55 PM by RockfordLhotka, version 2

Comments

No comments yet.