I need to specify a connectionstring that also has a reference to Effort in order to run tests with it.
files. The connectionstring currently has the following appearance:
<add name="SQLAzureConnection" connectionString= "metadata=res://*/Model.projectContext.csdl| res://*/Model.projectContext.ssdl|res://*/Model.projectContext.msl; provider=System.Data.SqlClient; provider connection string="Data Source=(LocalDb)\v11.0;Initial Catalog=Database_Nieuw;Integrated Security=false;MultipleActiveResultSets=False"" providerName="System.Data.EntityClient" />
I'm not sure what should be, but parts of it are incorrect.
On a test that utilizes this connectionstring to create a dummy database connection with Effort, I see the following error when I use it.
Test: failed Result Message: Initialization method project.Tests.Controllers.ShoppingCartTest.Initialize threw exception. System.InvalidOperationException: System.InvalidOperationException: Resource res://* /Model.seashell_brawl_corveeContext.csdl not found..
I'm not sure where I can locate this.
I just know it's necessary for the file. I can't make them from scratch
I have a code-first database, and right-clicking in the designer does not provide the option to open a file, therefore
Update database from model
like Yet another query suggested in his response. Moreover, I set the "Embed in Output Assembly" is the option for "Metadata Artifact Processing.".
Can somebody tell me where I can locate these files and how to properly reference them?
Okay, it is now crystal evident to me that the files are missing from coding first projects. The connection string appears to be working now after utilizing user20's tip, which is listed below in the comments. Here is a fresh problem:
`Test Outcome: Failed error 0040: The Type date is not qualified with a namespace or alias. Only primitive types can be used without qualification.`
Very odd, given that I use
everywhere. Does anyone have a solution for this?
As user3038092 pointed out
When using Code First you do not have a .csdl, .ssdl and .msl. The connection string differs also. Basically the correct connection string is what is described as "provider connection string" within your current connection string
It fixes the issue.