I'm trying to create a portable class library targeting .NET 4.5, Windows 8 and Windows 8.1
I'm unable to use the StorageFolder class which resides in the Windows.Storage namespace (http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.aspx).
The only reference in the project's References branch is named .NET and object browsing it shows it does have StorageFolder class located under Windows, under Windows.Storage namespace.
But when I try to add a reference, I just see a small list of available assemblies which does not have anything with Windows in it.
I'm using VS2013 with update 3 on a Windows 8.1 x64.
I think you're using the object browser incorrectly. By default it will show All Components
To get to what you actually have, you need to select ".NET Portable Subset (Visual Studio 2013)"
If you really want to add the Windows.Storage then you have to select
"All Components" and search for Windows.winmd
Highlight that Component then click on the "Add to References in Selected Project in Solution Explorer" Button. Located here:
That will add that reference over to the Portable Library project (which imho, defeats the purpose)
Then in your Class1.cs you can you use your StorageFolder
Related
I created a custom WinForms control. When I added reference to the control's project for any project in the same solution, the control appeared in a WinForms designer toolbox and I can use it.
But I have problem to use it as an external library.
I built it and got a DLL file. When I add reference to the DLL file for a project, the control doesn't show in the toolbox. I tried also add it by "right click toolbox => choose items...", but I have an error: "'path to dll' targets a platform whose toolbox items cannot be enumerated dynamically".
Visual Studio 2022 Community .Net 6
I found the "answer" here: link
The only solution is workaround: Putting your controls in a NuGet package and referencing that
Seems likely that I am not able to create a windows form application using the Microsoft Visual Studio Express 2013 under Windows 8. The default templaters are only for creating apps rather than traditional normal windowed applications.
Is there any way I could find the template or find a solution?
Thanks.
You cannot.
Download Microsoft Visual Studio 2013 Express for Windows Desktop instead.
Link for online installer
Link for ISO file
Visual Studio download page
Actually yes, you can do that manually, by adding the references to the project (System.Windows.Forms) and changing the output type in the properties of the project, and adding classes - you have to manually do the whole thing..
To Expand RobDev's answer, you can actually do this. I will show you an example of how to do this in Visual Studio Express 2015 for Web, probably same applies for 2013 version.
Steps.:
Create an empty solution
Create a .dll library project
Change output in project properties to Windows Application. To do so, right click on the new added project and pick "Properties". There, you can change "Output Type" dropdown in Application tab.
Add a reference to System.Windows.Forms to your project (by right-clicking => Add Reference to your Reference option under your project)
Set the project to Startup Project, by right-clicking the project and choosing "Set up as Startup Project"
add a main method to the generated class (you can rename it to Main). It will need this code to start.
using System.Windows.Forms;
namespace ClassLibrary1
{
public class Class1
{
public static void Main()
{
Application.Run(new Form());
}
}
}
and voila! That will create a new fresh Form. You could use a starting point whatever form you want. To do so, add a new .cs class and make it inherit from Form class.
The toolbox to customize forms is available at View => Toolbox menu.
I created a new file-system based web site in Visual Studio 2010. On property pages I've set to use .NET 4.0, but I cannot find System.Windows in the Add Reference dialog. The only copy on my PC seems to be in this directory, but this is not a Silverlight project
C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
I thought it might have something to do with the client profile vs full version, but I can't see where to specify that in a web site project.
What am I doing wrong?
Not all namespaces have corresponding DLL file names used in the Add Reference dialog. System.Windows is one of these.
For example, System.Windows.Clipboard is resident in the PresentationCore.dll, but System.Windows.SizeConverter is in WindowsBase.dll. It all depends on the actual types you need to access.
System.Windows is the WPF base classes - you cant add that assembly to an ASP.NET site. You will need to change your application type to use it.
There is the Deploying COM Components with ClickOnce article in MSDN that says that native DLLs also could be referenced:
To add a native reference, use the Add Reference command, then browse
to the manifest.
So, I'm trying to reference Skype4COM library. I've generated a manifest using mt
tool. But when I try to reference this manifest, VS says me:
.
What am I understand or I'm doing wrong?
You are mixing up deploying with building. Adding a reference requires a type library or a DLL that contains a type library embedded inside the DLL. Skype4com.dll has one but it has a problem which prevents it from being added through the Add Reference dialog.
Use the Visual Studio Command Prompt from the Start + Programs menu. Use cd to navigate to the correct directory and type tlbimp skype4com.dll. You'll get a warning that you can ignore as long as you are running 32-bit code. Go back to VS and use Add Reference, Browse tab and select the generated SKYPE4COMLib.dll file.
I am trying to go through the example at http://msdn.microsoft.com/en-us/library/aa719643(VS.71).aspx
Visual studio 2010 does not recognize System.Web.SessionState and various others.
I tried adding a .net reference to them but they do not exist on my system. I have .Net 4 installed.
Why would these examples use namespaces that are not recognized by visual studio?
alt text http://www.phantix-llc.com/system.web.sessionstate_missing.jpg
System.Web isn't shown because VS2010 defaults to using the .NET4 Client Profile which doesn't include it. (You can see the "Filtered for .NET Framework 4 Client Profile" text at the top of the Add Reference dialog.)
You need to change your project's properties so that it targets the full version of the framework, then you'll be able to select System.Web.
System.Web.SessionState (and the others shown unrecognized) are in System.Web.dll. Verify that reference exists.