steps to get the csla hello world samples to run (winforms and webforms only)

steps to get the csla hello world samples to run (winforms and webforms only)

Old forum URL: forums.lhotka.net/forums/t/11518.aspx


gullu posted on Monday, August 06, 2012

hi All,

Does anyone have any info on what I need to do to get the samples to run. I need to work on a project for a client with specific version requirements. (they need it done in .net 3.5 sp1 only - not the latest .net 4 or 4.5).

So I downloaded the samples and source for csla 3.8.4-111003

Built the source to basically build csla.dll

Opened the Projectracker  sample and removed projects I did not need like wpf, etc -- I need only winforms and webforms

Fixed the broken csla.dll references

Ran the web forms app - get cannot to web server error. Normally for my other web forms apps Visual studio starts its own web server and everything magically works.

Next I ran the winforms app (c#)

Get the below error.

 

Pls advise what I need to do to get the winforms/webforms sample to run.

thanks

edit: my screenshot does not show when I post. Showed when I was typing my post. ..

RockfordLhotka replied on Monday, August 06, 2012

ProjectTracker generally only works for versions directly corresponding to released of my books.

So the version for Expert 2008 Business Objects should work (3.6 I think?). And the version for Using CSLA 4 works (4.1 to 4.3).

gullu replied on Monday, August 06, 2012

thx Rocky. i will download 3.6 and see how it goes.

gullu replied on Tuesday, August 07, 2012

hi Rocky,  pls tell me the steps to run the Project tracker sample. For understanding I took the latest 4.3.13 installer and samples. The only project I want to run and learn is the winforms cs and vb.net version. I have tried every trick possible. Please give me the steps I need to do to run winforms project tracker.

thanks

JonnyBee replied on Tuesday, August 07, 2012

Hi,

To make ProjectTracker from CSLA 4.3 run OK you must change all the list objects to inherit from XYZBindingListBase and fix following compiler error (mostly another signature for AddNewCore method). 

Or you may run the 3.x versions as Rocky recommended.

gullu replied on Wednesday, August 08, 2012

thx JonnyBee. I thought I will have definite success by using the latest greatest. i will now take 3.6 and see how it goes. No wonder a google for "csla hello world" turns up more questions than answers..:-)

gullu replied on Wednesday, August 08, 2012

Now tried 3.6.0-081217. Get below error when I run PTWin project

System.ServiceModel.EndpointNotFoundException was unhandled
  Message="Could not connect to http://localhost:4147/WcfHost/WcfPortal.svc. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:4147. "
  Source="mscorlib"
  StackTrace:
    Server stack trace:
       at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
       at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout)
       at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
       at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
       at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
       at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
       at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at Csla.Server.Hosts.IWcfPortal.Fetch(FetchRequest request)
       at Csla.DataPortalClient.WcfProxy.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\misc\csla\cslacs-3.6.0-081217\cslacs\Csla\DataPortalClient\WcfProxy.cs:line 138
       at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\misc\csla\cslacs-3.6.0-081217\cslacs\Csla\DataPortal.cs:line 265
       at Csla.DataPortal.Fetch[T](Object criteria) in C:\misc\csla\cslacs-3.6.0-081217\cslacs\Csla\DataPortal.cs:line 173
       at ProjectTracker.Library.Security.PTIdentity.GetIdentity(String username, String password) in C:\misc\csla\netsamples-3.6.0-081217\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 21
       at ProjectTracker.Library.Security.PTPrincipal.Login(String username, String password) in C:\misc\csla\netsamples-3.6.0-081217\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTPrincipal.cs:line 18
       at PTWin.LoginForm.OK_Click(Object sender, EventArgs e) in C:\misc\csla\netsamples-3.6.0-081217\CslaNet\cs\ProjectTrackercs\PTWin\LoginForm.cs:line 23
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.PerformClick()
       at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
       at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
       at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
       at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at PTWin.MainForm.DoLogin() in C:\misc\csla\netsamples-3.6.0-081217\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 327
       at PTWin.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\misc\csla\netsamples-3.6.0-081217\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 39
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException: System.Net.WebException
       Message="Unable to connect to the remote server"
       Source="System"
       StackTrace:
            at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
            at System.Net.HttpWebRequest.GetRequestStream()
            at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
       InnerException: System.Net.Sockets.SocketException
            Message="No connection could be made because the target machine actively refused it 127.0.0.1:4147"
            Source="System"
            ErrorCode=10061
            NativeErrorCode=10061
            StackTrace:
                 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
                 at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
            InnerException:

JonnyBee replied on Wednesday, August 08, 2012

That means that the WcfHost service is not started automatically or runs on another port.

I downloaded the Csla 3.8.4 Source and Samples - and you should extract the

source download to : "C:\Visual Studio Projects\csla\Source\"
samples download to "C:\Visual Studio Projects\csla\Samples\"
(this gives the correct reference paths and data base connection strings)

Using VS2010 i then opened the csla source solution, converted to VS2010 (but not .NET 4.0)  and build CSLA.
Then Open ProjectTrackercs solution, converted to Vs2010 (but not nET 4.0)  and build - make sure PtWin is the startup project.

PTWin and the WcfHost project starts automatically and everything runs fine.

The instructions to get started with ProjectTracker in CSLA 3.6 (and 3.x higher) can be found here:
http://www.lhotka.net/files/csla36/cslabuild.pdf

gullu replied on Thursday, August 09, 2012

thx Johny bee. Doing exactly as per your advice except vs 2008 (so no conversion was needed). i will try vs 2010 next.. Here's the error I get ..

Csla.DataPortalException was unhandled
  Message="DataPortal.Fetch failed (A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified))"
  Source="Csla"
  StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
       at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
       at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
       at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
       at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
       at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
       at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
       at dm(Object , Object[] )
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 361
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 270
       at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\LateBoundObject.cs:line 86
       at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Server\SimpleDataPortal.cs:line 125
       at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\DataPortal.cs:line 265
       at Csla.DataPortal.Fetch[T](Object criteria) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\DataPortal.cs:line 173
       at ProjectTracker.Library.Security.PTIdentity.GetIdentity(String username, String password) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 21
       at ProjectTracker.Library.Security.PTPrincipal.Login(String username, String password) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTPrincipal.cs:line 18
       at PTWin.LoginForm.OK_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\LoginForm.cs:line 23
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at PTWin.MainForm.DoLogin() in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 327
       at PTWin.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 39
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException: Csla.Reflection.CallMethodException
       Message="DataPortal_Fetch method call failed"
       Source="Csla"
       StackTrace:
            at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
            at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
            at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
            at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
            at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
            at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
            at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
            at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
            at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
            at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
            at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
            at System.Data.SqlClient.SqlConnection.Open()
            at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
            at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
            at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
            at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
            at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
            at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
            at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
            at dm(Object , Object[] )
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 361
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 270
            at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\LateBoundObject.cs:line 86
            at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Server\SimpleDataPortal.cs:line 125
       InnerException: System.Data.SqlClient.SqlException
            Message="A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
            Source=".Net SqlClient Data Provider"
            ErrorCode=-2146232060
            Class=20
            LineNumber=0
            Number=-1
            Server=""
            State=0
            StackTrace:
                 at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
                 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
                 at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
                 at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
                 at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
                 at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
                 at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
                 at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
                 at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
                 at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
                 at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
                 at System.Data.SqlClient.SqlConnection.Open()
                 at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
                 at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
                 at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
                 at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
                 at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
                 at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
                 at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
                 at dm(Object , Object[] )
                 at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
            InnerException:

JonnyBee replied on Thursday, August 09, 2012

The exception indicates that SQLEXPRESS instance is not available on your computer.

So either make sure that SQLEXPRESS is installed and running with this instance name or correct/edit the connection strings to match your computer in
ProjectTrackercs\www\WcfHost\web.config  for both PTracker and Security databases.

gullu replied on Friday, August 10, 2012

Changed web.config. Still getting the same error I posted earlier. I can get into sql studio and browse all my other db's. Basically sql server is installed correctly. The instance name in web.config has been changed from sqlexpress to my sql server instance name. thx

gullu replied on Friday, August 10, 2012

I changed app.config also to point to my sql server instance. I now get this error. ( I have sql server enterprise ed where user instance login is not supported I think)

Csla.DataPortalException was unhandled
  Message="DataPortal.Fetch failed (The user instance login flag is not supported on this version of SQL Server. The connection will be closed.)"
  Source="Csla"
  StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
       at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
       at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
       at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
       at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
       at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
       at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
       at dm(Object , Object[] )
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 361
       at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 270
       at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\LateBoundObject.cs:line 86
       at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Server\SimpleDataPortal.cs:line 125
       at Csla.DataPortal.Fetch(Type objectType, Object criteria) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\DataPortal.cs:line 265
       at Csla.DataPortal.Fetch[T](Object criteria) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\DataPortal.cs:line 173
       at ProjectTracker.Library.Security.PTIdentity.GetIdentity(String username, String password) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 21
       at ProjectTracker.Library.Security.PTPrincipal.Login(String username, String password) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTPrincipal.cs:line 18
       at PTWin.LoginForm.OK_Click(Object sender, EventArgs e) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\LoginForm.cs:line 23
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.PerformClick()
       at System.Windows.Forms.Form.ProcessDialogKey(Keys keyData)
       at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
       at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
       at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
       at PTWin.MainForm.DoLogin() in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 327
       at PTWin.MainForm.MainForm_Load(Object sender, EventArgs e) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTWin\MainForm.cs:line 39
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  InnerException: Csla.Reflection.CallMethodException
       Message="DataPortal_Fetch method call failed"
       Source="Csla"
       StackTrace:
            at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
            at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
            at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
            at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
            at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
            at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
            at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
            at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
            at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
            at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
            at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
            at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
            at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
            at System.Data.SqlClient.SqlConnection.Open()
            at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
            at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
            at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
            at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
            at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
            at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
            at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
            at dm(Object , Object[] )
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 361
            at Csla.Reflection.MethodCaller.CallMethod(Object obj, String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 270
            at Csla.Reflection.LateBoundObject.CallMethod(String method, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\LateBoundObject.cs:line 86
            at Csla.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Server\SimpleDataPortal.cs:line 125
       InnerException: System.Data.SqlClient.SqlException
            Message="The user instance login flag is not supported on this version of SQL Server. The connection will be closed."
            Source=".Net SqlClient Data Provider"
            ErrorCode=-2146232060
            Class=14
            LineNumber=65536
            Number=18493
            Procedure=""
            Server="myserver"
            State=1
            StackTrace:
                 at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
                 at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
                 at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
                 at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
                 at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
                 at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
                 at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
                 at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
                 at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
                 at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
                 at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
                 at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
                 at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
                 at System.Data.SqlClient.SqlConnection.Open()
                 at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(IConnectionUser user)
                 at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe()
                 at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode()
                 at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
                 at System.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)
                 at System.Linq.Queryable.Count[TSource](IQueryable`1 source)
                 at ProjectTracker.Library.Security.PTIdentity.DataPortal_Fetch(UsernameCriteria criteria) in C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\ProjectTracker.Library\Security\PTIdentity.cs:line 63
                 at dm(Object , Object[] )
                 at Csla.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) in C:\Visual Studio Projects\csla\Source\cslacs\Csla\Reflection\MethodCaller.cs:line 357
            InnerException:

JonnyBee replied on Friday, August 10, 2012

UserInstance is a runtime mode. 

Try to set userinstance flag to false in connection string.

If this fails mount the 2 databases in SQL Server and change connection strings accordingsly.

gullu replied on Friday, August 10, 2012

I am using sql 2008 r2 and when I try to to attach those 2 mdf files I get the error

Unable to open the physical file .... Operating system error 5: "5(Access is denied.)". Error 5120

setting userinstance flag to false did not work either...

I am trying to attach as admin (full rights)

pls advise if any other trick. thx

JonnyBee replied on Friday, August 10, 2012

Copy the databases files (mdf and ldf) to your default sql data store folder and then attach them.

gullu replied on Friday, August 10, 2012

Attach worked and now I get

Csla.DataPortalException was unhandled
  Message="DataPortal.Fetch failed (Cannot open database \"C:\\Visual Studio Projects\\csla\\Samples\\CslaNet\\cs\\ProjectTrackercs\\Security.mdf\" requested by the login. The login failed.\r\nLogin failed for user 'domain\gullu'.)"
  Source="Csla"
  StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
      
       I have added the user domain\gullu to the csla  security db and checked all rights (full access)


using integrated security.

JonnyBee replied on Friday, August 10, 2012

You must update connection strings to use the databases attached to SqlServer. 

gullu replied on Friday, August 10, 2012

Now using std security (not integrated). Changed the sql server security to mixed and sql server. Still says login failed for security.mdf. Here are my connection strings

in web.config

  <connectionStrings>
    <add name="PTracker" connectionString="Data Source=myserver;Initial Catalog=&quot;C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTracker.mdf&quot;;Integrated Security=False;User ID=sa;Password=sa;User Instance=False" providerName="System.Data.SqlClient"/>
    <add name="Security" connectionString="Data Source=myserver;Initial Catalog=&quot;C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\Security.mdf&quot;;Integrated Security=False;User ID=sa;Password=sa;User Instance=False" providerName="System.Data.SqlClient"/>
  </connectionStrings>

 

in app.config

 

<connectionStrings>
    <add name="PTracker"
             connectionString="Data Source=myserver;Initial Catalog=&quot;C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\PTracker.mdf&quot;;Integrated Security=False;User ID=sa;Password=sa;User Instance=False"
             providerName="System.Data.SqlClient" />
    <add name="Security"
             connectionString="Data Source=myserver;Initial Catalog=&quot;C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\Security.mdf&quot;;Integrated Security=False;User ID=sa;Password=sa;User Instance=False"
             providerName="System.Data.SqlClient" />
  </connectionStrings>

JonnyBee replied on Friday, August 10, 2012

Use a .NET program like LinqPad and make sure that you can connect and run sql queries. 

I believe LinqPad will also show the connection string. 

gullu replied on Friday, August 10, 2012

Yes. That works. I am able to run queries etc but I dont know where linqpad lets you view the connection string. Google did not help. thx

JonnyBee replied on Friday, August 10, 2012

Use LinqPad and new Query.

Set Language to "C# Statements".

Paste this query and set your own properties:

var builder = new SqlConnectionStringBuilder();
builder.DataSource = "mycomputer";
builder.InitialCatalog = "mycatalog";
builder.UserID = "xyz";
builder.Password = "abc";
builder.ConnectionString.Dump();

(you also get intellisense on the other properties available).

And correct the settings to what your connection should use, run query, and you will get the connectionstring to use in the output windows.

 

gullu replied on Friday, August 10, 2012

Actually it generates a connection string for use in c# code. Not the one's you put in config file

 

Initial Catalog="C:\Visual Studio Proj....

instead of

Initial Catalog=&quot;C:\Visual Studio Proj..

The connection strings match however. No luck yet with this frustrating issue.

JonnyBee replied on Friday, August 10, 2012

Have you tried to rename the databases to PTracker and Security in management studio?

gullu replied on Friday, August 10, 2012

just tried that also. Do you know where in the code the connection string is used to connect to the database. Due to all the wcf proxy stuff it is hard to debug via stepping thru the code...

JonnyBee replied on Saturday, August 11, 2012

I wouldn't take that path. You would have to change each business class where a ContextManager is created.

Search Google for XmlEncode string and you will find several online conversion sites. I usually use this:
http://coderstoolbox.net/string/

and just paste that result string into the web.config.

You should probably check the SqlServer error log - this will usually tell you more details about why the login failed.

Just a couple of links to get you started:
http://webbtechsolutions.com/2010/10/19/where-is-the-sql-server-errorlog-file/
http://sqlserverpedia.com/wiki/SQL_Server_Error_Logs

gullu replied on Monday, August 13, 2012

Thx for all your help Johnybee. I fortunately found a colleague who has sample code that uses adventureworks without all this wcf gobblety gook. So I finally have a working sample that uses sql server and csla with winforms..(without all the baggaage..)

 

BigPines2 replied on Tuesday, November 13, 2012

Sorry to resurrect and older thread but I also can't get the CSLA asp example to compile.

I have been using CSLA for Windows apps since v2 and have been really happy with it up though 3.5.3. However, I am looking at using it again for an asp.NET app but this time around I am less impressed. I read the v4.5 eBooks thinking I would go in that direction but there was very little mentioned regarding asp. I also noticed the example code no longer has an asp illustration (I will not be using MVC) so I decided to look at v3.8.4 instead but I can't get the example code to compile to save my life. I have followed JonnyBee's above instructions to the "T" but no matter what I do, I get the following compile error:

Error    102    Could not load file or assembly 'PresentationCFFRasterizer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.    C:\Visual Studio Projects\csla\Samples\CslaNet\cs\ProjectTrackercs\www\WcfHost\Web.config    57

If I comment out line 57 in the web.config:

<add assembly="PresentationCFFRasterizer, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

The solution compiles successfully and the Windows app launches. Hopefully, I don't need the above assembly for what I am doing. Now, if I set the start-up project to be PTWebForms, I get a different error:

Unable to start debugging on the web server. Unable to connect to the web server. Verify that the web server is running and that incoming HTTP requests are not blocked by a firewall.

I have spent hours searching around trying anything to get this to work but no dice. I found that one solution Rocky offered to this problem was to run VS as Administrator. I am already doing that. I figured maybe I should set up the data portal to run locally so I changed that in the PTWebForms web.config file but that didn't work either. I would appreciate any suggestions to get this going. I am tempted to remove all the extra projects I don't need to see if that helps.

So are people still using CSLA with asp? Are there any good examples around? I know a few years ago, it was widely used but perhaps it has fallen out of favor.

Just an observation, CSLA appears to have become very complex. I'm starting to wonder if it is worth all the trouble (believe me, my boss is going to be asking me this very question). There seems to be a lot of emphasis on Silverlight but from my perspective, Silverlight isn't exactly catching fire. It supports iPhone and Droid (really?), the data portal seems to have become very complicated to implement and I really don't see the upside to the extra complexity. All these options are great but if it makes it too difficult to use CSLA for something basic like asp, that seems like a problem to me. CSLA was always more work but at one point, I believed it was worth it. I haven't given up on it yet but I am pretty discouraged so far. Hopefully, someone can help me with an example that works.

Who knows, maybe I'll just keep going further and further back until I find a CSLA asp version that works.

Mike

RockfordLhotka replied on Tuesday, November 13, 2012

I am sorry you are frustrated.

People do use CSLA .NET and ASP.NET Web Forms. But the number of people building anything new with Web Forms has dropped to extremely low numbers, and so has my interest in creating content for that (seemingly dying) technology.

Until .NET 4.5 Web Forms was unchanged from 2005. In other words, the chapters in the 'Expert 2005 Business Objects' and 'Expert 2008 Business Objects' books dealing with Web Forms remain valid - other than minor accommodations for changes to CSLA itself, and perhaps to Visual Studio tooling.

Even in .NET 4.5 Web Forms is pretty similar, though it did get some nice data binding enhancements and better support for HTML 5. If those minor enhancements are enough to reignite any interest by the broader community for Web Forms I'll likely create more Web Forms content when I write the 'Using CSLA 4.5' books next year. I'm pretty skeptical though.

 

It is true that CSLA has become optionally more complex. In other words, it is more complex if you choose to use the advanced features and extensibility points.

Otherwise it has become steadily less complex. The amount of code necessary to create a business class has gone down dramatically between 2.0 and 4.5. In most cases you now have to write less than half the amount of code that used to be required. And you have to understand less detail about the inner workings of things like the data portal, because a lot of the drudge work is now handled for you.

At the same time it is true that we support a lot of more advanced scenarios than before, and those scenarios can become complex quickly. So it is really a matter of whether you want to use the simpler pre-built (and recommended) approaches, or dive off the deep end to play with the advanced capabilities.

BigPines2 replied on Tuesday, November 13, 2012

Thanks Rocky. I am surprised to hear about the very few people interested in Web Forms. So MVC is all the rage. Maybe I'll have to invest the time to get into that. I just don't understand why I can't get the examples working.

Mike

JonnyBee replied on Tuesday, November 13, 2012

Hi Mike,

Do you use VS2008 or VS2010?

It seems to me that you have upgraded the project from .NET 3.5 to .NET 4.0 and struggle with framework changes between the 2 versions?

I also find that IIS Express 7.5 is a better development server for CSLA projects in that non-Windows Principal is supported.

Other than that - you need to make sure that the data base connection strings point to to the correct disk folder where you have the sample in all the config files.

On my computer I took the downloaded sample

and the PTWebForms sample runs fine - can log in and open the 3 menu items to look at data.

BigPines2 replied on Tuesday, November 13, 2012

Thanks JonnyBee, it is very kind of you to try to help me. I recognize your name from my earlier CSLA forum days. Smile

I am using VS2010. I did upgrade the project but specifically did *NOT* upgrade the framework version on either of the solutions. I verified the CSLA project is 3.5 The following projects from the ProjectTracker solution were also verified to be running 3.5: ProjectTracker.DalEf, ProjectTracker.DalLinq, ProjectTracker.Library, PTWcfClient, PTWcfServiceAuth, PTWebForms, PTWebMvc, PTWfActivites, PTWin, PTWorkflow & PTWpf.

I guess I could try to download IIS Express 7.5 and try again. *shrug*

Mike

BigPines2 replied on Wednesday, November 14, 2012

Update: I deleted the samples solution and this time opened a fresh copy in VS2008 without any conversion. It compiles fine but after setting the PTWebForms project as the start-up project, I get the same error:

Unable to start debugging on the web server. Unable to connect to the web server. Verify that the web server is running and that incoming HTTP requests are not blocked by a firewall.

So it appears this example just plain doesn't work for some reason. Maybe it is a Windows 7 or IE 9 thing?

The project does run in VS2010 if I run it without debugging. I don't see the option in VS2008 to run without debugging (nor is that really an appropriate solution).

I haven't tried IIS Express 7.5 yet. That will be next I guess.

Mike

BigPines2 replied on Wednesday, November 14, 2012

Well, IIS Express 7.5 is not the solution for me. I downloaded the installer and when I ran it I got the following error:

A newer version of IIS Epress 7.5 was found on this machine.

At this point, all I can think of doing is start looking at older framework examples until I get one that runs. Maybe then I can gradually upgrade the CSLA framework in that example to get more up-to-date.

In addition to hoping for some additional advice, the main reason I continue to post my progress here is because I hope it may help some other poor asp soul down the road who may be having the same problems.

Mike

JonnyBee replied on Wednesday, November 14, 2012

That means that you have IIS Express 8 and Visual Studio 2012 installed on your dev machine as well as Visual Studio 2010.

This is exactly what I have on my dev computer too - so you should still be able to select IIS Express for running the PTWebForms sample.

BigPines2 replied on Wednesday, November 14, 2012

Nope. I have VS2008 and VS2010 only. What a mystery. Sad

Is there a way for me to select IIS Express for a project in VS2010? I can't seem to find a setting for that.

Mike

BigPines2 replied on Wednesday, November 14, 2012

Update: I kept going further and further back until I got past the error I was having. If anyone else is interested. v3.7.1 doesn't have the same problem. Unfortunately, it has another problem detailed here: http://forums.lhotka.net/forums/p/157/40004.aspx

I haven't bothered to try to solve that one yet. It is amazing to me how difficult this has been. I guess I'll have to decide if I can switch to MVC or just forget about CSLA completely. Bummer.

Mike

BigPines2 replied on Wednesday, November 14, 2012

So I tried the 4.5 example by setting the MVC project as the start-up project and it has the same two errors outlined above. Obviously this must be a problem with my environment but I've never had issues like this before with any other solutions. I will try to install VS2012 and see what that does. If that doesn't work, maybe I'll try a different development machine.

What a nightmare.

Mike

tiago replied on Tuesday, November 13, 2012

BigPines2

Just an observation, CSLA appears to have become very complex. I'm starting to wonder if it is worth all the trouble (believe me, my boss is going to be asking me this very question). There seems to be a lot of emphasis on Silverlight but from my perspective, Silverlight isn't exactly catching fire. It supports iPhone and Droid (really?), the data portal seems to have become very complicated to implement and I really don't see the upside to the extra complexity. All these options are great but if it makes it too difficult to use CSLA for something basic like asp, that seems like a problem to me. CSLA was always more work but at one point, I believed it was worth it. I haven't given up on it yet but I am pretty discouraged so far. Hopefully, someone can help me with an example that works.

Mike

Hi Mike,

Interesting point of view that reminded me why I became interested on the code generation issue. At the time there were no "Using CSLA 4" ebooks. These ebooks provide comprehensive explanation of how to use CSLA. The 2005 and 2008 books were more about CSLA internals and Project Tracker was the major source of "how to" documentation.

Then CSLA 3.5.0 arrived bringing PropertyInfo - a new way of property handling. The code you had to write increased a lot in a way that seemed complex and error prone. Why do I have to write all this code? Snippets are a good  help but you need to have a good understanding  of CSLA concepts in order to put together a project that runs. What is the correct template for an EditableRoot? Is this method needed? Why is this method on the ProjectTracker and it's not on the stereotype template? Is my class going to fail if I don't include it?

A code generator can do it for you. A code generator "serves" you a full blown class ready to run, that can list and search the database, load and save objects and it can even declare business and authorization rules from your rule library. Looking at the generated classes you end up learning a lot about CSLA.

I think that there are two main areas you must master:

1) stereotypes - what is the use case of each stereotype

A good code generator (like the one I will promote at the end of this post) will validate stereotype relations and won't allow your EditableRoot object to be the child of any other object. So in fact you don't have to worry about stereotype relations.

2) how to write business rules and how to write authorization rules

CSLA provides some very common rules but you will always need to write your custom rules. There are 2 libraries of rules around

- CSLA samples RuleTutorial

- CslaGenFork rules library

If you can't find there the rule you need, at least you will find plenty of samples you can analyse (and copy).

If you have a good understanding of these two CSLA areas, with the help of a good code generator your class will need minimal hand coding, most of the time none at all.

You can see how CslaGenFork generated code "tastes" like on the Csla sample ActionExtenderSample you can find on source control for 4.3.x

svn://svn.lhotka.net/csla/core/branches/V4-3-x/Samples/NET/cs/ActionExtenderSample

 

Concernig samples in general and WebForms samples, I must say CSLA has a very complete set of samples. I understand Rocky has no time no maintain samples of some technologies, namely WebForms. CslaContrib is the place where those samples can live. If you port some WebForms samples like PTWeb to Csla 4.3.13 or 4.5.x I think Jonny will be glad to include them on CslaContrib web site.

BigPines2 replied on Tuesday, November 13, 2012

Tiago, thanks for your response. I have quite a bit of experience building CSLA classes including business rules and I have CodeSmith so I can gen the classes if I desire. However, I believe before I start genning classes, I need to understand how I want the classes to look. My main problem is all my CSLA experience is in v3.5.3 and prior versions for Windows Forms only. I really needed a good asp example which is apparently more rare than I anticipated it would be.

I understand the need for WCF examples but it is still extremely shocking to me that more people want Silverlight or MVC than asp. I understand these technologies are newer but are they really being used more? Really? Really???

Mike

Copyright (c) Marimer LLC