I have a project in visual studio written in C# that uses ABCpdf to create a PDF page count. I set the install to be instanced as the project is deployed on a server and the project is run without admin rights as our IT department does not want to have a GMSA with admin privs to run it (it runs as a nightly windows task schedule). My issue is the application fails when it tries to generate the PDF due to access denied when installing the license. If I run the application as administrator on the server it runs fine, so it's definitely something to do with no admin rights when installing the license (or other aspects perhaps to run).
My code for installing looks like this:
try { string sResult;
if (WebSupergoo.ABCpdf11.XSettings.InstallRedistributionLicense("<license string>"))
{
sResult = "License Installed Successfully: " + WebSupergoo.ABCpdf11.XSettings.LicenseDescription;
}
else
{
sResult = "License Installation Failed";
}
<does other formatting things for the pdf creation after this in the try catch>
Does anyone know how to get this working without admin rights, or do you know the specific task or registry item it modifies so I can give the GMSA access just to that without full privs? Any help would be awesome. Thanks in advance!
Related
I have a app which gets installed in C:\Program Files{AppName} and a service associated with that app (NT Service{ServiceName}). This app asks for uac prompt during the installation and the service shows Elevated = "Yes" in task manager. Now, I need to update this app silently without getting uac prompt. I tried the below code which didnt work (Update didn't go through and no log file got created).
Process.Start(
new ProcessStartInfo("msiexec")
{
ArgumentList =
{
"/i",
"new_version_file_path",
"/qn",
"/L*V",
"Log_file_path",
},
UseShellExecute = true,
});
I thought that since the service is showing to be running in elevated mode update should go through. If I add my service to the local Administrators group then the installation runs fine and the app gets successfully updated. Why do I need to add it in local administrators group ? Is there another way I could update the app using c# without using any 3rd party application?
We had a Jenkins job running without issues for a couple of months now but recently it started failing.
It has this error when running form Jenkins:
CSC : error CS7028: Error signing output with public key from container 'Container_ID' -- The file exists. [lgw0hqij.tmp_proj]
It seems to rename the file every time.
I have logged into the host and executed as the user but it gives no error when running normally.
Once I run the user as an administrator, it starts giving the issue.
Running the application from Visual Studio does not give an issue at all!
I have tried running Jenkins as a LocalService as well as a lower privileged user, but same result.
I have also followed this, but doesn't seem to help.
I'm running out of ideas
EDIT
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
For anyone facing the same issue in the future. This error is linked to the user account temp folder
C:\Users\<username>\AppData\Local\Temp
Once you clear this folder, your msbuild should be working fine
I want to open one document file on our website. For that I write following code.
try
{
Process proc = new Process();
proc.StartInfo = new ProcessStartInfo(Server.MapPath("~/Quatation/PREMIUMQUOTATION1.doc"));
proc.Start();
}
catch (WebException we)
{
}
It runs locally very fine but web on web server it gives me an error like
System.ComponentModel.Win32Exception: Access is denied?
Please suggest, what should I do?
I had this problem when my .NET Target Framework was set to 4.5.2. I fixed it by changing the target framework version to 4.5. To do this using Visual Studio 2015, open Solution Explorer, right click on your solution and click Properties. The "Target Framework" should be set to ".NET Framework 4.5". Additionally, if you previously built with a target framework other than 4.5, you may have a <compiler> section in your web.config, and this may throw an error when you build. Just remove this section to fix the issue. Removing it should not cause any problems.
I wrote a short article about this here that has a couple other things to try that didn't work for me but might work for you.
Also check out This Stack Overflow answer which also helped numerous people with this error!
may be your SQL server is off
check it in services and start it
It sounds like you haven't changed the service logon user. You can do it from service control manager by right clicking the service and go to the Logon tab.
Then add user as Service Logon User
Or you can do it from the command line:
sc config ServiceName obj= Domain\user password= pass
Note the space between obj= and Domain\user it is not a typo. It is required. The same for password=.
My problem solve with this
In IIS Manage->Pool Application->Advance Setting->Identity
change to Custom Account and set Administrator User
Goto windows explorer and right click on the folder "~/Quatation/". Select properties and pick the Security tab to give permissions. In the case where your application pool under which the web application runs is using a domain account, you will need to give that specific domain account permission.
I faced the same issue while running my website from local IIS, after spending some time reading the project properties, found that, certain changes to the project properties were not saved...
Once it was saved, the error went away...
I got this error while I was working in visual studio 2017, using dotNet framework 4.5, in MVC project...
If you are getting this exception maybe you don't have the administration rights to your system so check with your admin and ask for the rights. If you do have administrator rights please open your IDE(e.g Visual Studio as an Administrator).You might also get this exception if you are trying to access the processes of 32 bit configuration system but your system has 64 bit configuration.
I am using .Net 4.5.2 and IIS 8.5.9
In IIS Manage->Pool Application->Advance Setting->Identity change
ApplicationPoolIdentity to Custom Account and set Administrator User
I have a c# console application running daily as a scheduled task.
Recently I've added a new functionality to send an e-mail with an attached pdf report, using Access 2010 built-in pdf export:
using MsAccess = Microsoft.Office.Interop.Access;
//(...)
AccApp = new MsAccess.Application();
AccApp.Visible = false;
AccApp.OpenCurrentDatabase(DBPathname, false);
AccApp.DoCmd.OutputTo(MsAccess.AcOutputObjectType.acOutputReport, "GMB_CSS_Report", "PDFFormat(*.pdf)", ReportFilename, false, Type.Missing, Type.Missing, MsAccess.AcExportQuality.acExportQualityPrint);
//(...)
When I run the new version interactively on the command line it works well, exporting the report as a PDF to the designated path\file.
But when I run it from task manager, using the same credentials, it crashes on the DoCmd.OutputTo(...) statement with the error:
(System.Runtime.InteropServices.COMException) Microsoft Access can't save the output data to the file you've selected.
That does not make any sense, as the application successfuly writes several other files to the same folder, running either from the console or from the task manager.
I've also found that the application runs without the error as a scheduled task on a third PC, not integrated in the company AD domain (the production and dev hosts are on the domain), even though all 3 hosts have the same s/w level (Win7 SP1, Access 2010 updated to latest patches via Windows Update).
This is bizarre... am I missing something here ? Any suggestions will be greatly appreciated.
Thanks in advance.
I think that your problem is in the "PDFFormat(*.pdf)" constant string.
The right one for PDF is this:
public const string acFormatPDF = "PDF Format (*.pdf)";
And this is for RTF:
public const string acFormatRTF = "Rich Text Format (*.rtf)";
I still have got problems with the same function on a 64Bit version of Access 2010 running on Windows 2008 Server 64Bit, while it works perfectly on a Windows Server 2003 machine 32bit with Access 2010 32bit.
I am trying to uninstall a program from my visual studio project but that seems to requiere me to run vs as an admin....so i tried doing this from the cmd to debug it .
I have managed to uninstall a msi setup project installation with this command from cmd :
msiexec /x {3A40307D-6DF2-4412-842F-B1D848043367} /quiet , but that only works when i start cmd as an admin, without admin rights it wont uninstall. What am i doing wrong and is there another approach to get the result I want?
I want to be able to silent uninstall an application without having to ask the user to login as an admin.
Edit:
This is the result from the log :
Error 1001. Error 1001. Unable to delete file C:\ProgramData\XXX.InstallState.
DEBUG: Error 2769: Custom Action _F6174138_B428_4AB6_9FEF_C4DD7A69BDC0.uninstall did not close 1 MSIHANDLEs.
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _F6174138_B428_4AB6_9FEF_C4DD7A69BDC0.uninstall, 1,
CustomAction _F6174138_B428_4AB6_9FEF_C4DD7A69BDC0.uninstall returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Action ended 17:54:40: InstallExecute. Return value 3.
Action ended 17:54:40: INSTALL. Return value 3.
MSI (s) (F0:3C) [17:54:40:355]: Product: XXX -- Removal failed.
That error from the log file indicates that a custom action is crashing. You'll want to investigate the root cause of that issue. My guess is that the custom action requires elevation (admin privileges) to work correctly but is not marked deferred (i.e. runs during the part when the MSI is elevated).
If you launch the uninstall of the MSI from Add/Remove Programs (Programs and Features) then you should not be prompted for elevated credentials. Thus the root issue probably is this custom action.
It appears you have several options here. All of them require creating an msi that doesn't require Admin privileges from the start. If the msi requires them from the start (eg, you have no control over the creation of the msi), there is no way around it. It all depends on what files are being edited as to whether or not admin rights are really required. Check out this answer: How can I create a windows installer MSI that does not require admin access