Closed LittleCornerDev closed 4 years ago
Having not used Xamarin myself, I just want to make sure -- this is essentially a project that targets classic .net Framework-style Mono, right?
The scenario of dotnet test
against such a project isn't one I've even considered before today. Indeed, this sort of build error -- asking for a framework targeting pack -- is why I still use classic-style projects for builds of the Framework/Mono version on Linux CI, rather than using multi-target modern-style with dotnet build
throughout.
For the moment, the supported approach for such a project would be to explicitly instrument the code and and run the tests.
Thank you. What you have mentioned about "multi-target" as well as other dependency reference errors I was having with my nUnit test project has led me to switching my nUnit project to one using .NET Core.
Dependency packages are now maintained via PackageReference in *.csproj
instead of via packages.config
, and dotnet test
is executing successfully now that it is no longer looking for frameworks.
For future reference of anyone else who comes across this... In Visual Studio Mac, I changed nUnit project from:
to:
I'll take that as having been successfully resolved, then.
FYI -- if .NETFramework,Version=v4.7
had been what you were meaning, I've discovered that there's a very useful NuGet package containing the necessary reference assemblies for that -- and for various other .net versions -- that would allow such a thing to happen.
I am attempting to use altcover for a Xamarin.Forms project edited via VisualStudio on Mac.
When running
dotnet test /p:AltCover=true
, I keep getting an error about missing .NETFramework references and a prompt to download.error MSB3644: The reference assemblies for .NETFramework,Version=v4.7 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
As the downloads are executables for Windows and not Mac, and since VisualStudio Mac uses Mono and .Net Core, I have found various references similar to this one about importing
netfx.props
to set paths accordingly.With debug messages, I see that I have:
I did an
ls -la
and verified that/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.7-api
exists and has content.However, I still get the same MSB3644 error about missing .NETFramework references. As I am new to all these technologies, any thoughts/advice/help would be appreciated!