Error Installing Custom DNN Module - c#

I have created a custom DNN module, but it fails when I install:
A critical error has occurred. Could not find file 'C:\inetpub\wwwroot\Customers\RevIndex\RevIndexDNN.Web\Install\Temp\hlivdv1q\Test.dnn'.
Here are the steps I took:
I created a module with this manifest called test.dnn:
http://pastebin.com/qKVqNYEg
I zipped up the project and it looks like this:
I placed the zip folder in the Install/Modules folder. I went to host > extensions and I clicked manage. I selected the Install/Modules/MyModule.zip folder and I received this error:
A critical error has occurred. Could not find file 'C:\inetpub\wwwroot\Customers\RevIndex\RevIndexDNN.Web\Install\Temp\hlivdv1q\Test.dnn'.
Why can't it find my manifest?
My site is running as local system and I uploaded it from my desktop.

Often times this is a bit misleading. I would start by checking to ensure that the ASP.NET worker process is able to write to the root of the site and all child folders.
The reason for this assumption is that since it knows it is looking for Test.dnn it was able to read the zip, just couldn't read the physical file that should have been put on disk.

Go to the Host/Extensions page, choose the Install Extension Wizard and upload the ZIP file for your module (from whatever location you have it at)
From there you should see if there are any errors and hopefully get a more detailed log of the problem.

Related

Access to path denied while reading a dll from Program Files which is actually got from a nuget package

Access to path denied error is encountered in Program files (x86),
while working with a DLL that is got from nuget package: AODL for reading ODF files - https://www.nuget.org/packages/AODL/ after I created a MSI file using SETUP Project
In the code, I don't suspect the file creation part for I create this file in the user chosen file conversion path but NOT IN PROGRAM FILES folder path:
File.WriteAllText(targetFileName, sb.ToString(), Encoding.UTF8);
That's why I simply suspect the DLL, please let me know how I could find the error and fix this.
A bunch of directories - both Programm Files, the root directory of the System Drive, Windows - are heavily protected by NTFS rights. Writing them is usually a plain "no-go". Unless you run around with full administrative rights - wich only Instalers and very rare Adminsitrative tools should even consider - you will not be able to write there.
However you indicated this happens on a read. Reads being blocked like that is very unusual. You need to check what rights are set on those folders and why. Maybe the installer accidentally copied the rights from your computer, wich only makes sense with your users and groups? Maybe Windows or a third party broke those rights? Not a lot of options I can think of that could apply here.
For this application, even for reading the DLLs from the Program Files folder I needed Admin rights so I forced the application to have such rights for execution.
The below line for the newly created application manifest file is changed and that solved the issue.
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
The fix is explained well in How do I force my .NET application to run as administrator?
The reasons are stated well in https://stackoverflow.com/a/50588465/129130

C# exe not working once installed to program files folder via Wix

I have a C# winforms application which will not work once installed to the C:/ProgramFiles folder. I use an MSI created with Wix to install. When either double clicking the exe or right clicking and running as admin this window pops up and then nothing happens:
Application Error Message:
The application works in Visual Studio and when accessed via the bin/Debug folder of my VS project (the exe in the Debug folder is the one I am using for the Wix install).
After the MSI installs, if I copy the exe out of
C:/ProgramFiles to one of my user folders (ex: C:/Users/User/Desktop) the exe works.
I am guessing this is some sort of UAC/permissions issue but I cannot find any documentation to confirm that theory. Any direction would be much appreciated.
EDIT:
Looking at the error log it is denying me access to my config file. Here is the error text:
Access to the path 'C:\Users\*username*\AppData\Roaming\Leer Copy\leerConfig.xml' is denied.
EDIT II:
This problem is getting more confusing (and frustrating). It will allow me to write to the AppData folder but not read from it (shouldn't it technically behave the other way around?)... Would really appreciate some help. I am reading the contents of my XML file via XDocument.
Originally had hid the config file so people do not mess with it/accidentally delete it. Making the file not hidden fixed the access denial and everything works how it should now.

"There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined"

I am developing a project using vstudio 2015, when i tried to run it on another system i am getting following error, tried many solutions available here but unable to get rid of this.
Note: another systems has same configurations as of mine.
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 Unknown
Handler Not yet determined
Error Code 0x80070003
Config Error Cannot read configuration file
Config File \?\D:\Visualstudio Projects\SPARC\SPARC\web.config
Requested URL http://localhost:1396/
Physical Path
Logon Method Not yet determined
Logon User Not yet determined
Request Tracing Directory C:\Users\Syeds\Documents\IISExpress\TraceLogFiles\
Config Source:
-1:
0:
More Information:
This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
If you see the text "There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined", this error is because you are running a .NET Framework 3.5-based application in .NET Framework 4. If you are running WebMatrix, to resolve this problem, go to the Settings node to set the .NET Framework version to ".NET 2". You can also remove the extra sections from the web.config file.
Warm welcome for suggestion and answers,
Thanks & Regards.
Restarting visual studio might help on this.
This usually happens when you have invalid configs in your {solutions_dir}/.vs/{project_name}/config/applicationhost.config. This file contains machine specific configuration.
.vs/* directory should be added to your gitignore if you are using git. So the contents of this directory never gets pushed to the main repo.
If this will not work.
Open the file {solutions_dir}/.vs/{project_name}/config/applicationhost.config.
Go to the sites section
Check the application if it matches the physical path that is configured for each site applications. IISExpress will look use the phyiscalPath as its based directory per application.
In my case Actual issue was directory, to solve it what i did was creating same folder directory (as in my system) into other system.
IIS was trying to find webconfig in D:\Visualstudio Projects\SPARC\SPARC\
So, i created folder "Visualstudio Projects" in D: and then pasted the project there and it worked..
There was no any problem in web.config or applicationhost.config or in any of the IIS configuration.
I have this issue when I have same project file (Solution file) in two separate folder. The project properties was same and port number for IIS Express was same. The issue is resolved when I created new virtual directory.
Change project URL in Project>Properties>Web>Servers>Project Url.
Please create new Virtual Directory.
Try open your web.config and search for a tag named <scriptResourceHandler>
Can you find more than 1 result?
If yes, try merging the two "scriptResourceHandler" to one.

ActiveX CAB Error during setup

Okay, so I've been building a c# activeX control and have run into EVERY issue in the book during the process...That being said, I have everything squared up now except the installer
Before I can delve into the issue itself, I need to explain how my setup process is working and why I have chosen this route.
I have a signed CAB file that stores my setup exe, which is loaded through a web page using an object tag
The setup exe is an InstallShield LE project which has my project embedded inside of it (i.e. the files to be installed are a part of the final setup binary)
The CAB file has an INF file in it which tells the caller to run the setup exe to install the control
This process runs just fine and launches the setup application, which then does successfully install the control. However, near the end of the setup process users who are NOT administrators receive an error message stating the following:
An error occurred while copying file myINFFile.inf
Cannot copy file to destination directory.
Click Retry to retry the operation or click Cancel to
(yea, it just cuts off after the word 'to')
If you hit retry it does nothing but repeat the error over and over until you hit cancel. If you hit cancel it says something to the effect of 'Would you like setup to continue in spit of this error?', which then goes on to successfully install the control.
As this error only happens to users with limited permissions I believe the issue is that the cab extraction process cannot extract the inf file to the location it's trying to extract it to...it's just very annoying because this file serves no other purpose, especially during the installation process, but I cannot figure out why the issue is happening or how to work around it...
Use process explorer (by Microsoft/SysInternals) to see what files are written.
My guess is that you did not author setup properly to allow per-user install of you ActiveX control.
(by Robert Petz) If you add the following hook to the INF file it runs correctly and extracts the cab to a allowed location:
[Deployment]
InstallScope=user

Visual Studio Moving a Content File on Publish

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.

Categories