I would like to interact with OBS via a c# wrapper.
I have come across the following, which looks like it could help, but I am struggling to get anything to work.
https://github.com/ilosvideos/libobs-sharp#libobs-sharp
It has the following installation instructions, however I am unsure exactly what these mean? I'd like to be able to include the libobs-sharp dll in my project and access the functions it gives, I have tried adding the dll to the C:\Program Files (x86)\obs-studio\bin\64bit folder but this hasn't worked.
Has anyone any suggestions?
Installation
Recommended: Place libobs-sharp to root of the obs-studio directory (obs-studio/libobs-sharp)
Debugging: Use the obs-studio output folder as project working directory (obs-studio\build\rundir\Debug\bin\32bit)
Binaries: In the same directory as other obs-studio output files.
Related
I want to convert my program into something that I can give out and people can use (just to my friends and people I know) but I'm totally lost as of how to do it. I've tried doing lots of things from other forums but none seem to work or actually do what I'm looking for.
I tried using the publishing feature in the build tab but don't like that It makes It into a ClickOnce application as I'd much rather have it as an .exe.
From what I read there is already one of these in the bin\debug folder (I'd use the use the release bin\ folder when I am fully finished) but i don't know how much or what files actually need to be packaged together for it to work on another computer.
My main questions are:
Can I actually make a distributable a application using the bin\debug .exe with all the other files in it?
Do I also need to include the obj and properties folder? (I'm guessing not for the properties but the obj does look kind of important)
Because I've used NuGet packages and references do i have to to include the App.config and packages.config or is this just something that visual studio uses?
sorry if I've got anything wrong with what I've said, I'm way out of my comfort zone here.
For a console application, you should be able to zip up the contents of the bin/release directory and distribute it directly.
You can safely exclude .pdb files from your archive, though they can help you debug the program if your friends and cohorts encounter errors.
I'm designing a script generator using winforms. Scope is to generate few update/Insert queries. I've template of update/insert queries within my project in a folder in format of .text.
text = File.ReadAllText(#"\Visual Studio 2013\Projects\MigrationScript\MigrationScript\Scripts\Schema_OWNER.SYS_PARAMS.txt");
text = text.Replace(Constants.LOWER_VER, lowerversion)
.Replace(Constants.CURRENT_VER, currentversion);
System.IO.Directory.CreateDirectory(string.Format(Constants.DIRECTORY_CCB_SEED_OWNER, releaseVal));
File.WriteAllText(string.Format(Constants.DIRECTORY_CCBOWNER_SYS_PARAMS, releaseVal), text);
It works like charm in my machine. But when i extract the .exe and run in another machine, i'm getting error like System.IO.DirectoryNotFoundException: Could not find a part of the path
How to include external files within the project into my .exe, so that i could run in any machine?? Believe i explained my issue. If not please revert me.
System.IO.DirectoryNotFoundException: Could not find a part of the path clearly states that path is not accessible from the system where your .exe is placed and being run. Make Sure Whatever path you have given should be accessible from the System's where your .exe is supposed to be executed.
I'm developing a Web application that uses a couple XML files to store data. I have their Build Action set to Content, and on install the files are copied successfully to the Applications Virtual Directory:
C:\inetpub\wwwroot\ApplicationName\
The problem I'm having is that writing to these XML files (in order to save settings and things like that) causes a lot of write permissions issues. Therefore to get around it, I'm trying to copy these files from the virtual directory they're installed to to a new directory under the C drive, using the following PostBuildEvent in the Web Deployment Project:
xcopy "$(TargetDir)*.xml" "C:\CompanyName\ApplicationName\" /y
However, this does nothing. I'm not sure if this is because PostBuildEvents in the installer are not actually fired on install, but only on building the installer, or if TargetDir represents the bin directory:
C:\inetpub\wwwroot\ApplicationName\bin\
instead of the root application virtual directory:
C:\inetpub\wwwroot\ApplicationName\
Does anyone have any ideas? Has anyone dealt with this sort of thing before? I'm really stumped on this one.
Update:
I included a PostBuildEvent that should give full permissions to all users:
icacls "$(TargetDir)" /grant Users:F
But it doesn't seem to have resolved the problem.
I'm also unsure where exactly $(TargetDir) if pointing to, if it would be ..\ApplicationName\ or ..\ApplicationName\bin\
All you have to do is give full permissions to the user under whose context the Web Application Pool runs.
You can find this user by starting IIS manager and look at the Application Pools and Identity column
Something like
cacls C:\inetpub\wwwroot\ApplicationName /G Users:F
will give all permissions to this subdirectory to all users on the computer, If you are running under ApplicationPoolIndentity refer here
Turns out there's a much easier way to do what I was trying to do.
Instead of using PostBuildEvents to create a new directory structure and move files there, I added the new directory structure into
InstallerProject > View > File System
after which I located the Content Files from SomeProject entry in my installer project, and changed the Folder value to the newly specified directory structure, in this case
C:\CompanyName\ApplicationName\
This seems to work fine, I'm now able to access these files freely as I originally intended.
Screenshots below are from the Solution Explorer Pane:
I have a class in Folder DataAccess that needs to access a resource in Folder data. I get the following error message.
System.IO.IOException: Cannot locate resource 'data/danio_rerio.xml'.
Does not Work If:
It works if:
Folder data is a child folder within Folder DataAccess. Is it possible for me to use the following syntax:
foldername/somefile.someextension
to access resources within the project that are in seperate folders?
Edit: I do not want to hard code locations to my directories.
When you run your application, the running directory becomes your "active directory"
Suppose you have
c:\myproject\bin\debug\myapp.exe
When you run the application you try to search
c:\myproject\bin\debug\foldername\somefile.someextension
what you actually want could be close to
c:\myproject\data\daniorenio.xml
so you'll want to search the following directory
c:\myproject\bin\debug\..\..\data\daniorenio.xml
The .. operator tells that you want to go back in the directory hierarchy
However this is assuming your binary will be in a lower branch than your ressource. What I actually do is copy everything I absolutely need for runtime inside a special directory such as
c:\myproject\RuntimeRequired
This way I can issue a post build event like this (In Project/Properties/Build-Events/Post-Build)
copy /Y "$(ProjectDir)RuntimeRequired*" "$(OutDir)"
I found the answer myself. Should have searched more before offering a bounty -_-
Pack URIs in WPF [Source]
I have a solution with many projects. There is actually a Core project and a few plugins. I changed OutputPath for all plugins so all binaries end up in the Core bin\debug folder. (this is necessary as the Core do not have a reference on plugins, hence it does not "include" plugins binaries when it is compiled.)
So basically my folder structure is as follow:
Solution
MySolution.sln
Plugin1\
Plugin2\
Core\bin\debug
Each plugin OutputPath is "..\Core\bin\debug". When I open the solution Visual Studio creates a folder "Core\bin\debug" in Solution's folder parent as if the relative path starts from .sln file. However when I build the solution the binaries are output to the correct path ("Solution\Core\bin\debug").
Core\bin\debug
It looks like a Visual Studio bug to me, but maybe I overlooked some option somewhere. Any ideas how to resolve this problem ?
PS: I know this not a critical issue as everything build and works fine, however I dislike the idea of meaningless folder hanging around
Rather than changing the output location of the plug-ins, what you could do is create a post-build script (Properties \ Build Events tab) for them that will copy the them to the Core folder. That would prevent the confusion with output folders.
This command line should do the trick for you:
copy "$(TargetPath)" "$(SolutionDir)Core\$(OutDir)"
If you need to copy .pdb and .config files as well, you can add more lines:
copy "$(TargetPath).pdb" "$(SolutionDir)Core\$(OutDir)"
copy "$(TargetPath).config" "$(SolutionDir)Core\$(OutDir)"
If you really want to do it with a single line, this should also work, though it's not as clean:
copy "$(TargetPath)*" "$(SolutionDir)Core\$(OutDir)"
If you're not using the same output path in both the main project and the add-ons, you'll need to replace $(OutDir) with a hard-coded value. If you have them set to target the typical "\bin\Debug" folder (or have just left the defaults in place), then you can get away with using the $(OutDir) value.
Instead of using "..\Core\bin\debug", use "$(SolutionDir)\Core\bin\debug".