Cannot start the web project because administrative privilege’s are required..

While troubleshooting ASP.NET web form project, I hit by this error;

The solution is to Unload  and edit project properties. Delete these lines;

<DevelopmentServerPort>4192</DevelopmentServerPort>
<IISUrl>http://localhost/CPSWEB</IISUrl>

from this XML segment;

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
	…..
	----
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

Reload project and it should work fine.

Resources

https://stackoverflow.com/questions/13454705/running-iis-express-with-admin-privileges

The Web Application Project is configured to use IIS

The web project in solution file is unavailable. Project reload show this message;

Here is the solution;

IIS Manager is required to run this web app and IIS Express doesn’t have IIS Manager or any UI. Following solution will work on IIS Express.

When you open Visual Studio and get the error message, right-click the project Solution Explorer and choose “Edit {ProjectName}.csproj”

In the project file, change the following line:
<UseIIS>True</UseIIS>
to
<UseIIS>False</UseIIS>
Save the file.

In my case it was this;

<UseIISExpress>true</UseIISExpress>

Now reload your project.
Done.

You’ll then be able to open your project. If at this point, you want to use IIS, simply go to your project properties, click the “Web” tab, and select the option to use IIS. There’s the button there to “Create Virtual Directory”. It may tell you that you need to run Visual Studio as an administrator to create that directory, so do that if needed.

Resources

https://stackoverflow.com/questions/10889421/the-web-application-project-is-configured-to-use-iis-the-web-server

Git Merge in VS2019

  1. Open project in VS 2019.
  2. Go to menu item “Git” at the top and select “Manage Branches”
  3. There will be a list of your local and remote branches.
  4. Select branch “version2” and right mouse and select the item “Merge ‘version2’ into ‘master’ on remote branches

Sync your branch. That’s it.

nuget package restore

If you are using private feed then make sure you have installed this;

https://github.com/Microsoft/artifacts-credprovider

I ran this command in powershell (admin mode);

iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1'))

I have to run this command to restore packages;

dotnet restore –interactive

This command will open up a window and ask you to login to Microsoft website with a code. Login to https://microsoft.com/devicelogin and enter the code. This will do some sort of IDE verification. Close VS and reopen. You should be able to see all of your custom and nuget packages restored.

I found this alternative today;

dotnet restore projectName

This will restore the packages.

From within Visual Studio you can use the Package Manager Console to also update the packages. This has the benefit that any PowerShell scripts will be run as part of the update where as using NuGet.exe will not run them. The following command will update all packages in every project to the latest version available from nuget.org.

Update-Package

You can also restrict this down to one project.

Update-Package -Project YourProjectName

If you want to reinstall the packages to the same versions as were previously installed then you can use the -reinstall argument with Update-Package command.

Update-Package -reinstall

You can also restrict this down to one project.

Update-Package -reinstall -Project YourProjectName

The -reinstall option will first uninstall and then install the package back again into a project.

Close and restart VS. Hopefully this will restore the packages.

Another problem might be yellow triangle icon next to package references. To solve this, make sure you are targeting same framework in multiple projects. Here is a discussion about this;

https://stackoverflow.com/questions/20186216/why-do-i-get-a-warning-icon-when-i-add-a-reference-to-an-mef-plugin-project

Resources

https://github.com/dotnet/sdk/issues/10189

https://stackoverflow.com/questions/6876732/how-do-i-get-nuget-to-install-update-all-the-packages-in-the-packages-config

Visual Studio licensing and pricing

There are two models. Subscription based and Volume licensing program; The subscription-based pricing is on Microsoft web site;

https://visualstudio.microsoft.com/vs/pricing/?tab=business

Professional = $45 per month

Enterprise = $250 per month

Microsoft has partners that might be able to help you in lowering subscription pricing by applying discounts that are not available to general public. In one instance I have been offered Enterprise edition @2,500/year for 5 developers.

Estimated pricing for volume licensing program (5 developers);

This program has one-time payment. This is a perpetual license and if software assurance is involved, you are eligible to get newer version. MSDN subscriptions are usually valid for two years. MSDN renewal is a recurring expense and cost about 20-30% of software cost.

Here is the breakdown;

Professional

The minimum limit here is 5 because there is no MSDN subscription.

Microsoft Visual Studio 2019 Professional – License – 1 User – Microsoft Open License – Single Language – PC

$496.57 x 5 = $2,482.85

Professional with MSDN

Microsoft Visual Studio Professional Edition with MSDN – License & Software Assurance – 1 User – Microsoft Qualified – Microsoft Open Business – All Languages – PC

$1,080.87 x 5 = $5,404.35

Enterprise with MSDN

Microsoft Visual Studio Enterprise With MSDN – License & Software Assurance – 1 User – Volume, Microsoft Qualified – All Languages – PC

$8,638.64 x 5 = 43,193.20

If budget is a constraint and wanted software assurance then I will suggest to go for Professional with MSDN. You can pick whatever suits you.

There are 3rd party vendors offer lower rates but not sure how that will work out. Here is one.

Resource

https://visualstudio.microsoft.com/vs/pricing-details/

https://docs.microsoft.com/en-us/visualstudio/subscriptions/volume-license