简体   繁体   English

无法将在VS2008上编写的代码部署到运行.NET Framework 2.0的服务器上

[英]Trouble deploying code written on VS2008 to server running .NET Framework 2.0

When I created the project I'm trying to deploy I selected that I wanted to target .NET Framework 2.0. 创建项目时,我尝试部署的目标是.NET Framework 2.0。 After deploying the project I try to brows to it and get and error page that shows: 部署项目后,我尝试浏览该项目并获取并显示以下错误页面:

<compilation debug="true">
    <assemblies>
        <add assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    </assemblies>
</compilation>

One of the selling points of VS2008 is that you can develop for and deploy to server running .NET2.0 what Am I doing wrong? VS2008的卖点之一就是您可以为运行.NET2.0的服务器开发并部署到服务器。我在做什么错?

Right click on your project and select "Properties." 右键单击您的项目,然后选择“属性”。 From there, select the "Compile" tab and click the "Advanced Compile Options" button down at the bottom left. 从那里,选择“编译”选项卡,然后单击左下角的“高级编译选项”按钮。 The last drop down list item should be "Target Framework" and you can select 2.0 from there. 最后一个下拉列表项应为“ Target Framework”,您可以从中选择2.0。 As mentioned above, this is provided you're not using any 3.5 related technologies such as LINQ. 如上所述,前提是您未使用任何与LINQ等3.5相关的技术。

Save, recompile and deploy. 保存,重新编译和部署。 Once everything is set, you can go back and select the 3.5 option to target the 3.5 framework again. 设置完所有内容后,您可以返回并选择3.5选项以再次定位3.5框架。

Hope this helps! 希望这可以帮助!

Oh, one other thing to note. 哦,还有另一件事要注意。 If you are using the AJAX Toolkit controls in your 3.5 application (calendar extender, auto-complete extender, etc.), you'll need to make sure you download the 1.0 Toolkit from the codeplex site since the 3.5 toolkit is not compatible with the 2.0 framework. 如果您在3.5应用程序(日历扩展程序,自动完成扩展程序等)中使用AJAX工具包控件,则需要确保从codeplex网站下载了1.0工具包,因为3.5工具包与2.0框架。

remove those references from your project and redeploy. 从您的项目中删除那些引用并重新部署。 if your project started as 3.5 it will still have references to some of those assemblies 如果您的项目从3.5开始,它仍将引用其中一些程序集

If you're using features from the 3.5 framework, then you'll have to deploy to a 3.5 machine. 如果要使用3.5框架中的功能,则必须部署到3.5台计算机上。

Most information you'd probably need for this issue is in the question and answers here: problems-executing-compiled-35-code-on-a-server-which-only-has-the-20-framework 您可能需要为此问题提供的大多数信息都在这里的问题和解答中: 在服务器上执行编译的35个代码的问题只有20个框架

You are referencing assemblies of the .NET Framework 3.5, are you using EntityDataSources?? 您正在引用.NET Framework 3.5的程序集,是否正在使用EntityDataSources?

Remove those 3.5 references... 删除那些3.5参考...

You also need the AJAX Extensions (System.Web.Extensions) for .NET 2.0 on the server. 您还需要服务器上.NET 2.0的AJAX扩展(System.Web.Extensions)。

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

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