简体   繁体   English

从现有的 Azure Web 应用程序创建 Visual Studio 2019 项目

[英]Create Visual Studio 2019 project from existing Azure Web App

I have a v7 Umbraco instance as a Web App on Azure but the machine the dev copy was on has been decommissioned and I need now to recreate the dev site in Visual Studio 2019, ideally cloning it from the live site in some way.我有一个 v7 Umbraco 实例作为 Azure 上的 Web 应用程序,但开发副本所在的机器已退役,我现在需要在 Visual Studio 2019 中重新创建开发站点,最好以某种方式从实时站点克隆它。 I have created an empty project and, using the cloud explorer, downloaded the files from the app, but I am unclear whether I just copy them directly into the solution folder or into their own subfolder of the solution folder or whether simply copying them in will do the trick anyway as there's still the database to consider as well.我创建了一个空项目,并使用云资源管理器从应用程序下载了文件,但我不清楚我是直接将它们复制到解决方案文件夹中还是将它们复制到解决方案文件夹的它们自己的子文件夹中,还是只是将它们复制到无论如何都要做这个技巧,因为还有数据库需要考虑。 I'm afraid I haven't used Visual Studio since creating this site three or so years ago and I seem to have forgotten most of what I did then anyway, so any help wpuld be greatly appreciated.恐怕自从大约三年前创建这个网站以来我就没有使用过 Visual Studio,而且我似乎已经忘记了我当时所做的大部分事情,因此非常感谢任何帮助。 The only advice I coud find via google was for older versions of VS and so not much help.我可以通过谷歌找到的唯一建议是针对旧版本的 VS,所以没有太大帮助。

Recreating the original project from the live site is probably not going to be possible.从实时站点重新创建原始项目可能是不可能的。 It depends how and what you deployed to the live site.这取决于您部署到实时站点的方式和内容。

It sounds like what you have is a working live site, but have lost access to the original source code.听起来您拥有的是一个有效的实时站点,但无法访问原始源代码。 You should be able to copy the site and get it working elsewhere, but you're probably going to struggle to recreate the original development environment and amend the compiled elements of the website without access to the source code.您应该能够复制该站点并使其在其他地方工作,但是您可能会在无法访问源代码的情况下努力重新创建原始开发环境并修改网站的已编译元素。

The Umbraco.com website has some great documentation on getting started and setting up Umbraco. Umbraco.com网站上有一些关于 Umbraco 入门和设置的很棒的文档。 Umbraco TV is great for getting up to speed quickly too. Umbraco TV 也非常适合快速上手。 This should help explain the project structure.这应该有助于解释项目结构。 I suggest you create a blank Umbraco install to familiarise yourself with how Umbraco works(I wrote a post explaining how to do this with MS VS2015 here ).我建议您创建一个空白的 Umbraco 安装来熟悉 Umbraco 的工作原理(我在这里写了一篇文章解释了如何使用 MS VS2015 执行此操作)。

A typical deployment, using MS WebDeploy or FTP from Visual Studio, wouldn't deploy the project files or source-code for the compiled (.cs) elements of the website, these are usually kept as development files and checked in to source control.The live site probably only has the compiled versions of these file in the bin folder.使用 MS WebDeploy 或来自 Visual Studio 的 FTP 的典型部署不会为网站的已编译 (.cs) 元素部署项目文件或源代码,这些通常作为开发文件保存并签入源代码管理。实时站点的 bin 文件夹中可能只有这些文件的编译版本。 The good news is the Razor template and view files(.cshtml) should be on the server.好消息是 Razor 模板和视图文件 (.cshtml) 应该在服务器上。

However, if everything was uploaded (it happens) then you may have a chance, in which case you can download the files, potentially open the project and try to run the project locally on the development machine.但是,如果所有内容都已上传(它发生了),那么您可能有机会,在这种情况下,您可以下载文件,打开项目并尝试在开发机器上本地运行该项目。 There's no reason why you can't install an older version of MS Visual Studio alongside 2019 if there's an issue with that version.如果旧版本的 MS Visual Studio 存在问题,那么您没有理由不能与 2019 一起安装旧版本。 Although, I suspect this isn't an option since you felt the need to create a new empty project.虽然,我怀疑这不是一个选项,因为您觉得需要创建一个新的空项目。 If this is the case you might be able to add any project files to the the new empty project and attempt to recreate the project that way.如果是这种情况,您可以将任何项目文件添加到新的空项目中,并尝试以这种方式重新创建项目。

Regarding the database.关于数据库。 You're going to need a copy or backup installed on a Microsoft SQL Server (unless you used MS SQL CE which is file based).您将需要在 Microsoft SQL Server 上安装副本或备份(除非您使用基于文件的 MS SQL CE)。 You should be able to download a .bak file from the server if you're using Plesk or connect remotely using MS Management Studio if not, it depends on the host (Azure will allow access via MS Management Studio).如果您使用 Plesk,您应该能够从服务器下载 .bak 文件,否则使用 MS Management Studio 远程连接,这取决于主机(Azure 将允许通过 MS Management Studio 访问)。 Umbraco will need the connection string configured in it's web.config, the one you downloaded may be trying to connect to the live server so be careful. Umbraco 需要在它的 web.config 中配置连接字符串,您下载的那个可能正在尝试连接到实时服务器,所以要小心。

Long shot ideas:远射思路:

  • If you're really desperate you might be able to reverse engineer some of your compiled .dll using a tool like ILASM.exe but it's not going to be easy;如果你真的很绝望,你可以使用像 ILASM.exe 这样的工具对你编译的一些 .dll 进行逆向工程,但这并不容易;
  • Perhaps you could reference the .dll in a the new project and it will all work auto-magically?!也许您可以在新项目中引用 .dll 并且它会自动神奇地工作?! but I doubt this will work as there will be two application starting points and you'll probably get a runtime exception.但我怀疑这是否可行,因为将有两个应用程序起点,您可能会遇到运行时异常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以从现有的 C 代码创建 Visual Studio 2019 项目吗? - Can I create a Visual Studio 2019 project from existing C code? 如何使用Visual Studio但不使用Azure模拟器将现有的Web应用程序项目部署到Azure? - How do I deploy an existing web app project to Azure using Visual Studio but no Azure Emulator? Visual Studio 2019,对于 NodeJs Web 应用程序,发布到 Azure 失败 - Visual Studio 2019, Publish to Azure is failed for NodeJs Web App 无法使用 Visual Studio 2019 部署我的 Azure Web 应用程序 - Unable to deploy my Azure Web App using visual studio 2019 无法使用 Visual Studio 2019 和 Azure 发布 web 应用程序 - cannot Publish web app with Visual Studio 2019 and Azure 无法从Visual Studio 2017为Azure DevOps Server 2019创建团队项目 - Can't create a Team Project for Azure DevOps Server 2019 from Visual Studio 2017 Azure 应用服务无法从 visual studio 2019 发布 - Azure App service cannot publish from visual studio 2019 使用Visual Studio编译现有的js文件Azure Web应用程序 - Compile an existing js file azure web app using visual studio Visual Studio 2019 Azure 应用程序未发布 - Visual Studio 2019 Azure App not getting published Visual Studio 2010:如何从现有代码创建新的Web项目? - Visual Studio 2010: How create new web project from existing code?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM