.Net Framework Debug window is not working - c#

I have a problem of debugging. I have the window created with the buttons, labels and everything, but when i try to debug it, the UI/GUI doesn't show up.
I am on windows 10 Visual studio 2019, with Developers mode on (since Visual Studio is asking for it when creating WFA or Windows Forms App). I have .Net Framework 3.5 Installed and i dont see the reason why it shouldn't work. I see it every time i create a project.
The Application i am trying to create is a .Net Framework WPF

The Reason why the Debugging doesn't show the UI is because of the .Net Framework you are using is not compatible with the .Net Framework version your project is set to work on
you can set the normal .Net Framework version you want your Project to work on in the Section when the Visual Studio is asking for the Name of the Project, the Solution Name and the path. At the very bottom, you will see something along the lines of ".Net Framework". Click on that and choose any Version you want your project to work on. (Warning Note: .Net framework 4.5 and .Net Framework 4.8 may have compatibility issues. This info is in th link below)
You would need .Net Framework 4.5 or above
I highly recommend getting .Net Framework 4.8 since it is a .Net Framework version that supports .Net Framework 4.7.2
I had this issue and when i installed .Net 4.8, the Debugging instantly started working.
For More Information, Check out this Link:
https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/runtime/4.5-4.8
[18th April 2022] - Edit: .Net 6 is a thing. You can use that instead of .Net Framework 4.8

Related

Visual State Manager in WPF not supported

I am creating an app which needs to use the Visual State Manager, but when I want to use it, I get the following error:
Visual State Manager is not supported in a WPF application.
I tried to use the code snippet from this question: VisualStateManager is not supported in a WPF project, but then it says, that the Visual State Manager is not in the namespace of System.Windows.
I am using .NET Framework 3.5 to use the app on Windows 7 as well...
Does somebody have an idea how to solve this?
Thanks!
If you want to use the VisualStateManager class in your WPF application, you must target the .NET Framework 4.0 or later.
Since the .NET Framework versions 4.5.2, 4.6, and 4.6.1 will reach end of support on April 26, 2022 and versions between 4.0 and 4.5.1 are already out of official support, any new application that you develop should target .NET Framework 4.6.2 or later.
.NET Framework 4.6.2 and later versions are fully compatible with Windows 7 SP1.

The C# Project is targeting ".NetFramework, Version=v4.5,Profile=Unity Full v3.5", which is not instaled on this machine

I tried to open a script in VS2015 from Unity 5.6.
For some reasons, this popup shows up and I click the first option and change the target to .Net Framework 4.5.2 and everything builds and works as expected.
However, every time I made changes in the Unity editor and switched back to Visual Studio, this dialog pops up again.
When I looked into the csproj files, I can see that, after I made changes in the Unity editor, I see this:
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Unity Full v3.5</TargetFrameworkProfile>
Then after I selected "Change the target to .NET Framework 4.5.2"
I see this:
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
It seems that the Unity editor is configured to change the .Net Framework to 4.5.
I tried to install .Net Framework 4.5 but it is already installed.
Is there any way I can either use .Net 4.5 in Visual Studio or change the target framework in Unity such that this dialog won't pop up again?
Before you do anything complicated, try this:
Open Edit>Project Setting>Player
Click Other Setting, go to Configuration, if the scripting runtime version is .NET 3.5, change it to .NET 4.x.
This not only fixed the warning, it also got back VS intellisense and the MathNet.Numerics can now be installed properly.
If this does not work, then try this link project-target-framework-not-installed.
In the Unity roadmap is stated that support for .net 4.6 will be added arround july 2017. The beta is out allready.
Scripting Runtime Upgrade (Preview)
Upgrade Mono and IL2CPP .NET runtimes to support the latest .NET functionality and APIs. This includes access to C# 6 and the .NET 4.6.x class library profile.
Currently Unity is only compatible with .net 3.5 but here is an workaround which may help.
If you have any of the .NET Framework v4.6 series allready installed you only need to install the Visual Studio 2015 Tools for Unity to be able to use the project without conversions.

Using SSH.NET on C# Console application in Visual Studio 2008 and .NET Framework 3.5

I have a Visual Studio 2008 project in C# with .NET Framework 3.5 and I would like to use SSH.NET library but I see no binaries there for last stable release 2016.0.0.
Also in home page says it has been moved to here. Once I go to this page, I see three branches, develop, master and sftpfilestream, so which one I have to take which is compatible with .NET Framework 3.5 (My project uses .NET Framework 3.5 on Visual Studio 2008)?
Also If I downloaded any of them, once unzipped I do not see any DLL, only projects. Well, in fact, I prefer to reference a project within mine in order to use it, but by curiosity, where are the binaries (DLLs)? and which project is the correct I have to add to mine for .NET Framework 3.5?

Cannot target .Net 2.0 in Visual Studio 2015

I have a project that targets both .Net 2.0 and .Net 4.5. I built+published it successfully in Visual Studio 2013. The .Net configuration in the .csproj file still says
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
Yet, when I open the project in VS 2015, it targets .Net 4.5.
I have 2.0 available in the Target Framework dropdown:
when I click ".Net Framework 2.0" it gives me a popup saying
Changing the target framework requires that the current project be closed and then reopened.
Any unsaved changes within the project will be automatically saved.
Changing Target Framework my require manual modification of project files in order to build.
Are you sure you want to change the Target Framework for this project?
When I click yes, the target framework goes back to 4.5 and nothing else happens.
I've tried reopening the project and VS, with no luck.
I've tried running the .Net 3.5 installer (which apparently includes 2.0), but it says I need to use "Turn Windows Features on/off"
I've ensured the .Net 3.5 Windows Feature is enabled.
And now I'm out of ideas. Has anyone else encountered this?
Running Windows 7.
In case, the .NET Framework 2.0 is corrupted, use the .NET Framework setup verification tool: https://blogs.msdn.microsoft.com/astebner/2013/11/06/net-framework-setup-verification-tool-and-cleanup-tool-now-support-net-framework-4-5-1/ to verify and once it found any corrupted, you can use the .NET Framework Repair Tool: https://www.microsoft.com/en-us/download/details.aspx?id=30135 to repair it.
Or under ‘Turn Windows Features on or off’, uncheck .NET Framework 3.5 (includes .NET 2.0 and 3.0), then check it.
As Hans Passant mentions in the comments, I apparently(?) edited the .csproj to use different frameworks for different configurations. I swear this didn't cause any issues in VS 2013.
But in any case, I verified using ILSpy that the .dll being generated is .Net 2.0, even though the dropdown says 4.5. So I guess all's well that ends well?

How to recompile program for .Net Framework 3

I am using VS 2010 and i was trying to create program based on .Net Framework 4 and when i done it, program was working only on my computer, coz nobody of my friends don't have .Net framework 4 installed.
How to recompile program for .Net Framework 3 in Visual Studio 2010?
right-click on the project properties and change Target framework from .NET Framework 4 to .NET Framework 3
Go to the Project menu
Click on the Your Project Properties
On the Application Tab, select .NET Framework 3.5 from the Target Framework dropdown.
Simply change project settings.
Or use command-line csc to compile
You can switch the target framework in Visual Studio 2010 between .NET 2.0, 3.0, 3.5, and 4.0.
See How to: Target a Specific .NET Framework Version or Profile on MSDN.
As noted on that page, you might have to install 3.0 by hand since Visual Studio 2010 comes only with .NET 4.0. But once you install 3.0, you will be able to target it.
From the project in Visual Studio 2010, right click on the project and select Properties. Click on the Application tab, and from the Target Framework dropdown, select .NET Framework 3.0.
Project ->
Properties ->
Application (tab) ->
Target framework: .NET Framework 3.0
This MSDN page will help guide you with additional details.
And, not to be a schmuck, but you could have received a faster answer by Googling "compile .net framework 3.0 visual studio 2010" and noting that the first link is How To: Change the Target .NET Framework.

Categories