How to get path to obj folder from type provider?
See original GitHub issueI 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:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
toFalse
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 toFalse
and it should work as beforeClosing as the TPSDK doesn’t have any specific functionality related to finding the ‘obj’ directory