As the title says, what is the preferred way to add the Mobile Broadband API to my C# WPF application?
Steps that worked for me. The file you're looking for is mbnapi.tlb which for me (I'm on Windows 8) is located here:
C:\Program Files (x86)\Windows Kits\8.0\Lib\Win8\um\x64\mbnapi.tlb
There are a few different folders where you could find this file to work with OS versions (8.0, 8.1, ...) and processor architectures (x86, x64, ...).
Once you have located that file use the normal procedure to reference it in Visual Studio:
Click the Project item in the toolbar, and then click Add Reference from the drop-down menu.
From the Add Reference page, click the Browse tab.
Browse to the Mbnapi.tlb file and select it. Then, click OK.
Reference: http://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/MB_ManagedCode.docx
Related
I added one SDK(.dll) to one project, through click righ -> add -> reference -> Browser -> look for the SDK in my local file explorer, then click Add and finnally Ok.
so, The question is that now I must add it but for a code directed for linux, I have the SDK for linux, its extension is .a
which is the way to add as a reference???, since the usual way only allows adding dll, tlb, olt, ocx, exe or manifest files
I need to use Windows.Storage.Streams and Windows.Devices.Enumeration in my Winforms application on Windows 7 to access and manipulate Barcode reader, but unable to find it to Add Reference. Not sure if can download it somewhere. I was able to find and download Microsoft.PointOfService and added reference to my project, but not the first two libraries.
Please advise.
The Windows.Storage.Streams and Windows.Devices.Enumeration namespaces are part of the Windows Runtime. To use them you need to target Windows 8 or above. They aren't available when targeting Windows 7.
How to access the Windows 10 APIs from WPF
You can access the Windows 10 APIs from a pre-existing WPF project. To do so, go to your Solution Explorer window and …
Right click on References.
Select “Add Reference…” from the context menu.
On the left of the Reference Manager, choose Browse and find the following file: C:/Program Files (x86)/Windows Kits/10/UnionMetadata/Windows.winmd.
Add it to your project as a reference. Note: You will need to change the filter to “All Files”.
Right click on References. Select “Add Reference…” from the context menu. On the left of the Reference Manager, go to Browse and find the directory “C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETCore/v4.5”. Add System.Runtime.WindowsRuntime.dll to your project.
Learn More Calling Windows 10 APIs From a Desktop Application
Just to be helpful to others that arrive here through Google, Microsoft has some NuGet packages to access Windows-specific APIs like that without the need to import or reference Windows libs manually. More info can be seen on their documentation here.
For those trying to use it from Windows 8/8.1, add a reference (like Sajeeb's answer) to the files at 32-bit C:\Windows\System32\WinMetadata or 64-bit C:\Windows\System32\WinMetadata respectively.
I believe those namespaces are not part of Windows Apps libraries. I don't think a WinForm project is able to use them. Personally, I don't have newer versions of VS, so I am not sure of that. But there is supposed to be a new project type in VS2015 onwards.
I am developing an application that contains around 30 projects using vs 2008. what I want to do is that I want to create a shared directory where I am going to save and reference all required libraries.
the problem is that I want to create that directory outside the application folder. (in my C driver ex. 'C\MyDLL'. is that possible in VS 2008. if not is there any work around solution
thanks in advance
Yep. Place your .Dll files wherever you want ex: c:\mydllfolder\my.dll. The open visual studio and in your solution explorer right click the project and choose "add reference". When the Reference Manager window appears click the "Browse" button, navigate to your dll folder and select the dlls you want to reference.
I am developing a Win Forms with C# in Visual Studio 2012 RC.
The Problem is my project is not creating
example.XmlSerializers.dll
in
*\bin\Debug directory of my project.
This problem occur when i publish the project using Click Once.
What i have done already to get rid of this problem.
In Project's properties Build Tab. i have set Generate Serialization Assembly = ON
In project's properties Publish Tab. I clicked on Application Files Button and select example.XmlSerializers.dll = Include
I have searched on Google but didn't find the satisfactory answer.
Please Help. I am in trouble. How can i get rid of it. I will be very very thankful.
If you build your application, do the dll's show up in the \bin\debug folder? If do, then build the application, then open the Application Files dialog (in the Publish tab of your main project's properties). At the bottom of the screen, check "Show all files". Those dll's should show up. Set them to "Include" and "Required".
I found this link, which helped me sort out the problem.
Seems that the "Publish Now" button has a bug which doesn't include the [application_name].XMLserializers.dll. If you select the "Publish Wizard" button instead, your missing files should be included...
I've read here and here for ways to embed my application's manifest files inside the PE but these steps do not seem to work for VC#:VS2008 - VS2008 doesn't even come with mt.exe (as far as i know)
How might I go about doing this?
You can add a manifest to your C# application by following these steps:
Right-click on your project in the Solution Explorer
Select "Add New Item" from the context menu.
Choose "Application Manifest File" from the list of options in the dialog box that appears.
However, note that Visual Studio already adds a manifest to your project by default in order to ensure compliance with UAC found in Windows Vista and 7. If you want to specify that a custom manifest file should be used by your project instead, follow these additional steps:
Once you've added your custom manifest file to your project, right-click on your project in the Solution Explorer and click "Properties" (or double-click on the "Properties" item under your project).
Under the first tab ("Application"), you should see a group of options specifying how your application manages resources. You can leave the default "Icon and manifest" option selected, but you need to select your custom manifest file from the drop-down box labeled "Manifest".
Finally, for the sake of completeness or if the above steps don't work for you, you can still use mt.exe to embed your manifest file into your application's EXE after you've built it. If it wasn't included with your installation of Visual Studio, you'll need to download and install the Windows SDK. Get the latest version for Windows 7 and the .NET Framework 4.0 here.