• 0

VS Reference with exclamation mark


Question

Hello gang,

 

I found this code ( http://www.getcodesamples.com/src/5D67423E ) that returns some of the audio data so I can create visualizations with c#.  The DLL works find when included with a Windows 8 Store app, but with a desktop app (Frameworks 4.0 or 4.5) I get the yellow exclamation mark next to the Reference in the parent project.

 

Any ideas what I am doing wrong?  The MMAudioPlayer is C++, which I do no know.

Link to comment
https://www.neowin.net/forum/topic/1191993-vs-reference-with-exclamation-mark/
Share on other sites

18 answers to this question

Recommended Posts

  • 0
  On 09/12/2013 at 16:55, Eric said:

That usually means it's not a valid CLR reference. You may need to change the platform the audio player is set to build for.

 

Eric,

 

I found this article that I believe is what you are speaking about: http://msdn.microsoft.com/en-us/library/ms185328.aspx

 

Here is my current config for this new project.  MMAudioPlayer is the component that is okay if included in a Win8 Store app, which is also defined as "x86"  Since both of these are the same I feel that I am still wrong, or not getting what you are telling me.

 

Build Configuration:  http://imgur.com/VKeQk50

  • 0
  On 09/12/2013 at 17:35, Eric said:

Hmm... the config looks ok from here. I will try downloading the MMAudioPlayer later and see what I can coerce it into doing. Is it set to output CLR in the C++ config? (/clr command line option)

 

Is this the command line option you are speaking about?  (again, I appologize for my lack of C++ knowledge)

 

Settings: http://imgur.com/THuICrX

  • 0

There's a setting under the General tab for "Common Language Runtime Support" that controls it but I think you can just add the /clr to that dialog too. It should add an external reference for mscorlib.dll. It's likely already set that way if you have it working on the Windows Store side. It looks like Windows Store DLLs have different references.

  • 0
  On 09/12/2013 at 21:59, Eric said:

There's a setting under the General tab for "Common Language Runtime Support" that controls it but I think you can just add the /clr to that dialog too. It should add an external reference for mscorlib.dll. It's likely already set that way if you have it working on the Windows Store side. It looks like Windows Store DLLs have different references.

 

 

Eric,

 

Thank you very much for your time and help.  I will look for the setting, but I would also like to know if there is anywhere specific in the command line where the: /clr switch should be placed?

 

Have a great evening.

  • 0

You probably don't have matching targets for the DLL and your desktop project. You can get yellow bangs if there is a mismatch between referenced assemblies and your project. Normally it is something like .net 3.5 vs .net 4.5. In your case, I'm not exactly sure _what_ the windows Windows 8 store app target would be (but probably something different from .net 4.5). I did find this though and perhaps it will work for you:

 

http://msdn.microsoft.com/en-us/library/windows/apps/jj856306.aspx

  • 0

It can go anywhere under Command Line I believe but you can also turn it on in the General tab by changing that setting.

post-175510-0-62737000-1386683456.png

Is there any way to download the zip of that project? It tells me it hasn't been published.

EDIT: I downloaded the source files individually and dumped them into a CLR class library project and it fails to compile miserably for me.

I don't know very much at all about C++ CLR or DirectX myself. :(

  • 0
  On 10/12/2013 at 13:51, Eric said:

It can go anywhere under Command Line I believe but you can also turn it on in the General tab by changing that setting.

attachicon.gifScreenshot (8).png

Is there any way to download the zip of that project? It tells me it hasn't been published.

EDIT: I downloaded the source files individually and dumped them into a CLR class library project and it fails to compile miserably for me.

I don't know very much at all about C++ CLR or DirectX myself. :(

 

No worries Eric, neither do I.   I am unable to add anything to the command line,,, don't know why.  Nor does the "Common Language Runtime Support" option exist for me.  I am using VS 2013, and I see you have 2013.  So that could be the issue.

  • 0
  On 10/12/2013 at 15:47, Eric said:

Have you looked at NAudio? I don't think it supports Windows Store projects but you could always abstract your audio into interfaces and use different engines for desktop/Metro.

 

I did take a brief look at NAudio, but had to use the MMAudio because it worked for Win Store.... ah, the joy of various components based on platform.  I may have to look back at NAudio, thanks for the reminder

  • 0

So, I tried the MMAudioPlayer library out myself to see what exactly was going on (including installing VS2013; creating a Windows Runtime Component Library; incorporating in the MMAudioPlayer sources). It turns out that the library code for MMAudioPlayer is Windows Runtime (WINRT) platform code (http://en.wikipedia.org/wiki/C%2B%2B/CX ; http://en.wikipedia.org/wiki/Windows_Runtime). This means that it is compiled as an unmanaged DLL; whereas, your desktop c# app is .net or common language runtime (CLR) code. The two can't inter-operate under normal circumstances. At the very least you'd have to jump through hoops to do it.

 

I played around with the options try to make MMaudioPlayer compiled as an CLR dll, however, it doesn't work because some of the used components used by MMAudioPlayer are only available via the native C++:

Error 2 error C1189: #error :  ERROR: Concurrency Runtime is not supported when compiling /clr. C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h 26 1 MMAudioPlayer
Moreover, it looks like when you developing Windows Store apps, it uses something called XAML (http://en.wikipedia.org/wiki/Windows_Runtime_XAML_Framework). I'm not sure how it work internally, but that layer let's you use c# code in non-desktop apps.

 

 

See the last post here (don't bother with the tlbimp.exe, it doesn't work):

http://stackoverflow.com/questions/14028713/could-not-add-reference-to-winrt-c-dll-project

  • 0

The MMAudioPlayer source isn't unmanaged, it's essentially an interop library that lets you access DirectX's XAudio2 in managed code. Windows Store projects have an option to create something similar to a library called a runtime component. The project appears to be unmanaged but it's not. It has a manifest file that specifies how other projects can consume it.

XAML is an XML subset that you use to create user interface elements. It doesn't have anything to do with C++ or DLLs. It's common to WPF, Silverlight and Metro.

  • 0
  On 11/12/2013 at 02:53, Eric said:

The MMAudioPlayer source isn't unmanaged, it's essentially an interop library that lets you access DirectX's XAudio2 in managed code. Windows Store projects have an option to create something similar to a library called a runtime component. The project appears to be unmanaged but it's not. It has a manifest file that specifies how other projects can consume it.

XAML is an XML subset that you use to create user interface elements. It doesn't have anything to do with C++ or DLLs. It's common to WPF, Silverlight and Metro.

 

All C++/Cx code by definition is unmanaged. It's literally native C++ code with extensions (did you read the links I sent?). If it weren't, it would be compiled into CLR byte code and it is not. You can verify this by running it through an x86 disassembler* as well as attempting to run it through CLR bytecode disassembler**. The former will work, the latter will fail. With Windows Runtime Component projects you use the /Zx switch in VS so that that you can generate metadata files that operate essentially as a managed interfaces/ABIs for WINRT projects to use (e.g. store apps). These interfaces actually are managed code, or rather, in almost the same format as what you would see in CLR bytecode (e.g. so they a readable by a CLR disassembler).

 

Here's the problem, a Windows Runtime Component project's generated metadata interface file is not readable by a regular winforms or CLI C# project even though the interfaces are almost the same. Moreover, you can't reference the DLL directly because it is all native code. So you are SOL from what I can see. I don't believe there is a way around this. And I'm sure MS has some sound technical reasons for this (or just deprecation or simply no good reason at all).

 

Finally, let me clarify exactly what I was talking about w.r.t. XAML. Windows 8 has an newer XAML layer called Jupiter which allows WPF applications to interface with WINRT code. Ergo, you can create an XAML WPF C# project and then _use_ or _reference_ Runtime Component Library Project DLLs. This is how XAML is related to the DLL issue...

 

Don't believe me about the managed/unmanaged code? Here's a VS2013 C++ Windows Runtime Component project to build MMAudioPlayer (it also has pre-built DLLs) so you can fire up a disassembler and check for yourself:

https://www.dropbox.com/sh/amjbnnnkmhz1u3i/l3syTkacc3

 

* objdump, ollydbg, idapro

** ILSpy, .net reflector

  • 0
  On 11/12/2013 at 04:01, snaphat (Myles Landwehr) said:

 And I'm sure MS has some sound technical reasons for this (or just deprecation or simply no good reason at all).

DEPRECATE ALL THE THINGS seems to be the motto at Microsoft these days. Especially with everything .NET. Heck I heard Windows 8.1 deprecated a lot of Windows 8 APIs already!

  • Like 1
  • 0
  On 11/12/2013 at 21:37, Andre S. said:

DEPRECATE ALL THE THINGS seems to be the motto at Microsoft these days. Especially with everything .NET. Heck I heard Windows 8.1 deprecated a lot of Windows 8 APIs already!

 

When will they deprecate 32-bit executables ;-)

This topic is now closed to further replies.
  • Posts

    • Microsoft 365 Copilot Notebooks now integrated in OneNote on Windows by Paul Hill Microsoft has announced that Enterprise customers with Microsoft 365 Copilot, SharePoint, or OneDrive licenses can now use Microsoft 365 Copilot Notebooks integrated directly with OneNote on Windows. Copilot Notebooks are AI-powered and bring together different resources such as Copilot Chat, files, notes, and links into a single space to make you more productive. The Redmond giant wants to make it easier for customers to gather content, understand complex topics, and create “smarter content” with Copilot Notebooks. This integration is squarely aimed at Enterprise customers, not Personal or Family subscribers. How Copilot Notebooks enhance productivity in OneNote When you open OneNote on Windows, you should see Copilot Notebooks in the left-hand sidebar, from here you can view or edit existing notebooks or you can create one by going to Home > Create Copilot Notebook or New notebook. During the creation of your new notebook, you can give it a name and add references such as OneNote pages, .docx, .pptx, .xlsx, .pdf, or .loop files. This gives Copilot extra context to provide you with more refined answers. Once you have created a notebook and added your reference documents, you can use Copilot Notebooks to help you gather insights from your documents, draft summaries, and generate audio overviews. An important caveat to mention about these notebooks is that you can only add 20 files as references and only individual OneNote pages, as opposed to sections and notebooks, can be added. Microsoft could add support for these in the future, but you can’t add them yet. Another limitation right now is that some OneNote features aren’t functional within Copilot Notebooks, including tags, section groups, inking, templates, password protection, Immersive Reader, and offline support. Availability and what it means for enterprise users Microsoft 365 Copilot Notebooks in OneNote for Windows are available for Enterprise customers with an appropriate license (anyone with a Microsoft 365 Copilot, SharePoint, or OneDrive license) running OneNote Version 2504 (Build 18827.20128) or later. If you have any other feedback to give to Microsoft, you can give it via Help > Feedback. As an Insider preview, Microsoft will likely improve this before declaring it stable so let Microsoft know of any issues you have. Now that the feature is available as a preview, it’s the perfect time for IT admins and other decision-makers to evaluate the feature to see how it could benefit their wider organization.
    • Mixxx 2.5.2 by Razvan Serea Mixxx is powerful, free, and open-source DJ software designed for both beginners and professionals. It offers real-time beatmatching, auto DJ, effects, and MIDI controller support. With a clean interface and compatibility across Windows, macOS, and Linux, Mixxx is ideal for live performances, radio broadcasts, or practice sessions. Its active community and constant updates make it a reliable tool for any DJ. Mixxx integrates the tools DJs need to perform creative live mixes with digital music files. Whether you are a new DJ with just a laptop or an experienced turntablist, Mixxx can support your style and techniques of mixing. Mixxx key features: Realtime audio engine with low-latency performance MIDI and HID controller mapping with customizable scripting (JavaScript-based) Vinyl DVS support (absolute & relative timecode modes) OpenSL, ASIO, WASAPI, and JACK audio backend support Advanced BPM & musical key detection (KeyFinder integration) Quantized beat sync and phase locking Effect chain routing with LADSPA plugin support 4-deck mixing with independent EQ and gain control Support for wide file formats (MP3, FLAC, OGG, WAV, AIFF) Broadcasting via Icecast and Shoutcast with metadata support Library with Crate, Playlist, and Smart Playlist organization Multi-core CPU support for performance optimization Microphone and Auxiliary input routing with talkover ducking OSC and Web MIDI support Skinnable and themable Qt-based UI Cue points, hotcues, and looping with quantization Recording in lossless WAV or compressed formats Clock-synced looping and beatjump Mixxx 2.5.2 changelog: Library Fix playlist export when name contains a dot Fix loading the wrong track via drag and drop when using symlinks Fix: byte order in hotcue comments imported from rekordbox Tracks table: show ReplayGain with max. 2 decimals, full precision in tooltip Fix keyboard mappings with non-ASCII characters on Linux Computer feature: enable initial sorting during population Computer feature: avoid false-positve 'has children' for non-directory links Fix column header mapping when using external library Fixed Single track cover reload on reload metadata from file Controller Mappings Arturia KeyLab Mk1: initial mapping Denon MC7000: slicer mode TypeError Denon MC7000: crossfader curve using wrong parameter DJ TechTools MIDI Fighter Twister: support 4 decks Hercules DJControl Inpulse 500: the crossfader was not reaching 100% to the right end Icon Pro Audio iControls: initial mapping Numark Mixtrack Platinium FX: Fix 4 steps browsing issue Traktor Kontrol S3: Use GUI config for settings Traktor S2 MK3: Fixed LED issue Traktor S4 MK2: Use engine settings API for configuration Traktor S4 MK3: prevent sync lockup, add setting for tempo center snap Controller Backend Control picker: Allow to learn MIDI Aux/Mic enable controls Make [Main],headSplit CO persistent across restart Fix MIDI Controller button learning Fix learning with "No Mapping" selected Unit tests for engine.beginTimer engine-api.d.ts: brake()/spinback() documentation Target support Fix building with a CMake multi-config setup Fix building with gcc >= 14 with LTO and clang >= 19 (fpclassify) Fix: gcc -Warray-bounds= in fidlib by using a flexible member Added Linux Mint Codenames to debian_buildenv.sh Add hidden [Config],notify_max_dbg_time setting to reduce warnings in developer mode Detect arch and fail early if not supported when installing buildenv Misc Vinyl Control: Reduce sticker drift Fix infinite number of pop ups of the "No Vinyl|Mic|Aux|Passthrough input configured" dialog Reduce CPU usage with Trace log messages Fix adjust Gain after adopting it as ReplayGain only in requesting playe Skins: add loop anchor toggle to Deere, Shade, Tango Sound Hardware preferences: add manual link for Mic monitoring modes Work around an Ubuntu, Ibus or Qt issue regarding detecting the current keyboard layout. Fix BPM rounding for the 3/2 case Update cue & play indicators on paused decks when switching cue mode Download: Mixxx 2.5.2 | 113.0 MB (Open Source) Links: Mixxx Home page | Other OSes | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • KDE brings Wayland PiP to Plasma 6.5, adds finishing touches to 6.4 as release nears by David Uzondu The KDE team has released its This Week in Plasma update, showing the final polish being applied to Plasma 6.4 ahead of its June 17 release. Last week, the KDE team brought performance upgrades, and this week the team is continuing that with improvements like faster loading for System Monitor components in Plasma 6.4. Future work for Plasma 6.5 is already underway, and it includes a feature that many have probably been waiting for: proper Picture-in-Picture support on Wayland. This uses an experimental version of the Wayland PiP protocol, which means applications like Firefox that also implement it can finally display PiP windows correctly. It is a long-overdue addition that moves the Wayland session closer to feature parity with X11. The devs also merged KWin's Background Contrast effect into the Blur effect. Virtual desktops can now be re-ordered from the Pager widget, a feature previously missing. Invert and Zoom settings have been moved into the Accessibility page, which is a more sensible place for them than the Desktop Effects page was. The team also brought consistency to the Breeze application style, with animated effects for checkboxes and radio buttons now working in QtQuick-based apps. Other small cleanups include standardizing the section headers in the Disks & Devices, Networks, and Bluetooth widgets. For those who do a lot of screen recording, Spectacle now makes it much clearer how to stop a recording, both in its notifications and shortcut names. As for the immediate future, Plasma 6.4 and its first point release are getting accessibility and user interface tweaks. The team improved text contrast for labels used in secondary roles throughout Plasma, making things like brightness indicators much easier to read. The Kicker Application Menu in 6.4 can now scroll horizontally when a search returns a ton of results, so you can actually see all of them. The team also delivered some stability improvements in Plasma 6.4.0, most notably fixing a long-standing issue where adding widgets to oversized panels could freeze the entire shell. Discover also got a much-needed fix for a crash that occurred when suggesting replacements for unsupported Flatpak apps. On the usability side, dragging files into a Folder View widget no longer causes glitchy visuals, and Open and Save dialogs from Flatpak-based browsers now properly allow the preview pane to open. Printing from Flatpak GTK apps now respects correct sizing, and installing or removing apps no longer wipes out your search input in Kicker or Kickoff while you're using it. Other notable fixes include: Selection rectangles on the desktop now render properly when using custom fonts or sizes (Plasma 6.3.6) A crash in System Monitor charts used by apps and Plasma components has been resolved (Frameworks 6.15) Switching process views in System Monitor no longer causes crashes (Frameworks 6.16) Open and Save dialogs no longer close when hovering over specific files (Frameworks 6.16) A thumbnailer crash on X11 caused by certain widget styles has been fixed (KDE Gear 25.04.3) Frameworks 6.15 also speeds up System Monitor by delaying tree view arrow loading There are still 3 high-priority Plasma bugs holding out, and the list of quick-win "15-minute bugs" has grown to 23.
    • Hasleo Backup Suite Free 5.4.2.0 by Razvan Serea Hasleo Backup Suite Free is a free Windows backup and restore software, which embeds backup, restore and cloning features, it is designed for Windows operating system users and can be used on both Windows PCs and Servers. The backup and restore feature of Hasleo Backup Suite can help you back up and restore the Windows operating systems, disks, partitions and files (folders) to protect the security of your Windows operating system and personal data. The cloning feature of Hasleo Backup Suite can help you migrate Windows to another disk, or easily upgrade a disk to an SSD or a larger capacity disk. System Backup & Restore / Disk/Partition Backup & Restore Backup Windows operating system and boot-related partitions, including user settings, drivers and applications installed in these partitions, which ensures that you can quickly restore your Windows operating system once it crashes. Viruses, power failure, or other unknown reasons may cause data loss, so it is a good habit to regularly back up the drive that stores important files, you can at least recover lost files from the backup image files in the event of a disaster. System Clone / Disk Clone / Partition Clone Migrate the Windows operating system from one disk to another SSD or larger disk without reinstalling Windows, applications and drivers. Clone entire disk to another disk and ensure that the contents of the source disk and the destination disk are exactly the same. Clone a partition completely to the specified location on the current disk or another disk and ensure that the data will not be changed. File Backup & Restore Back up specified files(folders) instead of the entire drive to another location to protect your data, so you can quickly restore files(folders) from the backup image files when needed. Incremental/Differential/Full Backup Different backup modes are supported, you can flexibly choose data protection schemes, which can improve backup performance and save storage space while ensuring data security. Delta Restore Delta restore uses advanced delta detection technology to check the changed blocks on the destination drive and restore only the changed blocks, so it has a faster restore speed than the traditional full restore. Universal Restore This feature can help us restore the Windows operating system to computers with different hardware and ensure that Windows can work normally without any hardware compatibility issues. Hasleo Backup Suite 5.4.2.0 changelog: Added backup image delete feature Added storage path management feature Improved file backup feature Show application notifications in Windows Notification Center Various other bug fixes and feature improvements Download: Hasleo Backup Suite 5.4.2.0 | 34.4 MB (Freeware) Links: Hasleo Backup Suite Website | Hasleo Backup Suite Guide | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • One Month Later
      5i3zi1 earned a badge
      One Month Later
    • Week One Done
      5i3zi1 earned a badge
      Week One Done
    • Week One Done
      julien02 earned a badge
      Week One Done
    • One Year In
      Drewidian1 earned a badge
      One Year In
    • Explorer
      Case_f went up a rank
      Explorer
  • Popular Contributors

    1. 1
      +primortal
      545
    2. 2
      ATLien_0
      227
    3. 3
      +FloatingFatMan
      160
    4. 4
      Michael Scrip
      113
    5. 5
      +Edouard
      98
  • Tell a friend

    Love Neowin? Tell a friend!