I'm new in Dot net after I cloned some project from GitHub, I try to run then got below error.
OS: Mac 10.12.6 (16G29)
Tool version: Visual stuido 2017
SDK: 2
/Volumes/Users/Administrator/Documents/My Web Sites/nopCommerce-develop
/nopCommerce-develop/src/Build/ClearPluginAssemblies.proj(5,5): Error MSB4174:
The task factory "CodeTaskFactory" could not be found in the assembly "/Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Micro
soft.Build.Tasks.v4.0.dll". (MSB4174) (Nop.Web)
As per the previous answer:
nopCommerce 4.0 has developed with .NET core, but still its targeting to .NET Framework 4.6 and not .NET Core. So you cannot run nopCommerce 4.0 to MAC or Linux.
Still if you would like to run it to cross platform, you can change the targeted framework to .NET Core and solve the errors may you face.
Related
I am writing a WinForms control for .NET 6. The target framework for this project is set as .NET 6.0. It turned out that when I compile the project in the latest VS 2022 (17.1.1) installed a couple of months ago, VS always writes references to the v6.0.2 of WinForms assemblies in the compiled DLL:
I can explain this because 6.0.2 is the latest version of the .NET 6.0 SDK installed on my pc, but why this does not happen for other referenced assemblies like System.Collections or System.Data.Common?
I want to specify the exact version for the WinForms assemblies in the compiled DLL as 6.0.0 to make it possible to launch the DLL with any .NET 6 runtime installed (6.0.1, 6.0.3, 6.1.0, and so on). I did not find a way to do this. I tried global.json and the RuntimeFrameworkVersion key in the csproj file (see also this question), but this did not help.
Is there a way to solve my problem?
I found a solution myself. The problem was in .NET SDK 6.0.2:
6.0.2 SDK update has broken WinForms apps
A solution that helped me was found here:
Issue building with Windows Desktop 6.0.2
All what I needed is to add the following setting to the csproj file:
<ItemGroup>
<FrameworkReference
Update="Microsoft.WindowsDesktop.App.WindowsForms"
TargetingPackVersion="6.0.0" />
</ItemGroup>
I try to create a new Xamarin.Forms project for Android and Windows Phone, but I'm getting stucked by two errors.
First of all, I have the following error:
DEP3321: To deploy this application, your deployment target should be running Windows Universal Runtime version 10.0.16299.0 or higher. You currently are running version 10.0.14393.0. Please update your OS, or change your deployment target to a device with the appropriate version.
I've found the solution for this error, on some forums people said that setting the TargetMinVersionPlatform to the current running version of Windows Universal Runtime and setting the TargetVersionPlatform to the expected one should resolve the error. Yes it's true, but now I'm receiving another error:
NU1201 Project App3 is not compatible with uap10.0.14393 (UAP,Version=v10.0.14393) / win10-x86. Project App3 supports: netstandard1.6 (.NETStandard,Version=v1.6)
and after I did some research I found that this problem is resolved by doing backwards all the workarounds that I've did for resolving the first problem.
So, in conclusion I'm being stucked between this two errors. Can anyone help me?
Thank you!
As the .NET Standard document, netstandard 2.0 can be used on UWP version 10.0.16299. It can not be used on UWP version 14393, so you can not change your app target min version to 14393. Currently, Windows phone version is 15254 and you can not run the .net standard 2.0 on windows phone. So the solution would be like # magicandre1981 said on his thread Xamarin.Forms UWP project wont install on windows 10 mobile
Besides, you can also try to create your Xamarin app target version 14393 on the VS 2015 directly.
After I found NopCommerces on open source projects I'm trying to debug and run this projects on MAC machine and got below error.
I'm using MACOS Sierra version 10.12.5 with Microsoft Visual Studio 2017, Mono version 5.0.1.
However, I'm trying to search some tutorial they said We could not run NopCommerces on MAC osx so I want to verify here it is true or not.
I'm not sure with using mono!
But the last official release of nopCommerce is 3.90, which is targeting .NET Framework 4.5.1. And if you want to run it on mac, definitely you cannot.
But now as nopCommerce team announced upcoming version with .NET Core, yes you will be able to run it on mac too!
You can try to clone your project from GitHub/nopCommerce.
Note: upcoming version is still under development, so you may face some error and issues.
Hope this helps!
Edit:
nopCommerce 4.0 has been released, but still its targeting to .NET Framework 4.6 and not .NET Core. So you cannot run nopCommerce 4.0 to MAC or Linux.
We made 4.1 run on MAC doing the following:
Edited the path below to (NopFileProvider line 438) to:
public virtual string MapPath(string path)
{
path = path.Replace("~/", string.Empty).TrimStart('/'); //.Replace('/', '\\');
return Path.Combine(BaseDirectory ?? string.Empty, path);
}
and in project src/Build/ClearPluginAssemblies.proj we removed the following:
<Exec Command='dotnet "$(MSBuildProjectDirectory)\ClearPluginAssemblies.dll" "OutputPath=$(OutputPath)|PluginPath=$(PluginPath)|SaveLocalesFolders=$(SaveLocalesFolders)"' />
I'm trying to understand why I'm getting the following errors when running tests in Xamarin Studio 5.9.1 (build 3) on OS X.
System.IO.FileNotFoundException : Could not load file or assembly 'System.Net.Http, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
System.TypeLoadException : A type load exception has occurred.
All projects build successfully and the same tests run just fine in Visual Studio on Windows using the same solution.
I am seeing a warning when building the test project on OS X, despite having already installed and added the reference.
All projects referencing MyProject.fsproj must install nuget package Microsoft.Bcl.Build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317569.
I still don't know why Xamarin behaves differently than Visual Studio, but the root cause was that the test project was targeting .Net 4.5 whereas the main project was targeting .Net 4.0
Thanks to #7sharp9 for the help.
Different platforms (Android, iOS, Desktop) have different System.Net.Http.dll binaries - compiled from the same source, but each version references the mscorlib.dll (and other base-class libraries) from the platform it was built against.
This is not a problem when you use it in an application - Xamarin Studio will automatically pick the right version for you - but you can't use it in a Portable Class Library.
Microsoft initially implemented HttpClient as part of .NET 4.5, but then released a portable version of it (with a Windows-only license). If I understand this correctly, then that's mostly the same API as in .NET 4.5 plus a few minor additions (I think they added gzip compression, which Mono's version currently doesn't).
For Xamarin / Mono, all we need to do to create an open-source version of this library is to take our existing sources and compile them against the portable profile. I haven't tried this yet, but this could be as easy as editing the .csproj file and replacing the .
Also would suggest that you install HttpClient NuGet package
System.Net.Http.HttpClient is available directly from the latest version of Xamarin.
Simply check for updates from Xamarin Studio ;-)
I am trying to build Moonlight application using MonoDevelop 2.8 and Mono 2.10.5 on Mac OS X but it fails to compile:
Error: Framework 'Moonlight / Silverlight 3.0' not installed. (MoonlightTest)
The Moonlight addin on Mac is somewhat limited. It uses Silverlight to run the apps, since there is no Moonlight plugin for Mac has been released, but it uses the Moonlight SDK assemblies to compile, since the Silverlight SDK assemblies cannot be redistributed. Unfortunately the only SDK package released for Moonlight was 2.0 - Moonlight skipped 3.0 and assemblies for 4.0 exist but were never released as an SDK.