.net-standard

Target specific dependencies NuGet

白昼怎懂夜的黑 提交于 2019-12-02 09:06:31
问题 I have the following dependencies in my .nuspec file: <dependencies> <group> <dependency id="Dep1" version="2.4.11" /> <dependency id="Dep2" version="1.0.4" /> <dependency id="Dep3" version="1.0.4" /> <dependency id="Dep4" version="1.0.0" /> <dependency id="Dep5" version="1.0.4" /> <dependency id="Dep6" version="1.0.4" /> </group> </dependencies> I've created a local nuget server and I'm installing this NuGet package in a Xamarin Forms solution. The thing is that in the Android part of the

Log4Net on .Net Standard has no version for getting logger without repository

拟墨画扇 提交于 2019-12-02 04:28:42
问题 I am trying to move a project to .net standard and it basically is a class library. I am using log4net for logging and I was using the method public static ILog GetLogger(string name); As this is a library referenced by multiple projects, defining repository should not happen as each project referencing this one, defines it's own repository for logging. How can I circumvent this issue when it comes to porting to .Net standard? 回答1: The implementation of GetLogger is simple: public static ILog

Can't add Entity Framework Core migrations to .NET Standard 2.0 project

放肆的年华 提交于 2019-12-02 03:59:48
I've got a Solution with many projects. One of them ( Domain ) is a .NET Standard 2.0 project where I made my EF Core DbContext implementation for which I want to enable database migrations . I saw various blogs and Q/A forums where the problem was explained but none of the proposed solutions seem to work for me because of the .NET Core newer version or (probably) for my particular solution configuration. Solution projects Engine (.NET Core 2.1 Console App) Web API (.NET Core 2.1 Library) Application (.NET Core 2.1 Library) Domain (.NET Standard 2.0 Library) WindowsService (.NET Core 2.1

How can I use EnvDTE within a .NET Standard project

女生的网名这么多〃 提交于 2019-12-02 00:16:27
问题 I'm porting a .net 4.7 project to .net standard, which uses T4 to generate some code. I iterate over the classes, properties and methods. This use to work perfectly, but now the return types of DTE are of type 'System.__ComObject' and I cannot cast them. Error: Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE.CodeClass'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B1F42514-91CD-4D3A-8B25-A317D8032B24}'

Log4Net on .Net Standard has no version for getting logger without repository

旧时模样 提交于 2019-12-01 23:34:37
I am trying to move a project to .net standard and it basically is a class library. I am using log4net for logging and I was using the method public static ILog GetLogger(string name); As this is a library referenced by multiple projects, defining repository should not happen as each project referencing this one, defines it's own repository for logging. How can I circumvent this issue when it comes to porting to .Net standard? The implementation of GetLogger is simple: public static ILog GetLogger(string name) { return GetLogger(Assembly.GetCallingAssembly(), name); } Assuming you want to use

How can I use EnvDTE within a .NET Standard project

◇◆丶佛笑我妖孽 提交于 2019-12-01 22:34:57
I'm porting a .net 4.7 project to .net standard, which uses T4 to generate some code. I iterate over the classes, properties and methods. This use to work perfectly, but now the return types of DTE are of type 'System.__ComObject' and I cannot cast them. Error: Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE.CodeClass'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{B1F42514-91CD-4D3A-8B25-A317D8032B24}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E

How should I create a library targetting .NET Framework 4.5.1 and .NET Standard 1.3 in VS 2017 RC?

橙三吉。 提交于 2019-12-01 21:31:59
This is my first time trying anything that targets more than just a .NET Framework. I can't seem to do it from the GUI. I've tried project type 'Class Library (Portable)' and project type 'Class Library (.NET Standard)'. I can change a 'Class Library (Portable)' to target .NET Standard but then I can't select anything else. I'm not sure if I should try to change the .csproj of 'Class Library (.NET Standard)' or the project.json of 'Class Library (Portable)', I just want whatever is most future-proof. As of a few days ago the .csproj has been simplified and ease of use has improved. With the

Make a .NET Standard library COM-Visible?

只谈情不闲聊 提交于 2019-12-01 17:29:24
问题 For a full .NET project you can tick a box to make the project COM Visible in Project Properties > Application tab > Assembly Information.. : However, the Assembly Information.. button doesn't exist for .NET Standard projects, instead that data is entered on the Project Properties > Package tab , but that tab doesn't have a checkbox for Make Assembly COM-Visible : Can you still make .NET Standard libraries COM Visible by some other method, or does it not make sense to do that for some reason?

Are there any formalized target framework directives?

拈花ヽ惹草 提交于 2019-12-01 10:55:44
问题 I've read Microsoft's article about how to detect target framework, for example : netcoreapp2.2 net47 net58 But there are situations where I don't care about the exact version, but the general framework target : NETCORE .Net Framework But I didn't find such flags. Question: Are there any generalized flags for that ? or better, how can I distinguish between those two without specifying all options? 回答1: Besides the version-specific directives such as NETSTANDARD2_0 , the Target frameworks

Can't add Entity Framework Core migrations to .NET Standard 2.0 project

☆樱花仙子☆ 提交于 2019-12-01 10:16:02
问题 I've got a Solution with many projects. One of them ( Domain ) is a .NET Standard 2.0 project where I made my EF Core DbContext implementation for which I want to enable database migrations . I saw various blogs and Q/A forums where the problem was explained but none of the proposed solutions seem to work for me because of the .NET Core newer version or (probably) for my particular solution configuration. Solution projects Engine (.NET Core 2.1 Console App) Web API (.NET Core 2.1 Library)