Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to create a new web project in Visual Studio 2013

Background:

I am trying to use my office machine, where I have some limited rights, from home. All products are installed through when I was connected with my network drives, where my profile exists.

Now, I am at home where I don't have an access to these network drives.

Problem:

Whenever I am trying to create a project in visual studio I am getting the following errors:

---------------------------
Microsoft Visual Studio
---------------------------
Package 'ProviderPackage' failed to load.
---------------------------

Finding:

After doing some research I found that it is due to IISExpress. I have ensured that from Tools > options > Web project that IIS express is not enabled for all new web project.

I also got an error as:

---------------------------
Microsoft Visual Studio
---------------------------
Configuring IIS Express failed with the following error:

Filename: redirection.config

Error: Cannot read configuration file

---------------------------

Then I realized that may be it is not able to instantiate with IIS. Then I have tried to run an IIS express from the command prompt and I got this error:

C:\Program Files\IIS Express>iisexpress.exe

An error occurred while reading configuration information. Make sure that the configuration file \NAUNSW001\MalhAm\IISExpress\config\applicationhost.config exi sts, it is accessible, and contains valid configuration information.

I don't have an access to the registry where this path might be picked by the IISexpress.

I have tried to execute the IISexpress /path: c:\vs\ it worked. However, even then also when I am trying to create a new project I got an error as:

---------------------------
Microsoft Visual Studio
---------------------------
Configuring IIS Express failed with the following error:

Filename: redirection.config

Error: Cannot read configuration file
like image 537
codebased Avatar asked Jul 05 '14 04:07

codebased


People also ask

How do I create a new project in Visual Studio 2013?

To create an empty solutionOn the menu bar, select File > New > Project. On the Create a new project page, type solution into the search box. Select the Blank Solution template, and then click Next. Enter Name and Location values for your solution, and then select Create.

How do I create a new Web project in Visual Studio?

Creating the Project. Open Visual Studio. Select New Project from the File menu in Visual Studio. Select the Templates -> Visual C# -> Web templates group on the left.

How do I create a new project from an existing project in Visual Studio?

On the File menu, select New > Project From Existing Code. Specify your project location, the directory for your source files, and the kinds of files the wizard imports into the new project.


2 Answers

Alright - I am able to find the workaround.

If you find this error coming then probably it is to do with the IISExpress or IIS configuration that you may not be able to control from home.

The workaround that I have found is that:

  1. Create Project,
  2. System will not be able to attach the project, however it has been created. Then browse to that directory where the project has been created, and open the project file in the notepad or any editor.
  3. Make sure that <UseIISExpress>false</UseIISExpress>
  4. Before modifying further in the project file, Create a virtual directory in your IIS and point to the project path.
  5. find <WebProjectProperties> in your project file config.
  6. Define the virtual directory path under IISUrl.

Your config file should look something like this:

<WebProjectProperties>
          <UseIIS>True</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>0</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>
          <IISUrl>http://localhost/YourAppAlias/</IISUrl>
          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
like image 112
codebased Avatar answered Oct 01 '22 04:10

codebased


Please use the following path :

Go to MyComputer>Documents>IISExpress>config>applicationhost.config

Right click on applicationhost.config and go to "Properties" option. Now click advanced button and uncheck Encrypt contain security data.

Hope this will solve your problem...!!! :)

like image 41
Sumit Avatar answered Oct 01 '22 03:10

Sumit