Deploying MVC project to remote iis server with Umbraco - asp.net-mvc

I'm running into an issue where I'm trying to publish through Visual Studio, but publishing the site doesn't copy out the App_Data folder, which causes the site to crash when it's run, because it's trying to write to a file that doesn't exist. To remedy this, I figured I could just manually copy out the App_Data folder, which did help, however there are still files not present, for example this is my current error:
C:\inetpub\wwwroot\myapp\App_Data\TEMP\PluginCache\umbraco-plugins.{machine-name}.hash' is denied
Which tells me that Umbraco isn't writing out the new files for the remote machine it's now running on. My question then is, how do I get Umbraco to generate all the files it needs to generate to run properly?

Make sure you have the correct file permissions set that are required by Umbraco:
/Web.config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/App_Code Modify / Full control
Should always have modify rights as the folder and its files are used for dynamically loading in and generating dlls
/App_Data Modify / Full control
Should always have modify rights as the folder and its files are used for cache and storage
/Bin Modify / Full control
Needed for installing packages, if no packages are installed, this can be set to read accees only
/Config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/Css Modify / Full control
Should always have modify rights as the folder and its files are used for css files
/MacroScripts Modify / Full control
Should always have modify rights as the folder and its files are used for Razor files
/Masterpages Modify / Full control
Should always have modify rights as the folder and its files are used for template files
/Media Modify / Full control
Should always have modify rights as the folder and its files are used for media files uploaded via Umbraco cms interface
/Scripts Modify / Full control
Should always have modify rights as the folder and its files are used for script files
/Umbraco Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/Umbraco_client Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/UserControls Modify / Full control
Modify rights are needed for installing packages
/Views Modify / Full control
Should always have modify rights as the folder and its files are used for template, partial view and macro files
/Xslt Modify / Full control
Should always have modify rights as the folder and its files are used for macro files

Figured it out, first off in App_Data, remove everything in there except packages, then go into iis and on your site, right click, edit permissions -> Security tab -> edit -> Add -> Add the name of the site (myapp, myapp.com, etc.), give full control, and your problem should be solved, the site will be able to generate any files it needs to generate.

Related

Unable to copy file 'source' to 'destination' while building application in visual studio 2022

I am working on Web API Project in ASP.NET Core using .NET 6.0. I have also added some features of MVC to view the data. Everything was working fine. Suddenly, while modifying the project, i have tried to build the application, i have received error
Unable to copy file
"D:\Soliton\Applications\MachineManagement\ServerAPI\MMAPIApp\MMAPIApp\obj\Debug\net6.0\apphost.exe"
to "bin\Debug\net6.0\MMAPIApp.exe". Access to the path
'bin\Debug\net6.0\MMAPIApp.exe' is denied.
I have tried to give rights to everyone to the source and destination folders.
The path 'bin\Debug\net6.0\MMAPIApp.exe' is an executable file, and not a directory. Whatever you modified, you probably inputted the incorrect path. You probably meant bin\Debug\net6.0 as this would be a valid directory path to copy a file to.

MSIX: Set Installation Path

How to change the MSIX installation path??
Referred this url - "https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes"
Always installer package is created in default location "C:\Program Files\WindowsApps"
Need to set the installer location to different location.
The installation path of an MSIX package cannot be changed. All the files you have included in your package are installed inside an app-specific folder under "C:\Program Files\WindowsApps<your app>\".
This is a design decision from Microsoft. Only for MSI/EXE installers you can change the install path.
If you want to add files in other folders too, you need to copy them the first time your application is launched. For that, you have multiple options. You can write your own code inside your application to copy the files in other folders or you can use tools like Advanced Installer to do it for you.
To understand more about MSIX and how files outside of the installation path can be managed I recommend this article/presentation I wrote last month.

Can you use Java JPackage to create own Windows installer without using its way of running application

Background, I currently use Izpack for my Windows installer, I bundle a java runtime and use winrun4j as a wrapper both for the installation and the actual program once installed. It worked for a long time but there are a number of problems with the installer that I have not been able to solve and have been looking to replace it.
Oracle now provide the JPackage installer so it seems like a sensible choice. But the folder structure created by the installer is different to what I currently have, I have a number of config and non java files and I have not been able to get the .exe that JPackage creates to do anything.
So is it possible to use JPackage to create the installer but in a strcuture better matching my existing structure, and use continue to use WInRun4j to actyally run my application
Existing Folder Structure
ROOT
---App.exe
---Config Files
---lib
-------jar files
---JVM64
------- Java runtime
---help
JPackage structure
ROOT
---App.exe
---Runtime Dlls
---app
----- jar files
Config files
--runtime
------Java runtime
------Runtime Dlls (again)
The structure of directories generated by jpackage is mainly set up for you and does not seem possible to change, and makes installation of Java app dependencies very easy with self contained JRE. The basic structure for Windows is as you say:
ROOT
---App.exe (for --main-class parameter)
---xyz.exe (for each --add-launcher parameter)
---Runtime Dlls (these appear to be unused except for applauncher.dll, see SO 62607300)
---app/
------App.cfg (for --main-class)
------xyz.cfg (for per --add-launcher)
---runtime/
------Java runtime
------Runtime Dlls
With --input and --main-jar params you are free to setup additional directory structure under app/ folder for anything else you want for your application. So if you used lib/myappjar.jar it would add:
---app/
-------lib/
----------myappjar.jar
If you used --input build\mypath it would copy the entire tree of files under that folder, so if build\mypath dir contained
bin/
---Scripts
---xyz.properties
README.txt
Then app would also contain:
---app/
------bin/
---------Scripts
---------xyz.properties
------README.txt
By the way the Runtime DLLs placed at top level appear to be copies of some of the DLLs under runtime/bin
[https://stackoverflow.com/questions/62607300/why-is-java-jpackage-installing-windows-dll-files-in-two-places]

Teambuilding and deploying a dll (e.g. wpftoolkit.extended.dll)

The app I work on needs to use the wpftoolkit.extended.dll (i.e. no source, no msi/installer, we've only got the dll). So far we've placed the dll in a c:\libs folder on both the dev's laptop and the teambuild server and it built ok on both; now for deploying we want to add it to an installer (.vdproj) and we think we'll need it in tfs's repository somewhere. However, when tested the app now only builds on the dev's laptop and not on the teambuild server (looks like a relative path thing).
So... rather than fixing the actual problem, I'm wondering what's the best/cleanest/commonlyAccepted way to do this? where should I keep the dll in the repository and where should I place the dll on the host we're deploying to?
You should use folder structure on the source control like the following
/Main Contains the .sln file
/Source
/MyApp1 Contains MyApp1.sln file
/Source Contain folder for all
/ClassLibrary1 Contains ClassLibrary1.csproj
/MyApp1Web Contains Default.aspx
/Build Contains build output (binaries)
/Docs Contains product docs etc
/Tests
**/3rdpartyDlls** Contains all vesions of third-party dlls
For more information about the source control folders and best practices, it's recommended to read the book patterns & practices Team Development with TFS Guide (Final Release)

Can i run Erlang without local admin rights on Windows?

I have a machine which doesn't give me local admin rights. Is it still possible to run erlang on it, as I cannot run a windows .exe installer to install erlang?
You can copy erl.exe (plus the runtime system and all the libraries you need) from another installation and run it without the need to install. As long as you are allowed to execute files it should be okay.
Forgive me for not being as smart as Zubair,
but I would like to know exactly how to do this.
I do not have admin privilege, cannot run installers, and cannot copy files to C:\WINDOWS.
In particular, I cannot write to C:\WINDOWS\WinSxS or C:\WINDOWS\system32.
How do I get a list of exactly what libraries are required by the various erlang executables ?
I have all the MS redistributable libraries and manifests,
but I don't know where to put them to make it work.
The redistributable library structure has directories such as
Microsoft.VC90.ATL, Microsoft.VC90.CRT, etc. Each directory contains relevant dlls and a manifest.
Do I copy all the contents into the ERL_HOME\bin directory or ERL_HOME\erts-x.y.z\bin or ERL_HOME\erts-x.y.z\lib ?
or leave them in some other directory and put those entries in the PATH ?
or do I need to build the paths implied by the manifests (i.e. where they would be copied into the WinSxS cache) using hashes and version numbers in the paths, then put those entries in the PATH ?

Resources