Can I convert a .Net 4.x project/solution to .Net 6 in place - winforms

I have a WinForms VB app using .NET 4.x and would like to convert to .NET 6.x. I've seen the "oh, just create a new project/solution" answer. Well, that's easier said than done for me, since my work in .NET is limited. I'm not sure why an existing project can't be converted instead of creating a whole new project/solution. I have tried that but it complains about not having various libraries/assemblies/whatever. It seems that with the app.config and various other config files, MS could create a tool to modify those appropriately instead of someone creating a whole new project/solution. Do they not know what is in their own files? Is upgrading a project/solution so difficult that the only way to do it is to start over?

Related

Plugin for working with WinForms for JetBrains Rider (vb.net)

I have just switched from Java-development (where I used IntelliJ) to an old WinForms application in VB.net. I have decided to use Rider, since I really liked IntelliJ.
From what I understand Raider's WinForm designer does not yet support VB.net-WinForms.
So my question is if there is a plugin that supports WinForms designing in Raider (to avoid having to switch to VS and avoid using 2 different IDEs).
The Winforms designer from Rider does only support C# with WinForms under Windows. It has recently added support for other toolkits, maybe in a cross-platform manner.
The answer to your question is no: and I don't think they are going to include since there is probably not enough demand. You can still use Visual Studio for the designer and go back to Rider when that part is finished.
My personal advice is to avoid use any designer. WinForms is really easy to grasp, and there are tutorials out there that make the task even easier.
One possibility would therefore be to get rid of the designer files and manually modify the code. An important outcome is that the project will be then editable in any IDE, not only Visual Studio or others with compatible plugins.

Migrate old .csproj types like WPF or XNA to Visual Studio 2017 new csproj

I like the new .csproj format introduced in 2017 but I'm disappointed that no .NET framework project templates got any new .csproj templates (Yes, XNA doesn't have one for obvious reasons).
I've already managed to take a base .NET Standard library and turn it into a .NET Framework executable using the new format, but this doesn't seem to work for any projects that rely on the <ProjectTypeGuids> tag for special functionality. WPF xaml files refuse to use the designer and the add new Window ability isn't present anywhere (Strangely enough, UserControl is present).
XNA is more understandable why it doesn't work, but my first and main roadblock I'm encountering is that the old method for including XNA dlls doesn't work (Get the warning icon) and new methods are just as fruitless. I can't seem to find how to add extra reference paths to new .csproj formats like in the old format.
Anyways, is this even possible to do at the moment in Visual Studio 2017, or are these specialized project types consigned to the old .csproj format for now?
Old project types like WPF, Winforms don't support the new csproj format via Microsoft SDK at the moment.
There are some hacks, additional SDKs which try to solve it.
So currently you should stay at old format.

Problem with using IntermediateSerializer outside an XNA project

I'm currently working on an Xbox360 game. In this game I have lots of data stored in XML. Deserializing it through IntermediateSerializer in the XNA Game project is no problem, works like a charm. But since these structures stored in XML can be quite complicated I decided to make a simple editor for the stuff, so I (or maybe a less experienced user) could edit the objects visualy (animations, game stages etc) rather than having to write these data as XML. Then I would serialize it through the IntermediateSerializer and everything would be fine.
For this editor I created a WPF project, and referenced the Microsoft.Xna.Framework.Content.Pipeline.dll
Visual Studio recognizes the IntermediateSerializer class, and intellisense helpfully recommends to use the Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate namespace, but I keep getting the following error message:
The type or namespace name 'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?)
(I'm using XNA 4.0 and .NET 4)
Am I doing something wrong or is this just simply impossible?
Tenshiko
In your Application Properties ensure
that the Target framework is set to
.NET Framework 4.
By default a new WPF application targets the .NET Framework 4 Client Profile. The Client Profile is designed to reduce the download size of the .NET Framework for end users and excludes assemblies that are only used in development. In your case Microsoft.Xna.Framework.Content.Pipeline.dll depends on Microsoft.Build.Framework and Microsoft.Build.Utilities.v4.0 which are not available in the Client Profile.
It seems to me that you did set a target framework of your WPF application to ".NET Framework 4". It has to help.

XDocument Class in VB.NET

I am learning Silverlight and WPF on my own to expand my programming base. I am following this tutorial, and I am currently stuck on part 3. I am up to the point where my application requests and receives a response from Digg, but I cannot figure out how to properly dimension the XDocument class (as the tutorial shows) to read the xmlcontent that is retrieved.
Granted, the tutorial is in C# (which I know very little about), but I do not see why I cannot access this class. IntelliSense suggested replacing XDocument with Document.Run, but that got me nowhere. I also read that this class was part of the System.Xml.Linq namespace, but even trying to dimension my variable as
Dim xS as System.Xml.Linq.XDocument
Gives me nothing. Anyone know what I can do?
If I recall correctly you need to add the System.Xml.Linq dll in the project references.
What version of .Net/Visual Studio are you using? XDocument wasn't added to the framework until .Net 3.5.
As the above posters mentioned Linq is a .Net 3.5 addition.
I had a very similar problem recently trying to used linq features in what I thought was a 3.5 enabled app but my web.config was from an older project.
If you know you have 3.5 installed, try making a new project and add your code back into it.

Any tool that can upgrade .NET 1.1 WinForm code to .NET 2.0 "style"?

I mean a tool that can extract certain contents from old .NET 1.1 WinForm code and put it in .designer file (make it looks like .net 2.0 WinForm code). This also involves an update to the project file (.csproj/.vbproj)..
If no existing tool yet, any tip or pointer on how to do this by programming?
It is possible to do using a macro, have a look at this article for the macro code.
If anyone else is looking to do this for VB.net (as I did) the only example I could find was this one in c# but it gave me a basis and we got it to work with a vb project.

Resources