XDocument Class in VB.NET - wpf

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.

Related

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

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?

.NET Core 3.0 WPF "Copy Local" Assembly Issue

I've switched my current WPF application to .NET Core 3.0. Everything works fine, except one thing! I added a project reference to my app, and set the "Copy Local" property to "No" (I want to use it as embedded). And now, my application is compiling, seems to be running, than stop. I created a new .NET Core 3.0 WPF project, linked only one also new project, set the reference and the Copy Local to No, and it is the same.
Is it a bug or need some extra parameter in the project file? Any idea?
Thanks,
Zoltan
#mm8, trust me, it has sense. :) But never mind, I solved my problem. I replaced the ProjectReference with simple Reference + EmbeddedResource to the dll + AssemblyResolve, and it worked like in the .NET Framework project before.

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.

Is the System.Web.Silverlight reference needed?

We are just getting into Silverlight development at my workplace. Somehow two of our dev machines have been configured differently. I noticed that one of them has access to System.Web.Silverlight in the reference list, and the other doesn't. Both can create and run Silverlight applications from scratch.
What does System.Web.Silverlight do? Is it a legacy reference? If we need it, where do we get it from?
This dll provided the ASP.NET Silverlight server control which was designed to make it easier to create the object tag needed to describe the silverlight plug-in.
This server-side control was removed as of Silverlight 3, you are now expected to build the object tag yourself.
So yes its legacy so you don't need it.
Anthony is correct. If you are having trouble after you upgrade your products to Silverlight 3 - or just want an example on how to insert your SL app in to a page, create a new SL3 project and check out the sample ASPX and HTML pages (which are pretty much the same as each other now...)

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