This project has moved. For the latest updates, please go here.

New to MVC and TicketDesk

Mar 12, 2013 at 7:01 PM
I've previously built a WebApi using MVC but I had quite a bit of help from Google and ASP.NET forums.

I've been trying to get TicketDesk 2.1 setup for about 2 hours now with no success. I've tried just copying the compiled application straight over to my IIS 7 box and converting it to an application with .NET 4.0 and integrated pool.

Can anyone help me with this?
Coordinator
Mar 12, 2013 at 9:25 PM
Can you tell us a little about the specific issues or errors you are having?

The pre-compiled version should run on most IIS 7 instances without any modification as long as the server also has SQL Express (2008 R2 or earlier). If you are using the latest download from codeplex, you should update your server to the .Net framework 4.5 as well.

SQL Express 2012 no longer supports file-attached databases, so if you are using SQL 2012, you will need to update the web.config to use your SQL 2012 localdb instance, or manually attach the database file to the SQL Express 2012 instance and ensure the connection strings are valid for your instance.
Mar 12, 2013 at 9:27 PM
Edited Mar 12, 2013 at 9:38 PM
I had used the included .sql files to make use of my 2005 SQL db box. I ran all three files and then checked the database and I can see all the data there like it is in the .mdb file.

I setup the connection strings to connect to my db box but no luck.

```

Server Error in '/TicketDesk' Application.

The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

Resulting in: An exception occurred while trying to create an instance of type 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.

Resulting in: Cannot activate part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' from part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot set import 'TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' on part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService")' from part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

Resulting in: An exception occurred while trying to create an instance of type 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.

Resulting in: Cannot activate part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' from part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot set import 'TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' on part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService")' from part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")


Source Error:




An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:





[CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

Resulting in: An exception occurred while trying to create an instance of type 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.

Resulting in: Cannot activate part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' from part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot set import 'TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' on part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService")' from part 'TicketDesk.Domain.Services.ApplicationSettingsService'.
Element: TicketDesk.Domain.Services.ApplicationSettingsService (ContractName="TicketDesk.Domain.Services.IApplicationSettingsService") --> TicketDesk.Domain.Services.ApplicationSettingsService --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")
]
System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition) +499491
System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(CatalogPart part, ExportDefinition export, Boolean isSharedPart) +119
System.ComponentModel.Composition.ExportServices.GetCastedExportedValue(Export export) +169
System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore(String contractName, ImportCardinality cardinality) +175
TicketDesk.Web.Client.MvcApplication.Application_Start() +54

[HttpException (0x80004005): The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

Resulting in: An exception occurred while trying to create an instance of type 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.

Resulting in: Cannot activate part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot get export 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository")' from part 'TicketDesk.Domain.Repositories.ApplicationSettingsRepository'.
Element: TicketDesk.Domain.Repositories.ApplicationSettingsRepository (ContractName="TicketDesk.Domain.Repositories.IApplicationSettingsRepository") --> TicketDesk.Domain.Repositories.ApplicationSettingsRepository --> DirectoryCatalog (Path="D:\Web\Secure\TicketDesk\bin")

Resulting in: Cannot set import 'TicketDesk.Domain.Services.ApplicationSettingsService..ctor (Parameter="settingsRepository", ContractName="
Coordinator
Mar 15, 2013 at 10:22 PM
The message is pretty clear. The connection string the application is looking for in web.config is either incorrect, or malformed. Check the form against the SqlWeb.config file (which is pretty much a copy of the stock web.config with default settings). Make sure it has the right connection name (case sensitive), and that the connection string works.
Mar 18, 2013 at 3:35 PM
My SQL server required authentication and I noticed that they SQLweb.config doesn't have anything in it for db authentication. Can I use it? Can I also use AD for login with this config?
Coordinator
Mar 18, 2013 at 6:03 PM
You can connect to any SQL server, with any options you need. You just have to craft the right connection string. The full documentation for the connection string syntax can be found on MSDN here. For AD, you use the "trusted_connection" or "integrated security" switches. For SQL logins, use the user and password switches. There are a bunch of examples of the most common connection patterns here.
Mar 18, 2013 at 6:52 PM
Okay, so I have my ConnectionString's setup just like all my other applications are. They are all on the same web server and they all connect back to the same db. I have a certain db account that is userd on two other apps that I'm using in this one to access the same db. The app still will not connect though.

Server Error in '/TicketDesk' Application.
--------------------------------------------------------------------------------


 Login failed for user 'ADMIN\Web$'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'ADMIN\Web$'.

Source Error: 




An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 





[SqlException (0x80131904): Login failed for user 'ADMIN\Web$'.]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +6675286
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +688
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4403
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +84
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +55
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover) +368
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout) +6703926
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance) +6704427
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions) +610
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) +727
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) +74
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionOptions userOptions) +6706995
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionOptions userOptions) +78
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) +2192
   System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +116
   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) +1012
   System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6711619
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +152
   System.Data.SqlClient.SqlConnection.Open() +229
   System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +102

[EntityException: The underlying provider failed on Open.]
   System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +11440935
   System.Data.EntityClient.EntityConnection.Open() +142
   System.Data.Objects.ObjectContext.EnsureConnection() +97
   System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +66
   System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +51
   System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source, Func`2 predicate) +108
   TicketDesk.Domain.Services.ApplicationSettingsService.GetSettingValue(String settingName) +176
   TicketDesk.Domain.Services.ApplicationSettingsService.get_HideHomePage() +22
   TicketDesk.Web.Client.MvcApplication.Application_Start() +160

[HttpException (0x80004005): The underlying provider failed on Open.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): The underlying provider failed on Open.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12722601
 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929 
Mar 18, 2013 at 7:21 PM
Nevermind, I have it working now. Thank you thank you thank you for all of your help.