How to add rfcomm and genericAttributeProfile device capabilities to Package.appxmanifest in Windows 8.1. - bluetooth

I need to support multiple devices including both serial and BLE. When i add the following code to Package.appxmanifest file, i get an error
Unable to activate Windows Store app 'blah.blah_blah!App'. The activation request failed with error 'E_INVALIDARG'.
<m2:DeviceCapability Name="bluetooth.genericAttributeProfile">
<m2:Device Id="any">
<m2:Function Type="name:heartRate"/>
</m2:Device>
</m2:DeviceCapability>
<m2:DeviceCapability Name="bluetooth.rfcomm">
<m2:Device Id="any">
<m2:Function Type="name:serialPort"/>
</m2:Device>
</m2:DeviceCapability>

I have reappeared your project’s error. If you just add Bluetooth.genericAttributeProfile or Bluetooth.rfcom, that is ok. So I think the error caused by citing repeatability and you can follow the below step to add Bluetooth and add all Bluetooth’s services.
in the code Behind, you could add RfcommDeviceService by var rfcommDeviceService = Windows.Devices.Bluetooth.Rfcomm.RfcommDeviceService;
and add gattDeviceService by var gattDeviceService = Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService;.

Related

VS2019-project is unloaded, csproj <UseIISExpress> was changed somehow,

I had a problem and dell premium support ran some kind of upgrade or re-install of windows 10 while keeping my files in tack.
The next day, I was working on my MVC project in VS and it loaded ok and debugging got my application to the login page, which means it had to successfully read the Entity Framework Context with LINQ type stuff, and all of a sudden my project started having these errors about reading Entity Framework Context, but only in one method.
Then things got worse, I first tried to close VS and reopen VS. But this time, it said my project had been unloaded. I tried the option to reload the project, but now I was getting errors about "the operation could not be completed. the system cannot find the path specified" and errors having to do with not being able to find the current file highlighted at the top of the VS editor.
After looking up the unload issues in forums, I saw a suggestion to call up my Mbsa.csproj and change to false and to True. Then my project loaded ok - but why did this change? it was always false in my previous backups.
Then , when trying to run my project with VS Debugging, I started getting connection messages like these:
1 - C:\MBSSys\Mbsa\Mbsa 2020\Mbsa.csproj : error : The Web Application Project Mbsa is configured to use IIS. The Web server 'http://localhost:51700/' could not be found.
2 -The connection to 'localhost' failed.
Error: ConnectionRefused (0x274d).
System.Net.Sockets.SocketException No connection could be made because the target machine actively refused it 127.0.0.1:51712
3 - HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Detailed Error Information:
Module IIS Web Core
Notification BeginRequest
Handler Not yet determined
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
Config File \?\D:\MBSSys\Mbsa\Mbsa 2020\web.config
Requested URL http://localhost:51700/
Physical Path D:\MBSSys\Mbsa\Mbsa 2020
Logon Method Not yet determined
Logon User Not yet determined
Config Source:
163: <validation validateIntegratedModeConfiguration="false" />
164: <handlers>
165: <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
4 - Error message:
Server Error in Application "application name"
HTTP Error 500.19 – Internal Server Error
HRESULT: 0x80070021
Description of HRESULT
The requested page cannot be accessed because the related configuration data for the page is invalid.
Cause for HResult code 0x80070021
This problem can occur when the specified portion of the IIS configuration file is locked at a higher configuration level.
Resolution for HResult code 0x80070021
To resolve this problem, unlock the specified section, or do not use it at that level. For more information on configuration locking, see How to Use Locking in IIS 7.0 Configuration.
So I am wondering if anyone else has faced this particular issue,
or, if anyone can give me any appreciated advice here.
Thanks for your time and advice. If you need more clues, just ask.
The seems to happen after installing KB4568831.
https://superuser.com/questions/1575295/windows-updates-kb4568831-kb4562899-break-all-net-applications-hosted-in-iis
I could get rid of the 500.19 errors by manually re-installing some optional windows features that the update apparently removes (see below), but after I got auth-related errors instead. In the end I rolled back KB4568831 to resolve the issue for the time being. Hopefully this gets fixed soon.

Unable to Load MSMdpump.dll

I've been trying to set up Analysis Service. I've followed the step by step guide mentioned in the link
https://learn.microsoft.com/en-us/sql/analysis-services/instances/configure-http-access-to-analysis-services-on-iis-8-0?view=sql-server-2017.
However, I'm still unable to configure this.
I'm getting following Errors in Browsers:
<?xml version="1.0"?>
-<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
-<soap:Body>
-<soap:Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<faultcode>XMLAnalysisError.0xc10e0002</faultcode>
<faultstring>Parser: The syntax for 'GET' is incorrect.</faultstring>
-<detail>
<Error HelpFile="" Source="Unknown" Description="Parser: The syntax for 'GET' is incorrect." ErrorCode="3238920194"/>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I have checked Event Log below is the error I could see:
The description for Event ID 25 from source MSOLAP ISAPI Extension: \\?\C:\inetpub\wwwroot\OLAP\msmdpump.dll cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
msmdsrv.rll
7177
Not sure if I'm missing something here..I've searched for this error however without any luck. Any sort of help would be greatly appreciated.
The msmdpump.dll does not service GET requests, only POST messages. When you browse to http://your-server/OLAP/msmdpump.dll this SOAP error is what you should expect to see. In the setup instructions you linked in your message, at the bottom you will see Step 6: Test your configuration. Item 3 is what you want to do next:
"In Management Studio, in the Connect to Server dialog box, select Analysis Services as the server type. In Server name, enter the HTTP address of the msmdpump extension: http://my-web-srv01/OLAP/msmdpump.dll."

UWP Bluetooth Communication: bluetoothDevice object is always set to null

I try to let PC and HoloLens communicate over Bluetooth RFCOMM so I'm writing a UWP App. I can get the device info and so the id with a device watcher. My problem is this line:
var bluetoothDevice = await BluetoothDevice.FromIdAsync(deviceInfo.Id);
My problem is that bluetoothDevice is always set to null althought that shouldn't be. Microsoft says in their RfcommChat Excample to this line:
// If we were unable to get a valid Bluetooth device object,
// it's most likely because the user has specified that all unpaired devices
// should not be interacted with.
But my PC and and my HoloLens are already paired. And I'm getting the same error no matter if I execute the App with my PC and using HoloLens to connect with or the HoloLens and using my PC to connect with.
Can anybody help?
Regards
Dustin
i found my mistake. I forgot to add bluetooth in the capabilities of package.appxmanifest:
<DeviceCapability Name="bluetooth" />
<DeviceCapability Name="bluetooth.rfcomm">
<Device Id="any">
<Function Type="serviceId:34B1CF4D-1069-4AD6-89B6-E161D79BE4D8" />
</Device>
</DeviceCapability>
Try to use FromBluetoothAddressAsync with MAC of just found/paired device instead cause Device.Id can be wrong or not set actually.

An unhandled exception of type 'System.FormatException' occurred in Microsoft.Azure.Devices.dll

I'm referring this tutorial to create a device identity. However, getting an exception as below:
Here is my config file:
Edit:
What is this Instrumentation key and value in App.Config? I just copied from the sample code. However, from where can I get it, in case I'm using a real device?
Am I missing any SDK or anything else?
Do I need to download something extra? the tutorial does not suggest anything.
Even when I'm running sample code from GiTHub getting the same error.
the following screen snippet shows a reason of this error, such as connectionString.
Use the connectionString from your Azure IoT Hub - see the tutorial section Create an IoT Hub step 6.
Can you check that the connection string you're using is in the correct format. It should look like:
"HostName={your hub name}.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey={your key}"
You can copy the complete connection string from the portal as described in the tutorial.
Issue resolve: I was missing my connection string.Which I got from "IoTHubOwner" from Azure portal login. :)

Error with Azure service SSL in Development Fabric

I'm running into a problem with getting SSL to work in the Development Fabric. I'm running a clean install of Windows 8 Pro with Visual Studio 2012 Ultimate and the October 2012 Azure SDK for .NET. IIS8 is not installed, only IIS Express, which claims to support HTTPS so I'm hoping that's not the issue.
Running VS 12 as administrator, I've created a blank VS solution, added a new (.NET 4.5) cloud service with a new ASP.NET MVC 4 Internet web application project, and hit F5. Everything works fine. Then, when I add an SSL certificate to the web role and replace the HTTP endpoint (port 80) with an HTTPS endpoint (port 443, with the certificate), hitting F5 produces the following error message:
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the role instance 'deployment18(32).WindowsAzureCloudService.Mvc4WebRole_IN_0' with Process Id: 4892'. Unable to attach. Access is denied.
Note, the last part ("Access is denied") comes in a few variations, a particularly pleasant one being "Catastrophic failure". :)
The only message in the VS Output window ('General' output) is:
Windows Azure Tools: Warning: Remapping private port 443 to 444 in role 'Mvc4WebRole' to avoid conflict during emulation.
The Compute Emulator UI is not much help; just before the instance disappears, this is the only console output that I get consistently (sometimes other messages appear, but sporadically every few runs; I'm not sure how to capture these):
[fabric] Role Instance: deployment18(33).WindowsAzureCloudService.Mvc4WebRole.0
[fabric] Role state Unknown
[fabric] Role state Suspended
[fabric] Role state Busy
[fabric] Role state Unhealthy
[fabric] Role state Stopped
The certificate was obtained from a CA and properly imported into the Local Machine/Personal/Certificates store as a .pfx with private key, extended properties, and marked as exportable, for what it's worth.
When I attempt to publish the service to Azure, I get one build (validation) warning about the database connection string (which I assume is irrelevant):
The connection string 'DefaultConnection' is using a local database '(LocalDb)\v11.0' in project 'Mvc4WebRole'. This connection string will not work when you run this application in Windows Azure. To access a different database, you should update the connection string in the web.config file.
Probably more important, the deployment actually fails with the following history in the Windows Azure Activity Log window:
9:00:25 AM - Warning: There are package validation warnings.
9:00:25 AM - Preparing deployment for WindowsAzureCloudService - 1/3/2013 8:59:55 AM with Subscription ID '<...>' using Service Management URL 'https://management.core.windows.net/'...
9:00:25 AM - Connecting...
9:00:26 AM - Object reference not set to an instance of an object.
9:00:26 AM - Deployment failed with a fatal error
Can someone help me troubleshoot this issue? I've rebooted a few times. ;)
Thanks in advance!
EDIT (Jan. 3, 4:44 PM): I have a few ideas that might help me make progress, but some are pretty drastic so any advice would be appreciated:
Is there a way to capture all the output from the Compute Emulator (Dev Fabric) to a log file so I can review it? (System.Diagnostic.Trace calls from my service won't help, since I don't even get as far as the RoleEntryPoint when using HTTPS!) I figured this out; see next edit.
That null pointer exception during the Azure deployment has me worried. Is it worthwhile to try reinstalling the Azure SDK, and if so, how should I go about doing a clean install of it?
Has anyone seen a problem of this sort disappear when switching to using full IIS for the emulator? (That seems unlikely since IIS vs. IIS Express should have no relevance to the Azure deployment.)
EDIT (Jan. 4, 10:15 AM): Bad news: I tried the suggestion to grant Read access to the certificates, but it didn't help in my case. Good news: I managed to capture one of those sporadic messages in the Compute Emulator UI before it shut down; it was a bit of info from some diagnostics. Not helpful in and of itself, but it revealed where the Development Fabric was storing its temporary files:
[Diagnostics] Information: C:\Users\Lars\AppData\Local\dftmp\Resources\0005155d-4592-40f4-812e-18793b26576c\directory\DiagnosticStore\Monitor
The GUID portion gets recreated for every deployment, and it is deleted when the deployment goes away (as it always does in my case). But in the parent directory ('dftmp'), there are a few helpful directories that I then monitored during a new deployment: DevFCLogs, DFAgentLogs, and IISConfiguratorLogs. I guess that answers the first question I had yesterday! :)
DFAgentLogs\DFAgent.log: (41KB) No useful information. A bunch of "Failure to read pipe" messages and failures to get the role/deployment instance ID, which I assume are just noise.
DevFCLogs\DevFabric--2013.01.04--<...>.log: (510 KB) No useful information. I skimmed the file and also searched for 'error', 'failure', 'not found', 'certificate', and 'Mvc4WebRole_IN_0'; none of those showed any hints of what was going on.
IISConfiguratorLogs\IISConfigurator.log: (6 KB) Now we're making progress!! :) Can someone tell me what this means? (In the meantime, I'm off ILSpy-hunting... fun fun...)
IISConfigurator Information: 0 : [00006356:00000005, 2013/01/04 16:07:08.915] Using IIS Express appdomain
(...)
IISConfigurator Information: 0 : [00006356:00000005, 2013/01/04 16:07:08.936] Adding binding 127.255.0.0:444: to site deployment18(40).WindowsAzureCloudService.Mvc4WebRole_IN_0_Web
IISConfigurator Information: 0 : [00006356:00000005, 2013/01/04 16:07:10.484] Caught exception
IISConfigurator Information: 0 : [00006356:00000005, 2013/01/04 16:07:10.487] Exception:System.Runtime.InteropServices.COMException (0x800401F3): Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))
Server stack trace:
at Microsoft.Web.Administration.Interop.IAppHostProperty.get_Value()
at Microsoft.Web.Administration.ConfigurationElement.GetPropertyValue(IAppHostProperty property)
at Microsoft.Web.Administration.Binding.get_CertificateHash()
at Microsoft.Web.Administration.BindingCollection.Add(Binding binding)
at Microsoft.WindowsAzure.ServiceRuntime.IISConfigurator.WasManager.DeploySite(String roleId, WASite roleSite, String appPoolName, String sitePath, String iisLogsRootFolder, String failedRequestLogsRootFolder, List1 bindings, List1 protocols, FileManager fileManager, WAAppPool defaultAppPoolSettings, String roleGuid, String& appPoolSid, List`1 appPoolsAdded, String configPath)
EDIT (Jan. 4, 11 AM): ILSpy wasn't much help; the exception is being thrown at an interop point (we knew that already) while trying to get the hash of a certificate in order to set up the binding (we knew that too). Does anyone know what COM object would need to be registered in order to get a certificate hash for a binding in Microsoft.Web.Administration? Or how I could intercept the interop call to find out? Bonus points if you can tell me why this is happening in the first place. :)
I've had similar problem on two computers. On both cases installing IIS solved the problem.
It seems to be enough to just install the IIS (via add/remove Windows components). You don't need to start using it. The installation changes something and after that my IIS Express started working again with HTTPS from Visual Studio.
There is a discussion on similar issue on MSDN Social:
http://social.msdn.microsoft.com/Forums/nl-NL/windowsazuredevelopment/thread/ad362016-16f6-459a-8022-9307aa5f910e
And the issue has been also raised on Microsoft connect:
https://connect.microsoft.com/VisualStudio/feedback/details/758533
In my case the error in the log files was:
IISConfigurator Information: 0 : [00007644:00000007, 2013.01.17
00:39:18.523] Exception:System.Runtime.InteropServices.COMException
(0x800401F3): Invalid class string (Exception from HRESULT: 0x800401F3
(CO_E_CLASSSTRING))
I found the log files from C:\Users\\AppData\Local\dftmp\IISConfiguratorLogs directory.
When running locally with a private key cert for SSL, you'll need to give the user the emulator app is running under access to the private key. Open mmc.exe and add the Certificates >> Local Computer Snap-In to view your certificate. Right Click on the certificate, then All Tasks >> Manage Private Keys - then add IUSR and Network Service with at least read access.
For deployment to azure, you'll need to upload the certificate to the Cloud Service and make sure the certificate is valid for the domain.
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. From this SO post

Resources