How to run an ASP.NET web forms application with missing Web.config and and packages.config files?

230 views Asked by At

I'm collaborating on an ASP.NET web forms web application where there is no "Web.config" and no "packages.config" files. How can I run this application locally ?

1

There are 1 answers

0
James Skemp On

Assuming you have a project file, such as *.csproj, you can search within that to find any libraries referenced. By default NuGet packages will be placed within a packages directory, and will look something like the following:

<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
  <Private>True</Private>
</Reference>
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <HintPath>..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
  <Private>True</Private>
</Reference>

In the above case you have Microsoft.Web.Infrastructure, version 1.0.0.0 and Microsoft.AspNet.WebPages, version 3.2.3.

This will also suggest the version of .NET being used.

Replicating a web.config is much more difficult, since it could contain application settings, database connection strings, secured paths, etcetera. For that it would be best to just ask the other collaborators where the web.config is.