What's the correct procedure for deploying WinForms / WPF Applications which use SharpDX.Direct3D11.Effects v3 NuGet package?
They seem to depend on two unmanaged DLLs:
sharpdx_direct3d11_effects_x64.dll
sharpdx_direct3d11_effects_x86.dll
Should these be copied to the output directory? As a post build step or otherwise?
After we publish the WPF/WinForms applications from Visual Studio, it will generate an Application Files folder which contains .dll.deploy files.
I installed the SharpDX.Direct3D11.Effects package in my WPF application. And after I publish this application, I found the sharpdx_direct3d11_effects_x64.dll and sharpdx_direct3d11_effects_x86.dll will generate sharpdx_direct3d11_effects_x64.dll.deploy and sharpdx_direct3d11_effects_x86.dll.deploy files in Application Files folder. We need not to copy to them to output directory.
If the depend on DLLs are not include in your Application Files folder, please configure them through Project Properties -> Publish tab -> Application Files to set the Publish Status for these Dlls as Include.
Related
As the question states, How can I create an .EXE file from .NET Framework 4.8 project? This is a Windows Forms Application.
When I publish my application, I get the following files/directory created:
I can run the setup.exe file to download the application, and from there can open the application from my system or through the TapeRedGreen.application file.
Many other users have had an issue in their project properties where there output type is set to Class Library, but I can verify mine is set correctly:
I would like to instead have a TapeRedGreen.exe file that will run the program/application, avoiding having to run the setup/install .exe. How can I do this?
You can just build the application and then look in the output folder (under the bin folder of your project).
The target folder will have the same name of the configuration selected for the build (debug or release).
The last row of the output console will give you the full path.
A quick tutorial from Microsoft:
https://learn.microsoft.com/en-us/visualstudio/ide/walkthrough-building-an-application?view=vs-2022
I have a project that I wish to publish. currently, I hardcode some reference files (.json,txt, and .ico) to be used in my project, which reside in a folder on my desktop for testing purposes. now that I feel I'm close to a version 1.0 release I want to migrate my resources to a applications folder upon install. basically want to create these files when the app is installed.
2 big questions I have is how to reference to the application folder that doesn't exist yet, and how do I publish the setup project.
I have the setup project installed for VS2019, and followed a quick and brief blog on how to use it. but I haven't found out how to publish that setup project. I can publish my project with my actual code in it, but I cannot publish the setup project.
below is a screenshot of the setup project. and i will add screenshot of my settings for the reference file.
Add the files into subfolder of your project and in the options part in Visual studio set that files will be copied to "debug"/"release" folder.
You will have an output folder with all what you needs and can be shippable.
When deploying a ClickOnce from the VS a folder is created under bin/$(configuration) and the name of this folder is app.publish.
Inside that now, there is an other folder called 'Application Files' and inside that there are all the version folders with the required dlls and exe for the application.
The question is: Where does the ClickOnce gets the files to add them to the version folder? And most important when this process is made?
Thanks,
GM
UPDATE #1
The issue though is that i am obfuscating some of my dlls but the published files are not the correct ones. The dll i obfuscate is obfuscated in Release folder but not in the published folder.
The obfuscation is made in .csproj with postbuild commands.
First, you can read the official documentation.
When you create the list, the file will be copied.
DOCS
How ClickOnce deployment works
The core ClickOnce deployment architecture is based on two XML manifest files: an application manifest and a deployment manifest. The files are used to describe where the ClickOnce applications are installed , how they are updated, and when they are updated.
Deploy ClickOnce applications
After it is created, the deployment manifest is copied to the deployment location. This can be a Web server, network file share, or media such as a CD. The application manifest and all the application files are also copied to a deployment location that is specified in the deployment manifest. This can be the same as the deployment location, or it can be a different location. When using the Publish Wizard in Visual Studio, the copy operations are performed automatically.
Are there plug-ins or reference files in your assembly, you should add them in the [application file], as shown below:
In the above interface, change the required file release status to "include".
In the above interface, copy the required files to the output directory and change it to "Always copy", so that you can ensure that your DLL or some reference files can be released with your program.
I wrote a fairly simple application with C#/.NET and can't figure out a good way to publish it. It's a sort of a "tool" that users would only run once, or run every few months. Because of this, I'm hoping that there is a way I could deploy it where it wouldn't need installing to run (it could just be run by double-clicking an EXE file straight after downloading).
However, it still needs (somehow) to include the correct version of .NET, libraries, etc. so it will run correctly. I know this is included when using ClickOnce, but that still installs the application onto the user's computer.
Is there a way this can be done?
EDIT - \bin\Debug
myAppName.application
myAppName.exe
myAppName.exe.config
myAppName.exe.manifest
myAppName.pdb
myAppName.vshost.application
myAppName.vshost.exe
myAppName.vshost.exe.config
myAppName.vshost.exe.manifest
extraLibrary.dll
as well as two folders
app.publish
Resources
It is possible and is deceptively easy:
"Publish" the application (to, say, some folder on drive C), either from menu Build or from the project's properties → Publish. This will create an installer for a ClickOnce application.
But instead of using the produced installer, find the produced files (the EXE file and the .config, .manifest, and .application files, along with any DLL files, etc.) - they are all in the same folder and typically in the bin\Debug folder below the project file (.csproj).
Zip that folder (leave out any *.vhost.* files and the app.publish folder (they are not needed), and the .pdb files unless you foresee debugging directly on your user's system (for example, by remote control)), and provide it to the users.
An added advantage is that, as a ClickOnce application, it does not require administrative privileges to run (if your application follows the normal guidelines for which folders to use for application data, etc.).
As for .NET, you can check for the minimum required version of .NET being installed (or at all) in the application (most users will already have it installed) and present a dialog with a link to the download page on the Microsoft website (or point to one of your pages that could redirect to the Microsoft page - this makes it more robust if the Microsoft URL change). As it is a small utility, you could target .NET 2.0 to reduce a user's probability to install .NET.
It works. We use this method during development and test to avoid constantly uninstalling and installing the application and still being quite close to how the final application will run.
First, you need to publish the file by:
BUILD -> PUBLISH or by right clicking project on Solution Explorer -> properties -> publish or select project in Solution Explorer and press Alt + Enter
NOTE: if you are using Visual Studio 2013 then in properties you have to go to BUILD and then you have to disable define DEBUG constant and define TRACE constant and you are ready to go.
Save your file to a particular folder.
Find the produced files (the EXE file and the .config, .manifest, and .application files, along with any DLL files, etc.) - they are all in the same folder and type in the bin\Debug folder below the project file (.csproj).
In Visual Studio they are in the Application Files folder and inside that, you just need the .exe and dll files.
(You have to delete ClickOnce and other files and then make this folder a zip file and distribute it.)
NOTE: The ClickOnce application does install the project to the system, but it has one advantage. You DO NOT require administrative privileges here to run (if your application follows the normal guidelines for which folders to use for application data, etc.).
I have a project that uses CEFSharp and I am using a windows deployment project to create a setup. When I compile the program, during the build process, it copies the .pak files and creates the "locales" folder in the debug/release folder as found here.
https://github.com/cefsharp/CefSharp/wiki/Getting-Started
I can add the .pak files as dependencies, but is there a way to create the "locales" folder and copy the appropriate files there?