Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal #7481

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Oct 21, 2022

Context: dotnet/runtime#68610

In .NET 8, a test using SpecialFolder.Personal failed with:

   [FAIL] Create table attempt failed!
   SQLite.SQLiteException: Could not open database file: /data/user/0/com.xamarin.customlinkdescriptionpreserve/files/Documents/TaskDB.db3 (CannotOpen)
      at SQLite.SQLiteConnection..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionWithLock..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionPool.Entry..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionPool.GetConnectionAndTransactionLock(SQLiteConnectionString , Object& )
      at SQLite.SQLiteConnectionPool.GetConnection(SQLiteConnectionString )
      at SQLite.SQLiteAsyncConnection.GetConnection()
      at SQLite.SQLiteAsyncConnection.<>c__DisplayClass33_0`1[[SQLite.CreateTableResult, SQLite-net, Version=1.7.335.0, Culture=neutral, PublicKeyToken=null]].<WriteAsync>b__0()
      at System.Threading.Tasks.Task`1[[SQLite.CreateTableResult, SQLite-net, Version=1.7.335.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
      at System.Threading.Tasks.Task.<>c.<.cctor>b__273_0(Object )
      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
   --- End of stack trace from previous location ---
      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
      at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
   --- End of stack trace from previous location ---
      at LinkTestLib.Bug35195.AttemptCreateTable()
   All regression tests completed.

In .NET 8+, we should use SpecialFolder.UserProfile instead.

Context: dotnet/runtime#68610

In .NET 8, a test using `SpecialFolder.Personal` failed with:

   [FAIL] Create table attempt failed!
   SQLite.SQLiteException: Could not open database file: /data/user/0/com.xamarin.customlinkdescriptionpreserve/files/Documents/TaskDB.db3 (CannotOpen)
      at SQLite.SQLiteConnection..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionWithLock..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionPool.Entry..ctor(SQLiteConnectionString )
      at SQLite.SQLiteConnectionPool.GetConnectionAndTransactionLock(SQLiteConnectionString , Object& )
      at SQLite.SQLiteConnectionPool.GetConnection(SQLiteConnectionString )
      at SQLite.SQLiteAsyncConnection.GetConnection()
      at SQLite.SQLiteAsyncConnection.<>c__DisplayClass33_0`1[[SQLite.CreateTableResult, SQLite-net, Version=1.7.335.0, Culture=neutral, PublicKeyToken=null]].<WriteAsync>b__0()
      at System.Threading.Tasks.Task`1[[SQLite.CreateTableResult, SQLite-net, Version=1.7.335.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
      at System.Threading.Tasks.Task.<>c.<.cctor>b__273_0(Object )
      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
   --- End of stack trace from previous location ---
      at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
      at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
   --- End of stack trace from previous location ---
      at LinkTestLib.Bug35195.AttemptCreateTable()
   All regression tests completed.

In .NET 8+, we should use `SpecialFolder.UserProfile` instead.
@jonpryor
Copy link
Member

Related: dotnet/android-tools@0be567a

@jonathanpeppers
Copy link
Member Author

One classic test failed on provisionator, but we can probably ignore?

@jonathanpeppers jonathanpeppers merged commit ab6712a into dotnet:main Oct 24, 2022
@jonathanpeppers jonathanpeppers deleted the SpecialFolder.Personal branch October 24, 2022 21:18
grendello added a commit to grendello/xamarin-android that referenced this pull request Oct 26, 2022
* main:
  Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal (dotnet#7481)
  [dependabot] Fix automatic submodule updates (dotnet#7482)
grendello added a commit to grendello/xamarin-android that referenced this pull request Oct 26, 2022
* main:
  Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal (dotnet#7481)
  [dependabot] Fix automatic submodule updates (dotnet#7482)
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants