All Questions
534
questions
86
votes
4
answers
77k
views
Can WPF applications be run in Linux or Mac with .Net Core 3?
Microsoft announced .NET Core 3 comes with WPF and Windows Forms. So can I create a desktop application for Linux or Mac using .NET Core 3?
41
votes
3
answers
20k
views
How to reference System.Windows.Forms in .NET Core 3.0 for WPF apps?
I'm migrating my WPF desktop app from .NET Framework to Core 3.0.
I was using System.Windows.Forms.FolderBrowserDialog() and I'm now stuck on how to add this reference to the Core project. There is no ...
33
votes
2
answers
15k
views
WithUrl() not found in Core 3 client
My .NET SignalR client code not working any more in Core 3 (WPF):
string hubAddress = "https://localhost:44329/Hub";
HubConnection hub = new HubConnectionBuilder().WithUrl(hubAddress).Build(); // ...
20
votes
5
answers
21k
views
Dependency Injection in .NET Core 3.0 for WPF
I’m quite familiar with ASP.NET Core and the support for dependency injection out of the box. Controllers can require dependencies by adding a parameter in their constructor. How can dependencies be ...
19
votes
2
answers
12k
views
NETSDK1135 SupportedOSPlatformVersion 10.0.19041.0 cannot be higher than TargetPlatformVersion 7.0
I am trying to convert a .NET Framework WPF app to .NET 5
I ran https://github.com/dotnet/try-convert, and removed some incompatible DLL refs.
Now, when I try to compile, I am presented with
...
13
votes
2
answers
13k
views
Porting a Prism-based WPF application to .NET Core
We have a Prism-based WPF application with over 10 man years of development invested in it.
We are moving big chunks of it into web browser control hosted modules to make it platform independent in ...
13
votes
2
answers
3k
views
.Net 5 - WPF, unit test woes
I'm having some issues while playing around with .Net 5, so I'm hoping someone could shed some light on things. Having worked on a large enterprise .Net Framework solution for a number of years, .Net ...
12
votes
3
answers
5k
views
Published version WPF .NET Core
I am looking to use code similar to the below, but in a .NET Core WPF C# application. This is what I previously used.
public static string GetVersion()
{
if (System.Deployment.Application....
12
votes
1
answer
3k
views
Can't reference .NET Core class library in Universal Windows or WPF app
I have a .NET Core class library, targeting .NET Standard 1.6.
I want to make a small Windows app with a GUI I can use to test various capabilities of my class library. At this point, I don't ...
11
votes
6
answers
6k
views
Publish Single File (Release) fails for WPF .NET Core 3.1 application
I'm trying to publish a WPF Application (to a folder) targeting .NET Core 3.1, using Publish Single File, targeting win-x86. The application publishes fine for Debug, but fails for Release. If I ...
10
votes
1
answer
3k
views
.Net Core 3.1 Process.Start("www.website.com") not working in WPF
I am using .Net Core 3.1 Framework in WPF Application. I have a button event in which I am trying to redirect to Instagram url on click. but its giving me the following error.
Exception thrown: '...
10
votes
1
answer
10k
views
.Net core 3: manually adding framework dependencies
Since the release of version 3.0, it is now possible to write WPF applications in .net core, and this is really nice!
On the other hand, on .net core, the dependency system now relies on full ...
10
votes
2
answers
20k
views
Published .Net Core App Warns to Install .Net Core but it's Already Installed
I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant ...
10
votes
1
answer
13k
views
How to create a WPF app with .NET Core 3 and Visual Studio
What is or will be the correct way of creating WPF applications with .NET Core 3 and WPF Desktop Pack with Visual Studio 2017?
Will there be a new project template in the New Project window or will ...
10
votes
2
answers
2k
views
How to use DbContext with DI in desktop applications?
I've been working on several non-web applications with Entity Framework and always it was struggling for me to find a correct approach for implementing Generic Repository with DbContext.
I've ...
10
votes
1
answer
2k
views
WPF .Net Core 3.0 mapping language primitive types in Xaml
One of the issues I'm facing while converting WPF application from NET Framework 4.7 to .Net Core 3.0 is a problem with mapping primitive types like Double in XAML. In NET Framework this XAML has ...
10
votes
1
answer
5k
views
Deploying a WPF application that uses Entity Framework Core
I want to build a WPF app that uses entity framework core so that I can handle SQLite databases.
I then do the following, for instance:
Using Visual Studio 2017 (15.5.2), create a WPF application.
...
9
votes
1
answer
6k
views
How can I add WPF items into a C# class library project in VS2019?
I have started a Class library project in Visual Studio 2019 and now wish to add WPF items (Window, user control, custom control) into it, but the 'Add Item' dialog box doesn't list anything under the ...
9
votes
1
answer
6k
views
Bad IL Format when loading exe in .NET Core 3.0
I have two .NET Core 3.0 WPF projects. One of them, I published into an executable called "DefaultPlugin.exe".
In my second WPF project, I'm trying to load the first project using Assembly.Load and ...
8
votes
1
answer
4k
views
Reference .NET Core 1.0 library from WPF
I am currently developing a desktop application in WPF, which uses an .NET Core library to make porting to different platforms easier. However, I cannot seem to reference the .NET Core library from ...
7
votes
3
answers
6k
views
How to disable CORS in WPF WebView2
I'm developing an app that displays WebView2 using .Net5/WPF.
I want to disable CORS.
I have installed Chromium Edge Canary 86.0.607.0.
In Edge, CORS could be disabled by adding the following argument ...
7
votes
2
answers
11k
views
How to include Resource files in dotnet build with Visual Studio Code
I'm building a WPF application with dotnet core in the visual studio code editor. The problem I'm having is that the Resources folder isn't included with builds, or so it seems. I can't find an ...
7
votes
1
answer
9k
views
Microsoft Speech in .net core 3.0
I've used Microsoft Speech previously (not sure which version it was) with .net framework and it did work. I don't have that project on my PC now. I've downloaded and installed the Runtime 11 and SDK ...
7
votes
1
answer
2k
views
Why does a simple .Net Core 3.0 WPF app not start on a deployment computer
Created very simple WPF .Net Core app with VS2019Prof V16.3.1.
Created new project - WPF App (.Net Core)
Nothing else was done, just only built the project (Debug and Release) - successfully run it ...
6
votes
8
answers
10k
views
Windows Forms Designer and WPF Designer for .NET Core
I have recently heard that the alpha version of .NET Core (.NET Core 3.0) supports Windows Forms and WPF. But the Visual Studio Designer (and Visual Studio) doesn't support the .NET Core version of ...
6
votes
1
answer
2k
views
How to reference System.Windows namespace in .Net Core? [duplicate]
I'm a long time WPF (.Net Framework) developer finally dipping my toes into .Net Core for the first time. I'm currently trying to convert a small v4.7.2 WPF application to .Net Core 3.1. The solution ...
5
votes
1
answer
2k
views
Image tag in WPF in .net core 3.0 not working
I am working on a WPF application using .net core 3.0 preview.
I tried the following line of xaml code in both .net core 3.0 preview and .net framework.
<Grid>
<Image Source="system-...
5
votes
1
answer
1k
views
Need I enable ReadyToRun in each of my dll whlie publish the exe file?
As we know, there is ReadyToRun compilation option since .net core 3.0 .
There is several dll that made by .net core .
I created a WPF project and referenced all the dll above.
Now I am about to ...
5
votes
1
answer
4k
views
How should I binding xaml event from WPF in .net core 3.0?
How should I binding a event in netcore 3.0?
In a WPF project(netcore3.0), there is no kind of Interactive.dll to do like
<i:Interaction.Triggers>
<i:EventTrigger EventName="...
5
votes
2
answers
3k
views
Compile error with WPF .net Core 3.0 when adding .resx files
Following works as expected:
VS Studio 2019 tested with professional and community.
Create new APF App (.NET Framework)
Open properties Folder
Change Resources.resx to public
Create a new resources ...
5
votes
1
answer
11k
views
Can't install MSIX package with powershell
The problem
I am trying to install a .net core 3.1 wpf app onto a windows 2019 server using msix as the method of deployment. The windows server is up to date and should support msix, but will not ...
5
votes
2
answers
711
views
App opens console window when being build with Docker
I'm facing the issue that a .Net Core WPF application automatically opens a console window when started. This only happens when build inside a Docker container. When I build it directly on my PC, only ...
5
votes
2
answers
3k
views
Wpf app crashing - Faulting module name coreclr.dll version: 4.700.20.47201
I have WPF application on .netcore 3.1 packed in appx package and installed from the package. Sometimes (one on several dozen starts) it crashes on startup with errors in EventViewer:
first error ...
5
votes
2
answers
390
views
Cannot Browse to specific Type in Settings designer for WPF/.net Core application
When I've used Settings Designer before, I've been able to browse to find non-standard Types (e.g. uncommon enums etc) to use in my Settings via a "Browse" button at the bottom of the drop ...
5
votes
1
answer
456
views
How to clean up instances created by SimpleInjector during verification?
As a part of creating my SimpleInjector container, I've followed recommended practices and called container.Verify() to check that my type registrations make sense.
This works well and has caught a ...
4
votes
3
answers
12k
views
.Net Core 3.0 hostfxr.dll could not be found
using .net core 3.0 and wpf
I have successfully built an app in wpf for .net core 3.0 and it runs fine where i have installed visual studio (dev environment).
However as soon as i copy the release ...
4
votes
1
answer
2k
views
Is there some way to use a folder seletor (FolderBrowserDialog) in WPF Core?
I would like to have a dialog to select a folder in a WPF Core application, but I am not able to find the way.
In a WPF net framework application, I could use FolderBrowserDialog of System.Windows....
4
votes
1
answer
3k
views
Getting an error trying to use System namespace in xaml
I get the following error trying to use the String type in xaml:
XLS0419 Undefined CLR namespace. The 'clr-namespace' URI refers to a namespace 'System' that could not be found.
Here is the code:
&...
4
votes
1
answer
3k
views
WPF with entity framework on net core - unable to create and object of type AppDbContext
I have simple WPF Net Core app when i'm using entity framework, i have DbContext, but when i have add migration then i receive error:
PM> add-migration init
Build started...
Build succeeded.
...
4
votes
2
answers
3k
views
How do I enable the console in a WPF .NET Core application?
I'm trying out WPF .NET Core for the first time, and one of the things I always do in a new WPF .NET Framework project is turn on the console, but I receive an error when I try to do this in .NET Core....
4
votes
1
answer
14k
views
Logging in .net core wpf application [closed]
I'm a fairly new programmer. I have been working on a .net core wpf application and I would like to add logging for exceptions. I've looked into ways to do logging in .net core with nlogger and ...
4
votes
3
answers
954
views
Xaml UI Designer is inactive for wpf projects in .net core 3.0
I have updated Visual Studio 2019 to version 16.3 which can support .Net Core 3 stable version.
After creating the first WPF app supported by .Net Core 3, the designer is inactive while the XAML ...
4
votes
2
answers
3k
views
How to add Microsoft Edge WebView2 Runtime as prerequisite
I have WPF .Net core 3.1 Desktop Application and trying to Add MicrosoftEdgeWebView2Runtime as prerequisite with Clickonce but I'm not able to find in prerequisite list.
Thanks in Advance.
Ravi V.
4
votes
1
answer
2k
views
WPF - how to set the build Action to 'Resource" with VS Code?
I m looking to create a WPF application using VS Code and .net Core 3.1.102
I've an issue with Image , I can't see it..
<Grid>
<Image Source="system-tray.jpg"/>
</Grid>
This ...
4
votes
1
answer
681
views
URL Source Image Does Not Display In .Net Core
I've encountered a problem with loading URL images in WPF .Net Core 3.0. I think it is a problem related to the .Net version rather than a code-related issue or anything (given that I don't have the ...
4
votes
2
answers
2k
views
Dependency Injection WPF MVVM Navigation .NET Core
I need some help to understand how to instantiate ViewModels without having all of them as parameters in the MainViewModel Class constructor.
Could any of you help me to get my head around and get rid ...
4
votes
1
answer
90
views
Bind Collection to ListView, suppress duplicates of object but manipulate ListViewItem
My problem, developing a shopping system on a Raspberry Pi 3 Bodel B, is as following:
First of all some context:
Raspberry Pi with Barcode Scanner is used as self-service shop
Employees scans a ...
4
votes
1
answer
1k
views
Publish WPF Core using MSIX...multiple problems
Edit #1 Start
To Replicate this:
Create a new "vanilla" WPF application addressing .Net Core 3.1
Add an Windows Application Packaging Project to the solution (follow the steps mentioned in Set up ...
4
votes
1
answer
638
views
Microsoft installer project bug
In my WPF .NET Core app I added an installer project. Once generated and installed, when I tried to run the application I got an error
microsoft.data.sqlclient is not supported on this platform
I ...
4
votes
1
answer
8k
views
It is "not supported" to build or publish a self-contained application without specifying a RuntimeIdentifier
Using the latest Visual Studio 2019 I am trying to publish a Msix installer for a DotNetCore 3.1 WPF application. The application builds and runs correctly, but when I try to publish the application I ...