Error running new project in visual studio (V13)
b
I am looking at using Umbraco for client projects (specifed by them) I followed the Visual studio install, ie instaklled the templates and started a new project I get the error: Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'umbracoOpenIddictApplications'.' Latest VS, .net8, Umbraco 13.0.3 I tried restarting VS, restoring the packages and also needed to update connection string in appsettings.devleopment.json as that was different? Looked at the forums, they selection only goes to V8, so assume this is the priimary go-to for help?
rebooted, deleted app and tried again: Errors when running: 1) Error connecting to SQL Server(local instance re SSL) SQL Server Connection string needs to have TrustServerCertificate=True;Encrypt=false 2) Error: missing media folder. Added media folder to wwwroot 3) Error: Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'umbracoOpenIddictApplications'.' Tables are created in the database?
m
Did you set up connection string?
b
Tables are created in the database?
m
yes
b
yes
Data Source=.;Initial Catalog=Test;Integrated Security=True;TrustServerCertificate=True;Encrypt=false
I would expect this to just work at a minimum?
m
which database is it?
tsql I assume?
"Server=.;Database=YOURUMBRACODBNAME;integrated security=true;TrustServerCertificate=True;Connection Timeout=360"
b
Its an SQL server database
m
this might what yours look like but depending on how your local sql was set up server value might need to be bit different
b
ok same format conn string does not work
The tables are created, so there is a connection?
m
seems like it
b
The migration would not have worked otherwise
VS is running as Admin
Same conection string format as other .net8 apps
used the latest Umbraco template
m
what's the error this time? cant be same since it obviously made some connection
b
Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'umbracoOpenIddictApplications'.'
this is the same error
o
I had an error setting up the project in VS. Then i tried deleting the connection string provider name (selected string in attached). Then choose the database type and enter credentials if needed inside Umbraco setup screen after running the project. https://cdn.discordapp.com/attachments/1194980222190235719/1194993689693524009/image.png?ex=65b25f99&is=659fea99&hm=5208149a16b1fee4f30412879a5192f259697753c02a6f58bb8af0dd6af9a3a2&
b
"umbracoDbDSN_ProviderName": "Microsoft.Data.SqlClient"
I can try that
I did try setup connection strings after and del;ete the database to redo the migration, that recreates the db but get the error
I just want to set this up and try Umbraco
the media folder was missing, does that mean other files are missing?
m
umbracoOpenIddictApplications is this name of the project?
b
The name of the site is BrighterToolsWebsite, The error message is Microsoft.Data.SqlClient.SqlException: 'Invalid object name 'umbracoOpenIddictApplications'.' https://cdn.discordapp.com/attachments/1194980222190235719/1194994825435545670/image.png?ex=65b260a8&is=659feba8&hm=0ac32f451dc783ab59822c5b58886156053e664e82d63ed01001dcbf09bd96b1&
j
Try to comment out that line - so the issue is it tries to write to a database table called umbracoOpenIddictApplications. This table and many others are probably added in a migration that runs on startup, but if the load order is wrong it may try to use it before the migration that adds it is run. If you remove that line, boot up the site and (assuming it can then run the migrations) then you can remove the comment and restart the site to start up properly now with the migrations having run
b
I will try, but this is a new setup, I would expect it to just work out the box?
The migrations do run, but if they were in the wrong order, I am ptrtty sure this would have been picked up before?
error indicates to add that back in
I tried not specifying the database connection string and provider, it doesnt prompt for anything and has the same error (not surprisingly)
j
Well the common problem is that stuff gets added on as you go, so if they had a complete database at the beginning and then added something later that interferes with the load order then it is potentially not a problem for them, but it is on a fresh install. But in this case I'd start looking at the log to see what may happen before this error is thrown on startup
b
Just to be clear, this is a Visual Studio Create New Empty Umbraco site, created as per the docs, as a new user, this must work? There is no previous database, if this is a common problem, my confidence in Umbraci is not very high right now..
ok, choosing database provider None, sets up SqlLite and the projects runs??? obviously
k
Late to the party, but I've recently only created an Umbraco project via the command-line tooling, not via the VS "new project" template GUI. Maybe the command-line tooling would work but not the other one.
b
If you choose no Sql Provider, it defaults to SqlLite, but you can change it, I had to create the database manually then it connected and am now logged in.. cant see how the migrations are different considering it must have ran some or most of them when specifying a connection string at the start? INitial experience is not great I must say.. at least I have something running.
The GUI/template option is provided, so assumed it would work, is the cli not running the same template? anyways.. I will cary on.. thanks all for the help
s
I ran it form VS with these settings and it worked fine. I've never used this VS template before, so I had to actually look up how to write a proper connection string, the pattern is:
server=(local)\SQLEXPRESS;database=myDatabase;user id=myUser;password='myPassword';TrustServerCertificate=true;
Of course you'd need to replace with the values for your own sql server instance. https://cdn.discordapp.com/attachments/1194980222190235719/1195030388171612230/image.png?ex=65b281c7&is=65a00cc7&hm=2dfc9a0e2bec6c2c34cd3ab5c4b25e1e5c7123e52b538822b9e84a1a38d0b020&
Note: I did choose "Change database" in the first step to not get SQLite.
481 Views