Cannot read configuration file in visual studio, can this be fixed - visual-studio

I trying to use Visual Studio as I required to learn .NET and visual studio as part of new job. Normally I program everything in Notepad++ (PHP/javascript) because it just works fine for me.
I have been on for three days trying to install Visual Studio, finally got it to install with the components required, as you can imagine my experience so far of Visual Studio is not too great.
Sound cliche but following a nice simple tutorial to get the basics out of the way, as you do.
When I click to debug or the IIS Express button I am greeted with this error.
I have tried restarting the project
I have tried restarting Visual Studio
No matter how many projects I create I get the same error.
I have been trying to fix this for hours now, I have turned on IIS in windows features. I am missing something, do I need to un intall wampp (which isnt actually running)?
The folder I create has no permissions and is accessible however the read only box is always ticked even if I uncheck this and apply settings.
I have tried manually creating a site in IIS manager, and again I get this error on authorization.
The server is configured to use pass-through authentication with a
built-in account to access the specified physical path. However, IIS
Manager cannot verify whether the built-in account has access. Make
sure that the application pool identity has Read access to the
physical path. If this server is joined to a domain, and the
application pool identity is NetworkService or LocalSystem, verify
that \$ has Read access to the physical path.
Then test these settings again.
Any help would be amazing as I'm pulling my hair out here.

This is likely due to file rights. I have run into this when I am trying to run my code that lives on a network share, or more commonly when it is living on the host and I am running Windows in a Virtual Machine. I would confirm that you have sufficient disk space, the code is living on a local drive, that the folder is not read-only and that the running user has rights to write to that folder.
It looks like you are running from a folder on your Desktop folder. This should be fine. If you got that code from a Git server sometimes the files come down as read-only. I would confirm that the "Current Work" folder is not read-only nor are any of its children. I would also go into the Security tab of the folder's properties in Explorer and grant "Everyone" full control (probably safe since this is just a developer environment). Test after each of these.

Related

Visual Studio 2015 Update 3 installation failed

I have a problem with installation Visual Studio Professional 2015 Update 3. I don't know what cause the problem, but setup is failed every time in each setup configuration. Setup manager shows me following error and warning:
Microsoft Visual Studio Services Hub
The system cannot open the device or file specified
I really don't know how to solve this problem. Does anyone know what is wrong and how can I install this program?
Greetings
SOLUTION
I know what was the problem! I didn't check thoroughly the default location where Visual Studio wants to install. On my PC I have installed a 64-bit Windows 7. After many tries of installation I saw that installator chose wrong Program Files folder. It tries to install Visual Studio in Program Files (x86) (dedicated for 32-bit programs). I really don't know why VS installator chose a default folder for a 32-bit programs while my VS is a 64-bit version and also Windows is a 64-bit version.
I hope that this solution will help someone who has the same problem.
Most likely this is because of Windows Installer cannot access the %TEMP% folder (I had similar error once, but with MSSQL setup). So:
First of all check if you %TEMP% environment variable points to the
right location
Then check if the account which is running VS setup has privileges to
access TEMP folder. Better yet, make sure you run setup as
administrator
Finally make sure you have disabled all disk or folder encryption
features
Also just to be sure disable any antivirus software you have running
The error message “The system cannot open the device or file specified” often related to the specific folder is encrypted, you can have a look at this article and try the following methods:
Save the VS installer file to a folder that is not encrypted
Install the VS to a folder that is not encrypted
Turn off encryption on the %temp% folder
To check the encryption of the specific folder, you can right click the folder and select ‘Properties’— ‘General’ tab, click ‘Advanced’ button and confirm the checkbox of ‘Encrypt contents to secure data’ is checked or not.
You can click the ‘log file’ in the VS installer screen that you shared, and find the specific folders that these 2 components ‘Microsoft Visual Studio Services Hub’ and ‘Visual C++ IDE Common Package’ stores and check if those folders are encrypted or not.

Creating directories from a web site

I am using .NET MVC3 to create a website. which will be used to make some file operations at server machine. Right now I am in development process so i didn't have it on IIS. I am working on Visual studio 2010's development server. I am having trouble with creating a directory in App_Data folder. Users need to be able to create folders in App_Data(or somewhere appropriate) and upload files in those folders. all users will be my friends so there is no security problem. But it says access denied :/ and i can't seem to find to grant related permissions. When i looked for it i found that granting "aspnet machine" user with read/write permissions would do it, but i don't have that user on my computer I don't know why:/ Should I move my application to IIS to make it? or is there any other thing that I don't know? By the way all my files in my pc are read only and i can't seem to change them neither:/ maybe it's because of that. But anyways i need a workaround for this issue.
Any help is appreciated. Thanks in advance ;)
Scenario: when you debugging your asp.net application from VS, your project running under "ASP.NET Development Server" tool (It means that tool has the same permissions as Visual Studio, also you may find it in tray);
Scenario: You may use FileMon from Sysinternals and see filesystem activities;
Scenario: Deploy to IIS and create new AppPool with your own user (grand permissions to App_Data directory).
Best Regards.

Every time I open my project I have to create virtual directories

I am currently working on a solution which has an ASP.NET application and a Web Service. Whenever I open this solution I get the message that the virtual directories for this project have not yet been created and must be to continue. The problem is, if I hit OK, it cannot create the directories because they already exist and then I cannot load the project. Looking in IIS I can see that the virtual directory exists in C:/Inetpub/wwwroot/ProjName. If I delete this from IIS, I can then open the project, but it creates the virtual directory in C:/location of project folder. When it uses the project's location, I am not able to connect to the site or the web service.
The same thing happens on XP with IIS 5.1, VS 2010 and Server 2003 with IIS 6.0, VS 2010. Similarly, it happens on colleague's machines, so I am convinced that it is a setting in VS, and not IIS or my machine.
Right now, my solution is to delete the virtual directories, open the VS solution, delete the virtual directories, and publish the projects with the publish toolbar in visual studio (not the web tab in project properties).
I fear that I've at some point messed up a setting on both of the projects, but it has been some time since I've been working around this. I've scoured all of the settings and I can't find anything that fixes this behaviour. I need to pass the project along to someone else, and I feel as if the work around instructions may be confusing so I want to fix this.
I used to do things similarly back in the days when VS didn't have its own dev server - re: directly work on web projects in a local version of IIS (if memory serves, this was called "Personal Web Server" or PWS - am I advertising my age?)
Anyway, I haven't (thankfully) done that since VS (2005?) got its own dev server...
Try this process in VS 2010:
You can develop your solution on any local folder in your file system. You can run/debug your solution from VS (ctrl f5 or f5 respectively) - it will use VS dev server by default. Your development machine doesn't even need to have IIS...
After you are done developing and debugging (using VS and its dev server), you can publish to IIS or even to some other "publish folder" in your (local) file system, and simply copy the files to whatever (local/remote) IIS virtual (ASP.NET application) folder you prefer.

IIS Express on a shared development machine (rdp)

I have a problem which I thought could be common, searched the web for it but found nothing.
We're using a shared development machine, and every developer connects through RDP and has his own profile, desktop, etc.
The problem I am encountering is with IIS express. Since it is configured at user level (applicationhost.config inside documents/iisexpress/config) and the port configured must match the one declared in the .csproj file, two developers can't possibily run on the same port, as it gives the error "the port is already in use".
So to make it work we have to manually change the port both on the csproj and in the applicationhost.config for every developer, but it's only a temporary fix as when we commit our changes to SVN, the csproj file gets merged, so we have to do this process every time someone commits/updates.
My question is: is there a clean way to use IIS express with Visual Studio 2010 on a shared development machine?
Thanks.
Partially tested answer. Not sure how it'll work on a multi-user workstation. It might give you, or someone else here, a jumpstart to a proper solution that works best in your existing environment.
It appears that Visual Studio stores all the web configuration in the csproj/vbproj and IISExpress stores its configuration in %userprofile%\Documents\IISExpress\config\ApplicationHost.Config.
Normally, we store the csproj files in source control, but ignore the csproj.user file so that each person may have some unique settings, such as the web configuration.
Each user who signs into the box must have their own profile.
Each profile must have their own copy of the source code.
Each user's copy of the source will contain their own csproj.user file.
Ignore .**proj.user* files in your source control.
Copy the web settings into the csproj.user by unchecking the option Apply server settings to all users and then commit to source control.
Each user who pulls a copy of the source will have to configure their web settings, use a unique port that the others users are not using, and uncheck the box above so that their configuration is not passed on to the other users.
Doing this, Each profile will have their own IIS Express ApplicationHost.Config configured with a port that is different from the other profiles. Each user's copy of the source will have a csproj.user that is configured with the same port in their profile's IIS Express configuration.
For reference:
I've tried changing IIS Express's ApplicationHost.Config to use a different port than what Visual Studio expects and Visual Studio is unable to connect the debugger to IIS Express.
How IIS Express's configuration works: http://msdn.microsoft.com/en-us/library/ms178109.aspx
The best option you can use is to take advantage of the Import functionality built into MSBuild.
Essentially, you would create a seperate build target for each user. You can then import this target from this referenced file directly. I would then recommend creating this file on the server (for each user), but leaving it outside of source control.
This should allow each user to have a custom IIS port without conflicting with others.
I think you can create subdomains for each user and implement the required changes and do the testing. In this way each user can his own subdomain and port and hence work independently on the shared IIS Express.
You probably won't like my answer but here's my thoughts:
As you noticed, the configurations are tied to the user profile and not the server; this is because IIS Express is not intended to be used as a shared development server. You should be using full IIS.
I do not see any benefit or reason to use the same physical box for development. Admittedly, I don't know all the details of your scenario with licensing or workstation resources, but it doesn't seem like you gain much from having everyone RDP into the box to use Visual Studio - each person still needs a license, performance will be slower, and you shouldn't be working on the same project instance.
You should seriously consider your entire setup for development:
Each developer should use Visual Studio on their workstation, and debug/test there using IIS Express (configured with the same ports and settings across all machines - very easy).
From there, your developers should check their code into source control, and examine conflicts that may or may not arise. I'm not sure about SVN but the MSBuild automation available in TFS can be use to setup a continuous build policy that deploys to a common IIS installation so that your merged code is tested and usable from the full IIS installation mentioned above.
Anything else would be a workaround/hack that will bite you in the butt later.

VS 2003 Reports "unable to get the project file from the web server" when opening a solution from VSS

When attempting to open a project from source control on a newly formatted pc, I receive an "unable to get the project file from the web server" after getting the sln file from VSS. If I attempt to open the sln file from explorer, I also receive the same error.
Any pointers or ideas?
Thanks!
This question is very old so you have probably solved the issue, but just in case: Does the project file use IIS? If so then it is probably trying to read the project file from IIS and the virtual directory does not exist on the newly formatted computer. Also, there should be more detail about the message in the Output window when you open the solution which should help you find the cause. With VS2003, you also need to add your user account to the "Debugger Users" and "VS Developers" and possibly the account that is running the AppPool (possibly Network Server, ASPNET, or IUSER_xxx). This may depend on the type of authentication you are using as well. Occasionally I had to add those group permissions the the virtual directory location as well. It's been a while since I have used VS2003 with web projects though.
Try deleting the .csproj files (back them up first though).
Is there anything odd in your sln file? Have you opened it with a text editor to see if it is linking to a remote resource?

Resources