简体   繁体   中英

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

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM