Error when trying to run default C# HSPI A template - hspi

I downloaded Visual Studio 2017 Community and installed it on my Windows 10 PC. I downloaded the HomeSeer templates from the VS "marketplace" and installed them. I created a new project from the C# HSPI "A" template and pressed F5 to start the debug; I get 1 error message:
Error The command "powershell -file c:\users\paul\documents\visual studio 2017\Projects\HSPIPluginA1\HSPIPluginA1\fix-output.ps1 -configuration Debug -executionpolicy Unrestricted -NonInteractive" exited with code -196608.
Project: HSPIPluginA1 File: c:\users\paul\documents\visual studio 2017\Projects\HSPIPluginA1\HSPIPluginA1\HSPIPluginA1.csproj Line: 77
Do you have any idea what I did wrong? I'm pretty bad if I can't even get the default, pre-packaged, code to work.
Also, how do I provide an alternate IP Address for the plugin to connect to? My HS3 runs on a remote Linux (Lubuntu 16.04 LTS) machine. Thanks in advance.
I did not mean to imply that I was frustrated with you - it was me I was frustrated with; there just seems to be so much to learn. I know how much time and effort it takes to create/package/edit/document things so other folks can use them, so I certainly don't want to be a "whiner" right at the start. I also really appreciate you made the modifications to the template so quickly.

Thanks for reporting.
I just published an update to the extension that corrects the problem you were having. The corresponding tracking issue is https://github.com/alexdresko/HSPI/issues/62
I haven't finished the documentation yet, but you can see how to change the IP and port by going to https://github.com/alexdresko/HSPI/issues/7#issuecomment-283101463
Please do not expect perfection from this project. It's something I'm working on in my spare time and I am in no way affiliated with HomeSeer.
Now that I think about it, I do not know if this project will work with Linux, as that is something I haven't tested yet. I am very interested to know if it works, so please keep me updated.
Thanks again!

Related

Open Powershell script with pure c code

I want to make automatically screenshots of our visualiziation.
I managed to switch through the pictures.
But getting the screenshots is quite difficult.
I found an quite easy Powershell script that works fine.
But I have to call it with c Code due our visualiziation.
It offers only "Winexec" and "ProgramExecute".
I didn't manage to find the right code...
WinExec("Powershell -/Skript -Param1 -Param2", SW_SHOWNORMAL);
or
unsigned int ProgramExecute(char* Program_Name)
Has anybody an idea where I can find the right order?
Thanks :)
I use the fine software "greenshot" with automatic save.
No coding and almost anybody can create screenshots of the visualization ;)
..and sometimes powershell is not installed, or the security setting of the policy prohibits this kind of scripts from running correct...
//PerD

"stack.cpp not found" prevents debug in VS 2013 express

I'm a rookie at C in general and VS 2013 also. I am trying to use some C code provided by a vendor in VS 2013 express. It compiles and runs without problem using the command line compiler but I would like to use the IDE.
I started a new project, C++ for console app, and I have pasted the code into the IDE and saved it as xyy.c so that it builds successfully. I thought it would be nice to have it in a GUI, so I duplicated the effort with a Win32 app project. It also builds.
The program's job is to connect to a PCI card that has Plx chip as an interface and program an FPGA. The Win32 program succeeds, even though I can't see any of the info printed by the program. The console program fails and I think it is because it fails to find the driver for the Plx chip. I thought I would get a clue by single stepping through the Win32 program to see which driver was supposed to be found.
However, after the first pass through a while loop, I get a pop up that says "Source Not Found" and "stack.cpp not found". Google wasn't any help to me.
I be grateful for any suggestions.
You might have "Enable .NET Framework source stepping" enabled (see http://msdn.microsoft.com/en-us/library/cc667410.aspx). So when you are at Stack... and trying to step into, it will actually try, but you don't have the sources for that. There is also a new experience for using the .NET framework reference source that was announced recently: http://blogs.msdn.com/b/dotnet/archive/2014/02/24/a-new-look-for-net-reference-source.aspx
I faced the same problem. I advise at the moment of receiving the information "stack.cpp not found" to look at the stack trace and check if there is something like this: "RTC".
If there is, you need to change the flag along the path (for example, set the Default or a more convenient configuration for you):
Project Properties -> C/C++ -> Code Generation -> Basic Runtime Checks
More details: https://learn.microsoft.com/en-us/cpp/build/reference/rtc-run-time-error-checks?view=msvc-160

Getting the examples in libspotify to work under Windows 7

I want to get started with libspotify on my Win 7 machine but I dont have a clue on how to get it all setup so that I can even run the examples included in the pack. I have a Spotify Premium account and I have tried installing libspotify by copying libspotify.dll to c:\windows, c:\windows\system32 and to c:\windows\SysWOW64 and also changed the path variable to include the path where libspotify.dll is located but I still dont understand how to get the examples to work.
I have Code::Blocks installed but as soon as I try to import and run any of the .c files included in the /examples/ folder I get all kinds of error messages. The truth is that I am not even sure how to install libspotify and the documentation is absolutely non existent so for a beginner it is impossible to even have a chance at getting started.
Is there somebody out there who can do a simple walkthrough on how to install libspotify and get the examples up and running on a Win 7 (64-bit) machine?
The only thing I really want to do with libspotify is to be able to via a command prompt or something like that be able to queue a song in Spotify so I dont really care about the other parts. But I can probably solve that by myself as long as I can get an example up and running.
Sadly libspotify is not well-supported on Windows, in fact the example code won't even build because there is no Windows audio driver for them. Your best bet to just get up and running would be to use mingw, or linux in a VirtualBox environment.

Make netbeans use virtual box guest installation of phpunit

We use netbean's phpunit / unit testing plugins for all our testing. We used to use xampp and point netbeans at our our .bat file from the xampp installation. We recently started using vagrant and are now running our dev environment in virtual box. I would like to make netbeans use the installation of phpunit within the virtual machine. This would save us from having to have both installed. Is this even possible? Netbeans seems to want a file location and I am stumped as to how I can go about doing this.
[EDIT] I've created a custom batch file that uses vbox guestconrols to forward the commands to the VMs installation of phpunit. I am going to then point netbeans at my custom .bat file. My problem is, now, that guestcontrols doesn't seem to be forwarding --bootstrap. It seems to be trying to take it and use it, rather than forward it along. The docs say that all the additional arguments will just be passed on, but that doesn't seem to be the case. Here is what I am using in my my_phpunit.bat :
[my_phpunit.bat]
#echo off
if "%VBoxManage%" == "" set VBoxManage=C:\Program Files\Oracle\VirtualBox\VBoxManage.exe
"%VBoxManage%" "--nologo" "guestcontrol" "<my_vm_name>" "execute" "--image" "/usr/bin/php5" "/usr/bin/phpunit" "--verbose" "--username" "<user>" "--password" "<pass>" "--wait-stdout" "--wait-stderr" "CustomNetbeansTestSuite" "<path/to/test/suite>" "--bootstrap" "<path/to/bootstrap>" %7
I am almost there, as running the bat file without the bootstrap option at the end takes me to the unit test. I am getting exceptions because of some autoloader issues(no bootstrap), but if I can figure out a better way to forward these command line arguments to
[EDIT 2]
I think I've finally solved this, but I need to get some issues with my guest OS in order. Once I've been able to test it a bit more, I'll post the final solution. I solved the Vbox guest control issue by adding "--" before I actually sent the parameters that should be forwarded. It said to do so in the docs, but it wasn't entirely clear to me at first.
I just wanted to update that I never actually got the .bat file to work. I think I got pretty close, but I was hung up on some linux CLI output that I couldn't suppress. The .bat file that I ended up with was:
# .bat example
https://pastebin.com/BX1xnL3q
I ended up moving to PhpStorm and everything worked out of the box. So, if you're still using netbeans, you can try and give that a shot. Maybe someone with more unix / linux experience can fix the issues I was having. I feel I was like 99% there with it.

Silverlight project build fails in VS2010 when project is on a mapped network drive

I am just learning Blend/Silverlight/VS2010/.net/etc. I have a simple project that resides on a network drive. When I tell VS2010 to rebuild the project, I get the following error message:
------ Rebuild All started: Project: MySilverlightApplication, Configuration: Debug Any CPU ------
MySilverlightApplication -> H:\PRJ\VisualStudio\ExpressionBlend\Unleashed\MySilverLightApplication\MySilverlightApplication\Bin\Debug\MySilverlightApplication.dll
C:\Program Files\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets(214,9):
error : Could not load the assembly
file:///H:\PRJ\VisualStudio\ExpressionBlend\Unleashed\MySilverLightApplication\MySilverlightApplication\obj\Debug\MySilverlightApplication.dll.
This assembly may have been downloaded from the Web. If an assembly has been downloaded from the Web,
it is flagged by Windows as being a Web file, even if it resides on the local computer.
This may prevent it from being used in your project. You can change this designation by changing the file properties.
Only unblock assemblies that you trust. See http://go.microsoft.com/fwlink/?LinkId=179545 for more information.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
The project was not downloaded from the Web (I created it using Blend.) After doing some searching, I guessed the problem may be due to .net security settings. I issued the following command:
C:\Program Files\Microsoft Visual Studio 10.0\VC>caspol -m -ag 1.3 -url "file://\\p4dc\h$\*" FullTrust
in the hope that would solve the problem. p4dc is the name of the server machine, h$ is the administrative share for the h: drive on the server which in turn is mapped to the drive letter "H" on the local machine (\\p4dc\h$ is mapped to H in the local machine).
That did not solve the problem. I don't know if my caspol command is correct (I wasn't planning on learning caspol on the fly), it just seemed like a reasonable thing to try. The problem goes away when I make a copy of the entire project on the local C drive but, that "solution" is rather undesirable.
At this point, I don't really know what else to try to solve the problem without moving the project to a local drive.
Any help leading to a solution is much appreciated.
John.
The error message displayed by VS2010 would lead anyone to believe the issue is with trust and security and it is BUT, no amount of allowing full trust on the network drive will solve the problem.
What lead to the solution was first to port the project to VS2008 to find out if it would encounter the same problem. VS2008 was perfectly happy to run the project without complaint.
Then I converted the VS2008 project (which was working) to VS2010. VS2010 refused to build the project but this time the error message was different, referring to "remote assemblies" and to a link on MSDN, which led to the solution.
The real problem is that VS2010 considers an assembly on a network drive a "remote assembly" (the same as if the assembly were being loaded from a web site.) Caspol was not able to solve that problem (it seems it should have but, it may be my fault, I am not well versed in using Caspol).
To end this long story, the link provided in the error message is:
http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx
after following the instructions in that link to edit "machine.config", I changed <runtime/> to:
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
the project built successfully and ran without a hitch.
Thank you to Alison and CodeNaked for their efforts to help,
John.
PS: it would have been rather nice if VS2010 had displayed the "better" error message initially. Instead, I had to port the VS2010 non working project to VS2008 where it worked and that one to VS2010 where I got the better error message that led to the solution.
Not sure if this will help but it's worth a shot: How Do I Allow my Visual Studio .NET Projects to Run from a Network Location?

Resources