.net-standard

Use a Content File from a .NET Standard assembly in a WPF application

删除回忆录丶 提交于 2021-02-05 07:43:37
问题 I want to embed a file in a .NET Standard assembly and use it in XAML in a WPF app. If you set the build action to Resource it is very easy to use the embedded file in other assemblies, but you have to use <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> and <UseWPF>true</UseWPF> to be able to use the Resource build action like so: <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <UseWPF>true</UseWPF> </PropertyGroup> <ItemGroup> <Resource Include="Resources\Image.png" /> <

Activator.GetObject for .netstandard

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-29 05:42:42
问题 everybody! I have a piece of code which calls win service remotely with Activator.GetObject(type, url) . But the project is targeting .net framework and we're going to migrate to .net standard. The later, though, does not provide such behavior. Is there a way to do the same action in .net standard? 来源: https://stackoverflow.com/questions/56150153/activator-getobject-for-netstandard

In EF Core, how to check whether a migration is needed or not?

|▌冷眼眸甩不掉的悲伤 提交于 2021-01-26 03:52:13
问题 I am using Entity Framework Core in an Xamarin.iOS application. In my core project that contains code (.netstandard 2.0) that is shared between the iOS application and other applications, I would like to know if a migration is needed so that I can perform some other operations as well. Here is the context: public void Initialize() { using (var dbContext = new MyDbContext(m_dbContextOptions)) { --> bool isNeeded = demoTapeDbContext.Database.IsMigrationNeeded() demoTapeDbContext.Database

System.Data.Linq in netstandard20

亡梦爱人 提交于 2020-12-25 03:42:06
问题 I have a netstandard20 project that references a .Net 4.6 Project, all compiles and runs except where I call any functionality in the .Net 4.6 project, I get the following error. FileNotFoundException: Could not load file or assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. In VS 2017, in the project explorer under Dependancies / SDK / Microsoft.NETCore.App I can see System.Data.dll and System.Data.Common

System.Data.Linq in netstandard20

孤人 提交于 2020-12-25 03:40:47
问题 I have a netstandard20 project that references a .Net 4.6 Project, all compiles and runs except where I call any functionality in the .Net 4.6 project, I get the following error. FileNotFoundException: Could not load file or assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified. In VS 2017, in the project explorer under Dependancies / SDK / Microsoft.NETCore.App I can see System.Data.dll and System.Data.Common

Can I debug a dependent assembly from a powershell module

こ雲淡風輕ζ 提交于 2020-12-13 07:19:57
问题 I have a project it has two (or more) projects. For example: Shared.Standard Utility.PoSH The second is a PowerShell binary module that depends on the Shared.Standard class library/project/assembly. Can I debug the Shared.Standard library while I execute commands from the compiled module in a PowerShell session? I'm particularly curious about required config in vscode. 来源: https://stackoverflow.com/questions/59445038/can-i-debug-a-dependent-assembly-from-a-powershell-module

Can I debug a dependent assembly from a powershell module

倖福魔咒の 提交于 2020-12-13 07:19:47
问题 I have a project it has two (or more) projects. For example: Shared.Standard Utility.PoSH The second is a PowerShell binary module that depends on the Shared.Standard class library/project/assembly. Can I debug the Shared.Standard library while I execute commands from the compiled module in a PowerShell session? I'm particularly curious about required config in vscode. 来源: https://stackoverflow.com/questions/59445038/can-i-debug-a-dependent-assembly-from-a-powershell-module

Razor email templates in .net standard 2.1 / Core 3.1

萝らか妹 提交于 2020-12-13 03:44:06
问题 I want to create a separate service for sending emails, this will be based on a .net core 3.1 application with its default layers (application, domain, contracts, infrastructure) Within this project, I want to create a create a class library which holds my Razor templates and parses them so the application layer can send this as an email (both HTML and non-html) after the model has been applied, however this is where i run into a problem. Every example i can find targets older .net core

Why is this NuGet dependency missing when compiling .NET Framework project depending on .NET Standard?

↘锁芯ラ 提交于 2020-12-02 18:56:59
问题 I have a Visual Studio solution, with 3 projects. The top level is a .NET Framework 4.6.1 Console App (Project A). It depends on a .NET Framework 4.6.1 Class Library (Project B). Project B depends on a .NET Standard 2.0 Class Library (Project C). I have some code in Project C that uses System.Data.SqlClient (NuGet package version 4.6.1). Due to the following known issue https://github.com/dotnet/sdk/issues/901 I have also added System.Data.SqlClient as a NuGet dependency to Project B (the

Why is this NuGet dependency missing when compiling .NET Framework project depending on .NET Standard?

筅森魡賤 提交于 2020-12-02 18:28:49
问题 I have a Visual Studio solution, with 3 projects. The top level is a .NET Framework 4.6.1 Console App (Project A). It depends on a .NET Framework 4.6.1 Class Library (Project B). Project B depends on a .NET Standard 2.0 Class Library (Project C). I have some code in Project C that uses System.Data.SqlClient (NuGet package version 4.6.1). Due to the following known issue https://github.com/dotnet/sdk/issues/901 I have also added System.Data.SqlClient as a NuGet dependency to Project B (the