Code Monkey home page Code Monkey logo

Comments (5)

georghinkel avatar georghinkel commented on August 27, 2024

Hi,

yes, from version 2.0, NMF only supports .NET Standard 2.0 in order to avoid cross-compilation and thus simplify the code. However, .NET 4.6.1 with Visual Studio 2015 should be supported (according to https://github.com/dotnet/cli/issues/6739), but you might have to install the .NET Core 2.0 SDK.

If this absolutely does not work, I can restore the old project files and perform a cross-compilation to .NET Standard 2.0 and .NET Framework 4.0/4.5.

Best,

Georg

from nmf.

Herbie60D avatar Herbie60D commented on August 27, 2024

Hello Georg.
Thank you for the fast reply. Simply installing the .NET Core 2.0 SDK did not fixed the problem, but was the first step.

I installed the SDK, but got no other result than before.
https://www.microsoft.com/net/download/windows

Then I found the announcement dotnet/announcements#24. It states that at least Nuget 3.6 is needed in Visual Studio 2015 to reference a .Net Standard 2.0 library.
https://www.nuget.org/downloads

Now I got another error message:

To reference a library that targets .NET Standard 1.5 or higher, you need to install the .NET Standard Build Support extension for the .NET Framework https://aka.ms/netstandard-build-support-netfx

I installed the .NET Standard Build Support extension from the link above and got a lot of the following errors.

error CS1703: Multiple assemblies with equivalent identity have been imported: 'C:\Program Files (x86)\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\ref\System.Xml.XmlSerializer.dll' and 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6.1\Facades\System.Xml.XmlSerializer.dll'. Remove one of the duplicate references.

For this I found the open issue dotnet/sdk#1539
As workaround it is suggested to set <ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades> in first PropertyGroup element of the project file.
I did this an now my project and also a newly created test project compiled.

But now I got a warning for each project that uses NMF-Basics 2.0.*

Warning The referenced component 'System.Net.Http' could not be found.

To solve this I found a workaround in the issue dotnet/sdk#1499 (comment).
I added the suggested lines to the end of my project file and the warning disappeared.
The second solution would be to delete the reference to 'System.Net.Http' from all projects.

Now I get the warning

warning MSB3061: Unable to delete file "[path removed]System.Net.Http.dll". Access to the path '[path removed]\bin\Debug\System.Net.Http.dll' is denied.
Visual Studio seems to block the file by itself, wehn I open the project.

This is the current status of my research how to use a .NET Standard 2.0 assembly from a Visual Studio 2015 project. Maybe this helps someone. I hope Microsoft fixes those issues. For now I will stay with NMF-Basics 1.0.99 and will change the version only when needed.

from nmf.

georghinkel avatar georghinkel commented on August 27, 2024

Oh, that looks like a lot of mess, indeed. I did not know it was that difficult to use .NET Standard with Visual Studio 2015 (I am using VS 2017 for quite some time now).

from nmf.

georghinkel avatar georghinkel commented on August 27, 2024

This should be fixed now as the latest version has support for .NET 4.5 for most runtime libraries

from nmf.

Herbie60D avatar Herbie60D commented on August 27, 2024

Thank you! This helps us as long as we have not switched to Visual Studio 2017 in our company.

from nmf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.