Supporting Carthage for framework with dependency? - carthage

I want make my framework supporting Carthage. A cocoa framework project have been create.
The problem is my framework depends another framework (carthage supported). If I don't add the framework file to the project, how do pass building.

Related

Outlook Interop in .NET Core 3.0?

I migrated our project from .NET Framework to .NET Core 3.0 (C#, WPF) and now I can not use Microsoft.Office.Interop.Outlook anymore, because it is not compatible with .NET Core 3.0. What I want to achieve is opening/sending prefilled Outlook Emails.
Is there an alternative to this interop dll, or maybe a way to use .NET Framework for only this reference?
Microsoft.Office.Interop.Outlook
NetOffice.Outlook
This worked for me:
Right click Dependencies and click "Add Reference"
Select Microsoft Outlook 16.0 Object Library under the COM tab.
Under Dependencies/COM in your project, select Interop.Microsoft.Office.Interop.Outlook reference, then under "Properties" set "Embed Interop Types" to "Yes"
I also had to uninstall the Microsoft.Office.Interop.Outlook NuGet package because it caused a conflict with the reference in Dependencies/COM.
Outlook automation is now working fine.
I am having the same issue when trying to use Microsoft.Office.Interop.Excel 15.0.4795.1000. It won't run when I target .net core 3.00 preview 7.
At this stage I do not think there is any other option than reverting back to .NEW Core 2.2.
I had the same problem while migrating components with Office interop for Excel and Outlook to .NET Core 3.0. I found out that this is only a problem of the Nuget packages Microsoft.Office.Interop.Outlook and Microsoft.Office.Interop.Excel. The packages probably need an update to work with 3.0?
If I make direct references to the Interop assemblies all is working well. Here is a link to an example for this.
If you use Visual Studio, you need an additional workaround to achieve this. From the linked sample:
Adding COM references to .NET Core projects from Visual Studio is not
currently supported. The workaround is to create a .NET Framework
project, add the COM references, and then copy the relevant
COMReference elements in the project.
This is possible in a roundabout way. Here is how:
Create a temporary .NET framework project.
Add the references to COM components (Microsoft.Outlook.Interop).
Open that csproj file and copy the entire those components are located in, over to your .NET Core project.
The nuget packages seem to be incompatible at the moment.
Reference: DotNet Samples

How to add EF CLass Library to solution that will work with .net 4.5 and dotnet core

I currently have a webforms website using .net 4.5.
I would like to add a class library with entity framewrok.
I want to make sure that this class library works with dotnet core and my existing webforms project.
With all the versions of .net, it is very confusing.
From what I gathered, dotnet standard maybe used as the middle ware for this type a situation. But I'm not sure this is true.
Any suggestions?
Yes, you'll have to use the .NET Standard and Entity Framework Core. .NET Framework will be able to interface with the .NET Standard
I would start up with https://www.youtube.com/watch?v=ECNLyvxLnuQ
There's not a lot of docs on standard, but this will give you some conceptual understanding
Notice that "ASP.NET vs ASP.NET Core" and "Entity Framework vs Entity Framework Core" are completely different frameworks, even though which were named similarly.
ASP.NET and Entity Framework targets .NET Framework which means they can only work on .NET Framework.
ASP.NET Core and Entity Framework Core targets .NET Standard which means they can work on both .NET Framework and .NET Core.
WebForms bases on ASP.NET, and there is no (and not planned) migration for it on ASP.NET Core, so the old WebForms projects will never be able to work on .NET Core.
It is a great quantity of the task migrating from ASP.NET MVC to ASP.NET Core MVC, and WebForms is even impossible.
If you really need to run your project on .NET Core, there will be a complete refactoring of your whole project:
Refactoring your WebForms project to ASP.NET Core MVC (Completely redevelop the whole project)
Refactoring your Entity Framework data definitions to Entity Framework Core (It only supports code-first and database-first, there is no model-first any more)
Make sure that all referenced .NET libraries target .NET Standard or .NET Core and reference them on nuget. If not, re-target an alternative.
If your project is planned to be hosted on Linux server and referenced some native libraries, you have to get the equivalent .so libraries instead of .dll libraries.

.NET Core project add reference to .NET Framework project. Why it's possible?

I have followings projects:
.NET Core 2.0 Web Application
.NET Standard 2.0 Class library &
.NET Framework 4.5 Class Library.
I add reference of .net framework class library to asp.net core web api project. and it seems it works very well.
I am wondering why it's possible to add reference of .NET Framework class library project to ASP.NET Core Web API or MVC?
It's not supposed to allow adding only Standard or Core libraries references to Core projects?
Is this core Web project with .NET Framework class libraries references still cross platform?
UPDATE
According to Phiter comment:
"If you import a .net framework library to your project it'll no longer be cross platform, but you can do it freely if you want to. They allow it because you might want to use .net core and still be on windows."
So if this is a reason, if I want to bind my project to .NET Framework and remain on windows why I use Core Web Project from the first place?
I thought we use core projects for cross platform ability and if not, the .Net framework is not a better option?
UPDATE
mason comment:
"Nothing funny: ASP.NET Core project doesn't have to run on .NET Core. It can also be run on .NET Framework.
Just because it's called 'Core' doesn't mean they're related. They could have called it ASP.NET FancyPants and had it run on .NET Core and .NET Framework and you wouldn't be as confused. Microsoft just sucks at naming things."
UPDATE (November 12, 2018)
A first look at changes coming in ASP.NET Core 3.0 - Fully leveraging .NET Core
As announced on the .NET Blog earlier this month, .NET Framework will get fewer of the newer platform and language features that come to .NET Core moving forward, due to the in-place update nature of .NET Framework and the desire to limit changes there that might break existing applications. To ensure ASP.NET Core can fully leverage the improvements coming to .NET Core moving forward, ASP.NET Core will only run on .NET Core starting from 3.0. Moving forward, you can simply think of ASP.NET Core as being part of .NET Core.
Customers utilizing ASP.NET Core on .NET Framework today can continue to do so in a fully supported fashion using the 2.1 LTS release. Support and servicing for 2.1 will continue until at least August 21, 2021 (3 years after its declaration as an LTS release) in accordance with the .NET Core support policy.
This was just added as part of .NET Standard/Core 2.0. As long as the .NET Framework dll only references things in the .NET Standard, it will use type forwarding to the .NET Core implementations.
I do not know what made Microsoft allow referencing .net framework class library into .net core project but as a programmer, I am happy with this allowance.
You see allowing .net core application to reference .net framework libraries is useful in case you want to start with windows and are planning to go cross platform in the future.
We are in a stage where many useful open source libraries do not fully support .net core till the date of this post, masstransit is an example, so when I am developing a new software I will be using .net core project that depends on such libraries and I will update them later when they support .net core.

Why mix .Net Standard and .Net Core projects in one solution?

I just started working through the Apress "Building Web Applications with Visual Studio 2017". I am at the beginning setting up the projects.
So I set up a solution called SpyStore.
Then a .Net Core console app called SpyStore.DAL.
Then a .Net Standard Class Library project called SpyStore.Models.
My question is why would the author choose .Net Standard class library over .Net Core Class library. Is there a difference?
What is the difference between .Net Standard and .Net Core.
And could there be a reason for him mixing Standard in all of the sudden?
You can visualize .netstandard as a set of APIs. It is implemented by multiple runtimes, like netframework (net461, net47 monikers for example) or netcore (netcoreapp) A lib is not an executable, so it is independent from the concrete implementation.
Because you may want to use your library in a .net framework project (or any other implementation of .net standard), targeting netstandard make sure it is fully portable to any of these implementation, where a netcoreapp lib would only be targetable from a netcoreapp project.
An app can only be netcoreapp or netcore, as it is dependent of the implementation of the framework
You can find more infos here, and which platform implements which version of netstandard:
https://learn.microsoft.com/dotnet/standard/net-standard

Class library that can be shared between .NET Framework and .NET Core

I have a big class library written in .NET 4.0 but when I reference it in a Store App that uses .NET Core, it shows an error. And further, Microsoft just released .NET Core for the next version of .NET.
I want to know what type of project will be able to be shared by both .NET 4.6 and .NET Core? Is a class library able to do that?
It seems that the release of .NET Core specialized for Store Apps causes confusion for me.
If you have a PCL (Portable Class Library) that works for Metro apps, it will definitely run on the fully fledged .NET (aka, your normal ASP.NET, WF, WPF applications).
That means that you don't have to do anything, besides porting your existing library to be compatible with the PCL you choose.
There is a new target called dotnet which you can use to target the platforms DNX, UWP and .Net 4.6. Effectively, this libraries are build against .Net Core packaged libraries instead of the libraries of the full .Net Framework.
Read more here: https://oren.codes/2015/07/29/targeting-net-core/ and related posts.

Resources