XmlDocument does not exist in current context - visual-studio-2013

I referenced System.Xml in my code, but XmlDocument still does not show up. Whenever I try to use it, it tells me:
Error: The type or namespace name 'XmlDocument' could not be found (are you missing a
using directive or an assembly reference?)
I saw this link that seemed pretty helpful; unfortunately, I am using a Windows Apps template, and it does not allow me to remove or add references, and I am sure that I am not using Silverlight. I am using Visual Studio 2013, with .NET 4.5. Any help is appreciated.
Edit: I am trying to make a background task. This is how I am using it:
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);

I got it: the library had been changed or something, so XmlDocument is no longer under System.Xml.
It is now under Windows.Data.Xml.Dom.
This worked:
using Windows.Data.Xml.Dom;

Related

How do I add an Apple class to a project in Visual Studio for Mac

I have a really tough question. How would I add a class in Visual Studio for Mac?
More specifically, how do I reference any class?
I'm going through the instructions here. It says there is an Audio Player example that uses the AVAudioPlayer class.
It doesn't specifically say how to add that class but going to the Projects > Add Reference menu and typing Audio in the search box shows nothing:
This is the instruction page I've referenced:
https://learn.microsoft.com/en-us/xamarin/mac/app-fundamentals/sounds
The page also says it's an example but I don't see any code only an API reference.
Apple APIs
https://developer.apple.com/documentation/avfaudio/avaudioplayer#see-also
https://developer.apple.com/documentation/avfaudio/avaudioengine
UPDATE:
I think I might have figured it out.
The class looks like it was in AVFoundation package not AVFAudio:
To use it you have to put:
using AVFoundation;
at the top of your class
Then in your code you can use:
var player = new AVAudioPlayer();
Or it looks like you can use the full namespace to create an instance:
var player = new AVFoundation.AVAudioPlayer();
I'm still getting errors so I don't know if that's it or not.
I also added some Nugen libraries like Xamarin.CommunityToolkit but I don't see them referenced in so I don't know if that's necessary.
Update 2:
It looks like the instructions for that are here:
https://learn.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough?view=vsmac-2019
Here are the errors I'm getting:
/Applications/Visual
Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Microsoft.Common.CurrentVersion.targets(5,5):
Warning MSB3276: Found conflicts between different versions of the
same dependent assembly. Please set the "AutoGenerateBindingRedirects"
property to true in the project file. For more information, see
http://go.microsoft.com/fwlink/?LinkId=294190. (MSB3276) (project)
/Users/me/project/packages/Xamarin.CommunityToolkit.1.1.0/build/PreserveXamarinCommunityToolkit.cs(12,12):
Error CS0246: The type or namespace name 'PreserveToolkitAttribute'
could not be found (are you missing a using directive or an assembly
reference?) (CS0246) (project)
Side note:
There doesn't seem to be much activity here on SO, so I attempted to visit the Visual Studio forums and to post you have to join the Microsoft docs network. Here's some of the details when attempting to sign up. They didn't mention this before signing up.

Xamarin compile issues

I'm experiencing alot of errors on a big project i've been working on for quite a while now.
Out of nowhere, my VS2017 doesn't recognise any xamarin references.
The project compiled flawlessly a couple of hours ago.
Example
I get 119 errors because of this when i try to compile.
For a solution, i tried to uninstall a nuget package: Xamarin.Android.Support.v4, this resulted in me not being able to install it back because i keep getting these errors when i try to install the package.
I have Xamarin.Forms installed. The bug started not being able to find certain dll files from my .net framework, i tried to solve this by giving direct references to the files, but it kept on not being able to find new dll files.
I always keep a backup on Github for reasons like this, but for some reason, the github project gives me the same bugs! It didn't when i saved it last night. This tells me my environment is screwed up, and for all i've done, i only seem to make it worse, so i don't want to mess up anything more.
Error message:
The type or namespace name 'Thickness' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?
The type or namespace name 'Xamarin' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'XamlCompilationAttribute' could not be found (are you missing a using directive or an assembly reference?)
(This continues for all 119 errors)
New error
Try checking your window's updates. I had the same issue a couple of hours ago and solved it with a system update
try deleting the package folder, and let it restore, Also remove Xamarin.forms nugget then install it again

Dotnetnuke 8 module development error in visual studio 2013

I have successfully installed DNN 8 and all configuration.
i am also referring video to develop module in visual studio.
https://www.youtube.com/watch?v=AKCYRPuoXF4
when i am trying to build the project then
error comes like:
Error 17 The type or namespace name 'DotNetNuke' could not be found
(are you missing a using directive or an assembly
reference?) C:\websites\dnndev.me\DesktopModules\MyDNNModule\MyDNNModuleModuleSettingsBase.cs 13 7 MyDNNModule
Please help to solve that.
thank you in advance.
Working with DNN8, sometimes I get a set of errors with message
The type or namespace name 'DotNetNuke' could not be found (are you
missing a using directive or an assembly reference?)
, probably 10 or 15 of them, and all located on top of one ascx file. (My dotnetnuke.dll is correctly placed in DNN's bin folder). Taking a better look (scroll down!), I can see that - except them - there are some more error messages (maybe just one of them), and that those additional errors are perfectly clear and logical. So I correct my source code in order to avoid those additional messages, and when I do that - those problematic messages also disappear!
In my case it took me a while to find the solution to this problem, since it only got triggered when I made a change to the View.ascx file.
You need the Visual Studio project to target framework to 4.5 instead of 4.5.1.
I got this solution from here.
Make sure to add a Reference to dotnetnuke.dll in the c:\websites\dnndev.me\bin folder
I honestly haven't done anything with DNN 8 CTP yet, I would stick with 7.4.1 until 8 is official released.

how to create QR code in windows phone 7.1

Please tell how to generate QR code in Windows Phone 7.1. I have tried this urlThomasVestergaard
I'm using Silverlight_ZXing_Core version v2.0.50727 library.
But When I used code from above link I have following issue
1.System.Windows.Media.Imaging.WriteableBitmap' does not contain a definition for 'SetPixel' and no extension method 'SetPixel' accepting a first argument of type 'System.Windows.Media.Imaging.WriteableBitmap' could be found (are you missing a using directive or an assembly reference?)
Please tell me how to resolve this as soon as possible.
Thanks
You should check WriteableBitmapEx library. It has extension methods for GetPixel() and SetPixel() in addition to other useful stuff.

problem integrating silverlight toolkit in VS2010 project

i've installed silverlight toolkit from codeplex (NuGet didn't work, feed was empty.. probably working on the project) and after referencing
Microsoft.Phone.Controls.Toolkit
I get the error :
The type or namespace name 'Toolkit' does not exist in the namespace
'Microsoft.Phone.Controls' (are you missing an assembly reference?)
What could it be?
Because your xmlns is calling it toolbox but the prefix is toolkit.
Change
xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
to
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
Or, change your prefix to toolbox. It doesn't matter what you call it; it just has to be consistent.
In this line you declare toolbox as a name to reference the toolkit
xmlns:toolbox="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
In this line you reference to the name toolkit
<toolkit:DatePicker Header="Date" Value="9/16/2010" ValueChanged="DatePickerValueChanged"/>
It does not work because those names should be equal. So either declare xmlns:toolkit or reference toolbox:DatePicker
Good luck!

Resources