Running Visual Studio with Elevated Privileges for Azure : any way to avoid the side effects? - visual-studio-2010

I'm working on some Azure web apps, and in order to debug I'm running VS 2010 as Administrator (I normally right click the shortcut and run-as-admin, I'm aware that there are properties I can change or use Ctrl-Shift).
Windows Azure Tools for Microsoft Visual Studio - The Windows Azure compute emulator must be run elevated. Please restart VS in elevated administrator mode in order to run the project"
If I do this, Azure simulator works OK, but I get two other side effects.
1) I can't drag and drop onto the solution explorer. This is a pain. (Ctrl C/V works but I can't drop whole files into the solution explorer)
2) I develop inside of a DropBox file structure. If I've developed on my desktop, and grab my laptop, projects in my Azure solution that are created within, and shared with, other non-azure projects fail to load. Edit: If I develop outside of dropbox, zip a copy into dropbox, unzip that on the new machine, its all fine.
3) I get "Could not load file or assembly. Access is denied" for various DLL's used by the project - I can fix this for individual DLL's by giving permissions to Network Service but I get the error for resource files too and the same trick doesn't seem to work.
This interworking between machines works fine without elevated privileges - I've been doing it for 2 years on about 20 projects without issue.
So is there a way of running just the compute emulator elevated, or some other way of avoiding these side effects?
OS Version Win 7 Pro SP1 X64
Azure Tools for MSVS2010 Platform v1.4 (11/04/2011)
Windows Azure SDK (11/04/2011)
Windows Azure SDK 1.4.1 Refresh (11/04/2011)
Windows Azure AppFabric SDK V1.0 (29/06/2011)
Consistent over all machines
EDIT: Having already given Network Service user all permissions to the entire folder structure to the project, I get the following error. Prior to doing that, the error was similar, but was for access to the DLL's in the project's bin folder.
Parser Error Message: Access to the path 'C:\Users\ Beko2011Azure\Website\App_GlobalResources\EditorLocalization.uk-UA.resx' is denied.
Source Error: [No relevant source lines]
Source File: /App_GlobalResources/EditorLocalization.uk-UA.resx Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319;

As far as #1 goes, you can still CTRL+C and CTRL+V to the solution explorer. For everything else you described, the elevated priviliges are probably not the problem. This has especially nothing to do with Azure tools. I have them installed on several machines, and VS works elevated (I always use elevated mode because it's impossible to debug in IIS otherwise). I never had any problems with it.
The DLL/file access denied might be Dropbox's fault. Have you succesfully used this type of file structure in any other projects?
I have no idea what you meant by #2. What fails to load? Azure projects? And do you have the SDK installed on all machines? Same version? Did you mark a web site as hosted in IIS - this also prevents loading of projects.
Also, please update your post with: Operating system version, Azure SDK version...
Update: looking at your error message I can't help but wonder the problem is caused by Dropbox locking files that are needed, and these files then not being accessible by IIS when required. Could you try killing Dropbox service and checking to see if the application performs OK at that point?

As of Azure SDK 2.1 you no longer need to run the Emulator with Elevated privileges. See my answer here

Related

Visual Studio unable to download installation files

I simply wish to install Visual Studio 2017 to compile a project.
Trying to install via the installer obtained from Microsoft fails after being unable to obtain the .opc file from aka.ms (found that after checking logs in %Temp%)
Moved to a full install version with all files and .opc file present. Installer still attempts to download from the web. Fails saying it is unable to download.
Tried running installed with --layout pointing toward the location of the offline files, same error.
Installed certificates from the certificates folder both in Personal and Trusted Root stores, no difference.
Tried starting CNG Key Isolation service, fails with error 1053
Microsoft support transferred me three times before saying the problem is on their end, so how, if one were to have no internet connection and evidently has all files required for install available, install this, if the installer stubbornly attempts to download from the web?
Is there a KB I am missing or some procedure I have to follow with the full installers?
In my case it is the network firewall blocking the downloading because the downloading involve not only main Microsoft visual studio site which is allowed in our network but also some url like https://aka.ms which is blocked by our firewall.the error is listed in c:\users\myusername\appdata\local\temp\dd_bootstrapper_xxx.log
It appears from what you have submitted you are attempting to download a offline copy of Visual Studio. It also appears that you are attempting to run the file originally downloaded to create the bootstrapper for the installation.
You want to instead launch the setup executable which is actually in the layout folder.
Hope this helps. ^^
Appears the cause for this was the service disclosure debug, disabling the debug, binding all services back into the svchost and after rebooting the service is working again. I have been able to install VS now.

How to Deploy a Windows Service using Visual Studio 2017 Community

Working with VS2017 Community I have written a service that works on my local machine. I followed the instruction here:
https://learn.microsoft.com/en-us/dotnet/framework/windows-services/walkthrough-creating-a-windows-service-application-in-the-component-designer
and installed it successfully using Installutil.exe (as per instructions in above link). All good.
I now want to deploy that across six servers in our organisation. In Microsoft's documentation about installing services (https://learn.microsoft.com/en-us/dotnet/framework/windows-services/how-to-install-and-uninstall-services) it says:
If you’re a developer who wants to release a Windows Service that users can install and uninstall you should use InstallShield
and links to a page that applies to VS2012 (can't post any more links as my reputation<10)
I have downloaded and installed the "Microsoft Visual Studio 2017 Installer Projects" package, which allows me to create a Setup Project. When I run it, it installs the project output correctly (i.e. copies the exe & dll files to the correct folder in Program Files) but does not create the service.
There's a detailed post about deploying services on this site (question 9021075) but when I follow those instructions I get a 1001 error on Install.
All the documentation I can find refers to earlier versions of VS or the previous Installer package, so I'm not even certain if I can do it with the software I am using.
So, with VS2017 Community using Microsoft Visual Studio 2017 Installer Projects, how to I create a stand-alone Installer to deploy a service that works correctly when installed locally using InstallUtil?
Or can I use InstallUtil on the target machines? I think I'd need to install Visual Studio on them for that, which I'd prefer not to. Is there a quicker way?
I only have 6 servers to install this on, so even some manual work-around might do.
Thank you for the responses. I now have a solution. I found InstallUtil on the Target Server (in my case it was in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 but search will find it). I copied and added that to my project as content so when I now deploy it, I have InstallUtil in the same folder as my EXE.
To install, I run CMD as admin, cd to project folder and issue command:
installutil.exe myService.exe
This is a one-off task. Once the service is working, to update it I just need to stop it, upload the new myService.exe (& any DLLs) to overwrite the old ones and restart it again.
Further information about settings you're using for the serviceProcessInstaller1 and serviceInstaller1 files will be needed to debug this issue, as the 1001 error raised by the installer is a generic error.
An alternative way of doing this is to use Topshelf, which is a framework for hosting services written using the .NET framework. It simplifies the creation of services, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Alternatively, you could use InstallUtil.exe. It is part of the .NET Framework, so no need to install Visual Studio.

Can I install Visual Studio without Admin rights?

I use a machine where I don't have administrator rights. I've been able to run programs without admin rights by extracting the program's .zip file to a directory I have created on my desktop. However, I can't find such a .zip file for Visual Studio.
Is there a way to install Visual Studio Community Edition without administrator rights?
Practically no. Visual Studio (Express and above, excluding VS Code) consists of multiple components that must be installed as admin, and will be required for the app you're debugging to be available as system-wide component. It might be possible to use ThinApp or its equivalent, but ThinApp can't even work with VS 2010 and it was by far the best of its class.
A (resource intensive) alternative to get VS on any PC will be packaging a VM with VS installed, either creating one yourself or get a ready-made ones. VirtuaBox is available as portable fork if you can't even get Hyper-V tools installed. But this still require kernel drivers installation, which means at least one-time admin access. Depending on your internet connection & budget, it might be more practical to setup a VPS with VS installed, then remote there.
Basically, youre going to need to download an iso of windows, then download QEMU, and run it as invoker by doing that batch file thing (https://techcult.com/how-to-install-software-without-admin-rights/). Set it to anywhere, and then figure out how to boot it to QEMU cause I have absolutely no idea how (ive only done it with Kali Linux). and just install VC on there. Sorry about being so vague.
There is no way to install or use Visual Studio on Windows without admin rights. You can either use a different program to write your code in and then compile using a different compiler. Or use qemu (since it does not require admin rights) to run a windows virtual machine.

Error debugging worker role in Azure

All the sudden started getting the following error while trying to debug a worker role:
"Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the role instance 'deployment16(360)blah blah' with Process Id: '8780'. Unable to attach. The Microsoft Visual Studio Remote Debugging Monitor has been closed on the remote machine."
Restarting Visual Studio and the machine do not help.
As you start getting this problem all of sudden in your development machine something must have changed and it is mostly due to some of the OS auto-update and/or some application update you installed in your machine. There could be any random reason for this problem however if I would have hit the exact same problem here is what I would do to troubleshoot such issue:
To start, first thing is to just check it is not an application specific problem by creating a base app from web/worker template and see if that exhibit the problem.
If you have installed new release Windows Azure SDK 1.7 check with both SDK 1.6 and 1.7 to verify if both exhibit the problem.
Check if your could debug IIS based application as well outside Compute Emulator. This will isolate if the problem is specific to Windows Azure development Fabric or bind to your IIS itself.
If this is IIS specific issue, Check IIS configuration for all enabled functionalities, try resetting Application Pool configuration, running "ASPnet_regiis -i" etc to fix the issue.
If it is Windows Azure Computer Emulator specific, I know sometime OS updates may make application unstable so in that case, I will re-install .net 4.0 and VS2010 SP1 again respectively. (This does help so many time) then re-install Azure SDK 1.7 completely.
Such random problem mostly occur due to some change in your machine configuration, so restoring the VS2010 and the re-installing all other application does help to solve problems.
If you have an exception in the role's OnStart() or in Application_Start() that the debugger doesn't pick up, you may also receive this message. Application_Start() errors are especially pernicious because the debugger doesn't attach to the web process until after this method returns.
If you are wedded to cloud specific classes such as RoleEnvironment and cannot make the web role a startup project, you can use Ctrl-F5 to run the cloud project without debugging. With some luck you'll get a yellow screen of death to show you the true error.
Avkash covers the points.
I had the same issue recently. I set my web project as start-up rather than Azure and I discovered that that web project didn't actually run. Turned out somehow when of my projects was compiling for X64. I changed that and it worked.

Unable to run Visual Studio 2008 using Administrator account

I'm not able to run visual studio 2008 by choosing 'Run as a Administrator' it says 'Application Cannot start'. Any solutions please.
OS : Windows 7 64 bit
IIS 7.5
I've just come across a similar problem myself, where an external tool won't work when VS is run as admin. On my case, the tool tries to access a mapped network folder. Turns out that the mapping applies only for the non-admin login token. Does you VS happen to access a mapped network folder?
See: Programs may be unable to access some network locations after you turn on User Account Control in Windows Vista or in Windows 7. Link includes a possible solution.
BTW, the problem here is probably not VS-specific. Since it seems to regard Windows permissions, it should probably have been asked on ServerFault.

Resources