CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

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

rated by 0 users
Answered (Not Verified) This post has 0 verified answers | 38 Replies | 3 Followers

Top 500 Contributor
18 Posts
gullu posted on Mon, Aug 6 2012 12:06 PM

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. ..

All Replies

Top 10 Contributor
9,269 Posts

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).

Rocky

Top 500 Contributor
18 Posts
gullu replied on Mon, Aug 6 2012 12:28 PM

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

Top 500 Contributor
18 Posts
gullu replied on Tue, Aug 7 2012 4:02 PM

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

Top 10 Contributor
1,764 Posts
Suggested by JonnyBee

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.

Jonny Bekkum, Norway CslaContrib Coordinator

Top 500 Contributor
18 Posts
gullu replied on Wed, Aug 8 2012 8:05 AM

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..:-)

Top 500 Contributor
18 Posts
gullu replied on Wed, Aug 8 2012 9:18 AM

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:

Top 10 Contributor
1,764 Posts
Suggested by JonnyBee

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

Jonny Bekkum, Norway CslaContrib Coordinator

Top 500 Contributor
18 Posts
gullu replied on Thu, Aug 9 2012 4:34 PM

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:

Top 10 Contributor
1,764 Posts

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.

Jonny Bekkum, Norway CslaContrib Coordinator

Top 500 Contributor
18 Posts
gullu replied on Fri, Aug 10 2012 8:41 AM

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

Top 500 Contributor
18 Posts
gullu replied on Fri, Aug 10 2012 8:53 AM

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:

Top 10 Contributor
1,764 Posts
JonnyBee replied on Fri, Aug 10 2012 10:01 AM

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.

Jonny Bekkum, Norway CslaContrib Coordinator

Top 500 Contributor
18 Posts
gullu replied on Fri, Aug 10 2012 10:57 AM

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

Top 10 Contributor
1,764 Posts
JonnyBee replied on Fri, Aug 10 2012 11:00 AM

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

Jonny Bekkum, Norway CslaContrib Coordinator

Page 1 of 3 (39 items) 1 2 3 Next > | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems