question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get path to obj folder from type provider?

See original GitHub issue

I am interested in fix Xamarin.Android.FSharp.ResourceProvider for .Net 6.

Xamarin.Android uses code generation to access any resources (e.g. images, styles and other). It generates Resource.designer.cs file.

Xamarin.Android.FSharp.ResourceProvider compiles Resources.designer.cs file into assembly to give access to resources from F# code.

Since .Net 6 this file moved from ./Resources/Resource.designer.cs to ./obj/Debug/net6.0-android/Resource.designer.cs. I have no idea how to correctly new Resource.designer.cs path from type provider considering that path may be specified in IntermediateOutputPath variable.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dellis1972commented, Nov 19, 2021

We are hopefully going to change direction with regards to the Resource.designer.cs in Xamarin.Android. See https://github.com/xamarin/xamarin-android/pull/6427 and https://github.com/xamarin/xamarin-android/issues/6310.

We are hopeful that by generating a designer assembly (which is just IL ) this will remove the need for the Type Provider.

In the mean time for .net 6 you might be able to set AndroidUseIntermediateDesignerFile to False in your csproj. We turned this on by default for .net 6. But if you want the old behaviour and use ‘Resources/Resource.designer.cs’ you can set this property to False and it should work as before

<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidUseIntermediateDesignerFile>False</AndroidUseIntermediateDesignerFile>
0reactions
dsymecommented, Aug 23, 2022

Closing as the TPSDK doesn’t have any specific functionality related to finding the ‘obj’ directory

Read more comments on GitHub >

github_iconTop Results From Across the Web

VisualStudio: How to save the obj folder somewhere else
Use the BaseIntermediateOutputPath property in the project file ( .csproj , .vbproj , etc.) ...
Read more >
Get the Path to Your File in Visual Studio
One of the best things about Solution Explorer is that I can right-click on a Project, pick "Open Folder in File Explorer" and, ......
Read more >
How do I relocate bin and obj folders to same folder as sln?
The location of those folders can be changed in your .csproj or by adding a Directory.Build.Props alongside your .sln file. bin folder location ......
Read more >
C# relative, absolute path - Microsoft Q&A
I use relative path. ToXMLFile($@"..\..\Data\Orders\{CurrentOrderSerials.OrderId}.xml"); public static void ToXMLFile<T>(this T obj, ...
Read more >
Win32_Directory class - Win32 apps
A directory is a type of file that logically groups data files and provides path information for the grouped files. Example: C:\TEMP.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found