Visual Studio 2015 missing core assemblies/namespaces? - c#

Can someone explain to me how to use/accuire access to vs built-in classes like MusicProperties or ImageProperties listed here?
https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.fileproperties.aspx
My visual studio doesnt recognize it`s namespace even though I have installed latest windows 10 sdk, as listed in the requirements table:
"Universal, introduced version 10.0.10240.0".
Do I have to use explicitly winForms or WPF etc to have access to specific libraries?

You have to create an Universal app or Windows Runtime app to be able to access that namespace.
Pick any of these (note that some project types can have another subset of features enabled):

Related

Running Mono C# projects on Mac ... and Winforms

For the first time I am trying Visual Studio for Mac and I located a tutorial for writing a exe that shows a window with a simple menu.
My two questions are:
How does a user of a Mac get the Mono platform? I can't find instructions for deploying Mono. When I look in my exe folder there is no other files. Just the exe.
Maybe this should be a different question but I could not find any "WinForms" version in Visual Studio for mac. I had to use Gtk2 (I think).
If there is a better place to ask these questions please direct me. Thanks.
I know understand that the best course of action was:
Create a Xamarin.Forms multi-platform project.
Create a Cocoa Mac OS project.
Add a reference to project 1 into project 2.
Using Nuget Package Manager download Xamarin.Forms into each project.
Now it is easy to create an application with XAML (similar to WPF).
Visual Studio for Mac creates the multi-platform project (step 1 above) automatically with the Android and iOS platform builds, but not the macOS.
I also see that I don't really need to download Mono as it is all dealt with automatically.
.NET Core does support Mac and Linux. And even though .NET Core now supports Windows Forms. Windows Forms is only supported on Windows. It's unlikely this will ever change due to Windows Forms dependency on the Windows APIs.

Where in Visual Studio 2017 can I find "Blank App (Xamarin.Forms Portable)"?

I'm using Visual Studio 2017 for personal Apps (Windows Form), now I'm trying to use it for Xamarin Apps, but I can not find "Blank App (Xamarin.Forms Portable)" under Visual C# in the New Project creating Windows.
Do I miss any special update or something?
You mention Portable in your title but Portable Class Libraries (PCLs) have been deprecated in favor of .Net Standard. The current VS 2017 no longer supports creating them. If you're new and don't really know the difference between PCL and .Net Standard the chances are pretty good you can just go with .Net Standard and won't have to worry about it. The end result is basically the same. Whatever documentation/tutorial you're using will probably still be applicable even if you're doing a .Net Standard project instead of a PCL.
Along with the other answer that says to make sure you have Xamarin components installed, proceed with the stuff below.
As far as selecting "Blank App" specifically, it's in the second part of the workflow to create the project. I'll show you step 1 and step 2 on my installation.
Ensure this is installed in Visual Studio Installer (run VSI, find your installation and if it's trying to update it, drop down the arrow next to update and choose Modify):

How to use SQLite on new Windows 8.1 Store app (Visual Studio 2013)

So, I installed Visual Studio 2013 on my Windows 8.1 box. I want to experiment with it and created a new Windows Store Grid App. I want to persist data on a SQLite database, apparently the database of choice for WinRT apps.
Quickly found links to the vsix needed in order to be able to use the SDK: SQLite download page, and downloaded sqlite-winrt81-3080002.vsix.
Installed it, then in my project, added the reference to the newly installed SDK (right click references, add reference, navigate to Windows, select extensions and tick SQLite for Windows Runtime (Windows 8.1) checkbox.
Also quickly found that it won't compile on Any CPU. On Configuration Manager, selected Debug, x64 active platform, that made me able to compile the application.
Finally, while attempting to use the namespace SQLite I noticed VS 2013 isn't recognizing it. Attempted many things like adding reference to the .dll directly, exploring the component to see which namespaces were available (which doesn't show anything), and I'm quickly running out of ideas. Because it's kinda new thing, and with limited interest, google, the saviour, doesn't want to save me today.
So, how one would be able to use the SQLite SDK in their Visual Studio 2013 projects, targeting Windows Runtime 8.1?
These are the contents of my csproj file
UPDATE
Stupid me, thought there was no managed land (.net) in Metro style land. Sorry for causing any confusion.
I installed the VSIX for SQLite and noticed that it is a native DLL to be used in Windows Store 8.1 C++ apps. It is not for managed C# projects.
The current NuGet package for SQLite from what seems to be the 'official' SQLite team is only working for .NET 4.5, if you try to install it, it will error saying it does not support .NET 4.51.
There is also the NuGet package SQLite-net, which works for .NET Windows Store apps. All you need to add is the SQLite using statement.
You will need this NuGet package as it is the managed wrapper for the SQLite, without you will not be able to properly reference the right DLL for SQLite.
Here is the link to the project information from that NuGet package. SQLite Runtime Support
Here is an article on how to use SQLite with Windows Store apps in VS2012 but it should still all apply:
SQLite and Windows Store Apps

SQLite. Fix sqlite-net-wp8 project dependencies

Why SQLite is not available on NuGet? Why it is part of Visual Studio where you have to go look for updates at Tools->Extensions and Updates? I started coding Windows 8 and Windows Phone 8 in the past few months and I like to get some insight into this.
To me, using SQLite on a Windows 8 project creates a VS-level dependency.
Let's say I develop a client library using the version of SQLite referenced by the Visual Studio IDE (Example: 3.7.x) and distribute the library to another developer who uses SQLite 3.8.x referenced by his/her Visual Studio IDE, will my client library still work?
What happened to me last week was this:
I developed a client library for Windows Phone 8 using SQLite and I had to use a 3rd party wrapper written by Peter Huene called sqlite-net-wp8.
It is available at: https://github.com/peterhuene/sqlite-net-wp8/
When you look at the Sqlite.vcxproj file (https://github.com/peterhuene/sqlite-net-wp8/blob/master/Sqlite.vcxproj) of this project, it has references to a given version of SQLite. Looks like every time you update SQLite on Visual Studio, you have to update the .vcxproj file too.
Something like:
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(MSBuildProgramFiles32)\Microsoft SDKs\Windows Phone\v8.0\ExtensionSDKs\SQLite.WP80\**3.8.0.2**\DesignTime\CommonConfiguration\Neutral\SQLite.WP80.props" />
</ImportGroup>
Let's say I develop the client library using 3.8.0.2 and give it to an apps developer who uses the same approach to talk to SQLite (using sqlite-net-wp8) for Windows Phone 8 apps and he/she uses a different version of SQLite (say 3.7.x or even a newer version 3.9.x), will my client library still work? I believe his/her sqlite-net-wp8 may be referring to a different version of SQLite than my client library, breaking the code.
When I updated SQLite 3.7.x to 3.8.x, it forced me to update the Sqlite.vcxproj to go find 3.7 and replace with 3.8 which was not good user experience.
I think ideally it should be backward compatible working with 3.7.x also. But it didn't.
If SQLite and sqlite-net-wp8 is available on NuGet, I can inform the developer who wants to use my client library the version of SQLite and sqlite-net-wp8 I use.
Any idea of overcoming the problem and have better developer experience dealing with the issue?
I believe the reason SQLite is not available on nuget is that it is a native package so the dll to be used need to be dependent on the target assembly platform which nuget don't seem to support yet
Regarding updating the version of sqlite for your project, you don't need to manually update vcxproj, just use "Add Reference" to remove and readd the reference to Sqlite (it will show up in the Add Reference window under windows ->Extension after you have install the extension)

VisualStudio 2012 - C# missing methods

I have win 8 system with .net framework 4.5 and visual studio 2012
I had some problems when I work on a metro style app and when I searched the problems I found results in msdn with some properties and events like textBox.keyPressed, Control.ModifierKeys and some more. visual studio says method does not exist.
do I have to download a class or something
Framework which is used to develop Windows Store applications is a subset of .Net 4.5 framework.
You may to check whether they exists in msdn.
For instance System.Windows.Forms.dll library does not exist for Windows Store applications thus, Control.KeyPress event does not exist as you can not use dll mentioned above in a windows store application.

Categories

Resources