BreeceW / WinUIEdit

Code editor control for UWP and WinUI 3 based on Scintilla
Other
101 stars 6 forks source link

MicaEditor fails to compile when included in a different solution. #2

Open ERmilburn02 opened 6 months ago

ERmilburn02 commented 6 months ago

Problem

When attempting to include MicaEditor into a different solution, compilation fails because the project is hard-coded to expect the packages directory to always be at the same level as the MicaEditor directory.

Workaround

One simple solution to this, is to open the WinUIEditor solution and attempt to build MicaEditor inside there, although this isn't ideal for projects looking to include MicaEditor.

Solution

Editing the MicaEditor project file (MicaEditor.vcxproj) to swap out any references to ..\packages with $(SolutionDir)packages. This would then allow for the required packages to be successfully imported, no matter what solution MicaEditor is in.

Evidence

I have tested with a recreated copy of CsDemoWinUI3, as well as all the projects inside the WinUIEditor solution, and they all work.

BreeceW commented 3 months ago

Thanks for trying this out. I looked into why the default template references NuGet packages relatively, and it is because a different solution won’t necessarily have NuGet packages in $(SolutionDir)Packages.

Sorry I hadn’t responded to this earlier. Now there is a NuGet package available for preview, so you do not have to build the project yourself.

If you still want to consume from another solution, NuGet suggests restoring the packages in the library solution first.