Acess Denied to installed application on Windows 8 - c#

I've developed an application in Visual Studio 2010 but I used the VS 2012 to create the
Setup Installer. It's working perfect when running it on Visual Studio 2012, no errors at all.
Detail: I builded this when I used win7, now i'm using windows 8
But when I install the application and try to run it, when it tries to overwrite the app.config file it throws the exception. I already tried to give permission by RightClick - Security tab but didnt solve the problem. I found THIS thread that looks like my problem. But didnt worked... All I have on my app.config is the connections strings. What may it be?
UPDATE
I gave permissions to Users/PC1 in each file.cfg and to the whole folder that the files are in.
And now it seens that it worked, but what may I do to do not need do all of this to run the applpication ? I want to install without needing to give permission to the folders and files. (It's a win8 complications... -.- ).

It sounds like a permission issue, mostly with the project folder potentially.
You should try the following steps:
Run Visual Studio as an Administrator.
Verify that your User Account can Read / Write to your project folder.
Ensure that your Local Service, Network Service, or Local System
Off the top of my head those would be what I would try, more then likely Visual Studio isn't able to modify your app.config which would be tied to your Local Service account- The one that would be tied to your System.
Though the inner content isn't the problem, it is tied to your Directory Permissions which may be inherited to the sub-folders and sub-files.
Hopefully that helps.

Related

Visual Studio 2015 Update 2: Registration of the app failed. (0x80073cf6)

I'm experiencing the Registration of the app failed. (0x80073cf6) error.
What I've tried so far:
Delete the package in AppData (I can't find it anymore there, the package family name has been changed to my associated store listing).
Repair Visual Studio
Acquire developer license
Make a new project (that works, for the 1st time, after that same error).
It happens on my phone (950XL, developer unlocked) and on my machine.
I can't debug my app in anyway now.
I'm on Update 2 of VS 2015
In the question, the project-type is not specified, but I think, it can be the same problem, I have...
I have installed VS2015 Update 3 RC and created a Xamarin.Forms shared project from template (without any changes in the project).
Same error for UWP- and Windows 8.1 projects, where Windows Phone 8.1 works in the emulator.
I store my project on a network-drive (what never was a problem with earlier .forms-projects, that have not included UWP- and Windows 8.1-projects).
I have changed the Output path from \bin\debug\ (=sub-directory of the project folder on the network drive) to C:\Temp\Debug and... the error has gone.
So.. it seems as (at least Xamarin-) UWP- and Windows8.1-projects have a problem, when the output-directory points to a network drive.
This is not a final solution for projects on a network-drive, but a workaround to be able to develop until the real problem can be solved (I hope for some changes in VS or a clear advice, what to change regarding the rights of the network drive to solve the problem from MS).
<Properties>
<DisplayName>Name</DisplayName>
<PublisherDisplayName>Other Name</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
In the app manifest file, change the "Name" to anything else. And it'll work.
That is it.

Unable to find the runtime directory

In advance, apologies for any improperly used terminology... I'm fairly new to web development/hosting, and IIS
I am trying to host a 64 bit ASP.Net 5 (MVC 6) web application, which uses beta 7, via IIS 7.5 on a windows Server 2008 R2 Standard machine.
I am publishing from Visual Studio 2015 (on a Windows 8 laptop) to a shared folder on the server. My IIS web application's physical path is the wwwroot folder created in the publish directory and the website seems to attempt to launch correctly...
Whenever the site attempts to run, however, I receive an error which states the following:
Unable to find the runtime directory 'D:\www\mysite\wwwroot\..\approot\runtimes\dnx-clr-win-x64.1.0.0-beta7'
Possible causes:
The runtime was not packaged with the application
The packaged runtime architecture is different from the application pool architecture.
The frustrating part is that if I copy and paste the link IIS claims it can't find and paste it into Windows Explorer, it leads me to a directory which does exist. That rules out the first explanation. As far as the second explanation goes, I have checked my publishing profile in Visual Studio and ensured that it is indeed the 64bit version of beta 7.
As far as I can tell, the proper runtime is sent with the published files, and they are the correct versions.
Is there anything I'm missing? The application runs fine in Visual Studio 2015. I don't know why when running on IIS it can't find a folder which not only exists, but is readily available to be browsed to.
UPDATE: I've continued to fight with this problem and found some odd symptoms... I can successfully make a website application from just about anywhere other than the D:\www folder. I stuck my site's published files container directly into the D drive and made a site directly from that, and it launched without a hitch. I was also able to replicate this on the C drive, and even placed the published files container into a folder called "wwww" in the D drive (so its physical path was D:\wwww\MySite\wwwroot as opposed to D:\www\MySite\wwwroot).
Does anybody know why "www" is problematic in particular? The folder structure in place here has several other (albeit much older) websites running from the www folder, so it's ideal that this application is placed in the same area. It seems like it works everywhere but there, however.
Any help is much appreciated!
For what it's worth, the solution I went with was to not place the application's publish folder in the D:\www folder. I ended up simply creating another folder in the root of the D drive and pointing the web application in IIS to that.
One of possible causes might be insufficient permissions for IIS user.
I added permission for approot (runtime) folder for IIS_IUSRS to read. Looks like IIS user was unable to read and load content of this directory because of insufficient permissions. After that it worked fine.

Installing a Windows Service -Setup.exe fails

There is a weird issue I am facing. I created my first windows service looking through various blogs and tutorials.
Then created setup for that adding installer etc. It works fine while installing , un-installing via Visual Studio but it fails when i deploy it .
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\bhuvint\Documents\Visual Studio 2010\Projects\CPNS Library\ServicePackage\CommonPushNotificationWindowsService.application resulted in exception. Following failure messages were detected:
+ You cannot start application CommonPushNotificationWindowsService from this location because it is already installed from a different location.
+ You cannot start application CommonPushNotificationWindowsService from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application it is already installed from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application. You can start it from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application or you can uninstall it and reinstall it from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application.
I have already un-installed the service and trying to install it from the deployed service in the same pc to test. But it fails with above error.
I feel i have deployed the windows service the wrong way. Could you guys please suggest how to deploy a windows service ?? (I have looked through net. All suggest building it and installing it from visual studios. But how to publish it is the thing which i need.)
Please help asap.
Possibly you built the setup project before uninstalling the preovious service. In that case you can't use the new setup to uninstall the service, since the setup won't be the same and can't be able to access the service installed.
You should try to go to a previous version of your project and uninstall the service and for the future unistall the service each time you're building your setup project.
This happened to me several times.
Run visual studio in debug mode, and in your properties of your service project goto tab build events in Post-Build event command line and add a -d so you can run your service without installing it, it will run as an console app
The LocalService account acts as a non-privileged user on the local computer, and presents anonymous credentials to any remote server. Use the other accounts with caution, as they run with higher privileges and increase your risk of attacks from malicious code.
If your service application will not install correctly, check to make sure that the ServiceName property for the service class is set to the same value as is shown in the installer for that service. The value must be the same in both instances in order for your service to install correctly.
NoteNote
You can also look at the installation logs to get feedback on the installation process.
You should also check to determine whether you have another service with the same name already installed. Service names must be unique for installation to succeed.
STUPIDITY PERSONIFIED
As i told i was deploying my service. So this published code had a "setup.exe" file to it. Now I had already created a setup project for the windows service , which i was using for the installing , uninstalling . And i din't know (These words needs courage !!) that msi file created is required to install the windows service. So as i got through the folder structure of the setup project. I came across the .msi file . And hence the problem got solved. The Main problem was :
Me not knowing to use setup projects
And I confused setup.exe with the published windows service with the setup of windows service.
I am really sorry for stealing bandwidth off your precious time. Thanks to all for the valuable inputs.

Published application cannot start, but release/debug version starts well

I have a problem when I try to Run published Application. When I Run Release or Debug Version from VS (key F5) everything work well. So I try to publish my application (no problem). After this I Installed application by oneClick installer. Instalation was finished without problem, but when I try to run this installed application, I only see message: Program has Stop Working.
Please, does anybody know where should be a problem? It´s really wierd, I suppose, when the application run correctly from VS, then it Should run after installing to!? Or am I wrong?
Or is there some option to reset Publish settings in Visual Studio?
Thanks a lot!!!
It depends how you have ClickOnce setup, but the main reason this happens is the ClickOnce system encounters an error while checking for updates or running the .application from the remote location.
It should give you the option to see a log of the problem (or at least the nasty temp file it threw it in).
From here you can determine the problem ClickOnce is having.
Most Common Problems I would Suspect:
The User's having trouble communicating thier auth token / credentials to the web server the ClickOnce app is on.
There's another web-related issue downloading the app manifest or .application from the server
Group / Local Policy Problems
Broken install in on local machine's ClickOnce somewhere causing it to have problems overwriting on disk or finding an appropriate location to setup the clickonce package.
Broken install in on local machine's ClickOnce causing a GUID Conflict (I.e. your app and the broken install can't be upgraded, but share the same GUID)
Antivirus / Firewall blocking access to the web component from the executable clickonce deploy.
These are all the problems I've encountered with ClickOnce and the reasons we've primarily moved away from it to a Wix style installer.

Deploying windows application in Visual studio 2010 Express

I have developed a windows application on C# in Visual Studio Express 2010. Now I want to deploy it.
I used publish to deploy but when I run the project it get error on the form where I have used some external files which I am using for I/O operation, read and write files.
How do I resolve this error? I am also using one folder for files.
I'm a big fan of using WiX for installers - even if you've got Visual Studio Pro with the built in MSI creation tools
http://wix.sourceforge.net/
the benefit of WiX is that you can do most anything, from the super simple to very complicated. The tool is great b/c you can get started quickly and then move up (adding dialogs, etc) as your app gets more popular.
One trick for installers - consider using VMWare/HyperV, install a test OS then take a snapshot of the OS before you install your app. IF everything works, great - you're done. However if something isnt right, roll the OS back to the pre-install snapshot, fix the bug, and try it again.
Add those external files to the project
Right Click the external files in your VS Set the Build Action as Content
Copy to Output directory to CopyAlways
Then try deploying
That may be due Windows 7 UAC permissions. Despite the fact that current books, msdn and even the snippets in Visual Studio teach methods of file IO, most are not correct when taking UAC into consideration.
All of your file operations should take place in UAC safe zones such as
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
You cannot read or write to files in the C:\Program Files (x86) directories unless you have elevated your app to run with higher privileges.
If you install your application and right click the executable and select Run As Administrator and everything works the problem is UAC.
If you haven't coded around UAC limitations I highly recommend reading up on it. It will save many headaches down the road.
http://www.codeproject.com/Articles/17968/Making-Your-Application-UAC-Aware

Categories