mono 3.0.1 asp.net已导入具有相同标识`mscorlib的程序集。考虑删除其中一个引用

时间:2012-12-02 19:04:26

标签: asp.net entity-framework-4 mono debian raspberry-pi

硬件&操作系统:Raspberry pi(模型B)&软浮Debian“wheezy”

好的,我做的第一件事是做'单声道完成',安装顺利进行。我做了一些测试,效果很好。单声道版本是2.10.8.x.我在XSP(& mono-fastcgi-server4)中运行了一个简单的ASP.net(不是MVC),它也有效。然后我尝试了一个带有数据库(system.data.sqlite)的更复杂的版本,其中一个不顺利,但我想出了那个。

所以现在我尝试了一个带有sqlite +实体框架的版本,令人震惊(对我而言)它不起作用。我尝试了很多不同的东西。我无法理解。所以我开始在网上查看可能有什么问题,我意识到实体框架在最新的(BETA,3.0.1)版本中被添加到单声道。这是版本3.0.1所以我下载了这个版本并安装。它需要永远安装。

pi@raspberrypi ~ $ mono -V
Mono JIT compiler version 3.0.1 (tarball Sat Dec  1 01:10:37 AST 2012)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  armel,vfp
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

但它安装了。我做了一些测试(在csharp交互式编译器中),它似乎没问题。在构建/编译/安装时,我确实看到了很多警告。我不知道这是否正常。否则我会发现错误,必须立即停止。

好的,现在我的问题是: 我试图运行一个简单的网站,并在浏览器中看到:

Compilation Error

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Compiler Error Message: CS1703: An assembly with the same identity `mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Consider removing one of the references


Show Detailed Compiler Output:

dmcs /target:library /lib:"/var/www/dotnet/Adwen/Bin" /debug+ /optimize- /warn:4 /out:"/tmp/root-temp-aspnet-0/624d0ef6/App_Code.1da3d18.dll" /r:"/var/www/dotnet/Adwen/Bin/myTest.dll" /r:"/var/www/dotnet/Adwen/Bin/Adwen.dll" /r:"/var/www/dotnet/Adwen/Bin/myTestModel.dll" /r:"/var/www/dotnet/Adwen/Bin/System.Data.Entity.dll" /r:"/var/www/dotnet/Adwen/Bin/System.Data.SQLite.Linq.dll" /r:"/var/www/dotnet/Adwen/Bin/System.Data.SQLite.dll" /r:"/var/www/dotnet/Adwen/Bin/System.Web.Entity.dll" /r:"/var/www/dotnet/Adwen/Bin/TechInfoSystems.Data.SQLiteProvider.dll" /r:"/usr/lib/mono/4.0/mscorlib.dll" /r:"/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll" /r:"/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll" /r:"/usr/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll" /r:"/usr/lib/mono/gac/System.Web/4.0.0.0__b03f5f7f11d50a3a/System.Web.dll" /r:"/usr/lib/mono/gac/System.Data/4.0.0.0__b77a5c561934e089/System.Data.dll" /r:"/usr/lib/mono/gac/System.Web.Services/4.0.0.0__b03f5f7f11d50a3a/System.Web.Services.dll" /r:"/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll" /r:"/usr/lib/mono/gac/System.Drawing/4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll" /r:"/usr/lib/mono/gac/System.EnterpriseServices/4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll" /r:"/usr/lib/mono/gac/System.IdentityModel/4.0.0.0__b77a5c561934e089/System.IdentityModel.dll" /r:"/usr/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll" /r:"/usr/lib/mono/gac/System.Xaml/4.0.0.0__b77a5c561934e089/System.Xaml.dll" /r:"/usr/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll" /r:"/usr/lib/mono/gac/System.ServiceModel.Web/4.0.0.0__31bf3856ad364e35/System.ServiceModel.Web.dll" /r:"/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll" /r:"/usr/lib/mono/gac/System.Web.Extensions/4.0.0.0__31bf3856ad364e35/System.Web.Extensions.dll" /r:"/usr/lib/mono/gac/System.Data.DataSetExtensions/4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll" /r:"/usr/lib/mono/gac/System.Xml.Linq/4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll" /r:"/usr/lib/mono/gac/System.ComponentModel.DataAnnotations/4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll" /r:"/usr/lib/mono/gac/System.Web.DynamicData/4.0.0.0__31bf3856ad364e35/System.Web.DynamicData.dll" /r:"/usr/lib/mono/gac/System.Data.Linq/4.0.0.0__b77a5c561934e089/System.Data.Linq.dll" /r:"/usr/lib/mono/gac/System.Web.ApplicationServices/4.0.0.0__31bf3856ad364e35/System.Web.ApplicationServices.dll" /r:"/var/www/dotnet/Adwen/bin/System.Data.SQLite.dll" /r:"/var/www/dotnet/Adwen/bin/System.Data.Entity.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/3f3d66bb/989bd275_a7a6b4ce_00000002/myTest.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/5cf434e0/fb52802e_a7a6b4ce_00000002/Adwen.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/ca2786da/6d813214_a7a6b4ce_00000002/myTestModel.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/cee499b3/69422d7d_a7a6b4ce_00000002/System.Data.SQLite.Linq.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/b7cd78f2/106bcc3c_a7a6b4ce_00000002/System.Web.Entity.dll" /r:"/tmp/root-temp-aspnet-0/32404ce1/assembly/shadow/5f634169/f8c5f5a7_a7a6b4ce_00000002/TechInfoSystems.Data.SQLiteProvider.dll" /d:DEBUG  -- "/tmp/root-temp-aspnet-0/624d0ef6/App_Web_285c26e8_0.cs" "/tmp/root-temp-aspnet-0/624d0ef6/App_Web_285c26e8_1.cs" "/tmp/root-temp-aspnet-0/624d0ef6/App_Web_285c26e8_2.cs" "/tmp/root-temp-aspnet-0/624d0ef6/App_Web_285c26e8_3.cs" "/tmp/root-temp-aspnet-0/624d0ef6/App_Web_285c26e8_4.cs" 

error CS1703: An assembly with the same identity `mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Consider removing one of the references
mscorlib.dll (Location of the symbol related to previous error)
/usr/lib/mono/4.0/mscorlib.dll (Location of the symbol related to previous error)
error CS1703: An assembly with the same identity `System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Consider removing one of the references
/usr/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll (Location of the symbol related to previous error)
System.dll (Location of the symbol related to previous error)
error CS1703: An assembly with the same identity `System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Consider removing one of the references
/usr/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll (Location of the symbol related to previous error)
System.Xml.dll (Location of the symbol related to previous error)
error CS1703: An assembly with the same identity `System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' has already been imported. Consider removing one of the references
/usr/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll (Location of the symbol related to previous error)
System.Core.dll (Location of the symbol related to previous error)
error CS1703: An assembly with the same identity `Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Consider removing one of the references
/usr/lib/mono/gac/Microsoft.CSharp/4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll (Location of the symbol related to previous error)
Microsoft.CSharp.dll (Location of the symbol related to previous error)

Version information: Mono Runtime Version: 2.10.8.1 (Debian 2.10.8.1-5); ASP.NET Version: 4.0.30319.1

如果您在底部注意到错误,您可以清楚地看到'版本信息:Mono Runtime版本:2.10.8.1(Debian 2.10.8.1-5); ASP.NET版本:4.0.30319.1'我希望看到另一个运行时版本。

那么我从哪里开始呢?这是一个错误吗?安装出错了吗?另一个xsp版本?我应该再安装一次吗?我能解决这个问题吗?在我浪费了大量的时间和精力之前,我可以提出任何问题。

2 个答案:

答案 0 :(得分:1)

我写了这篇文章后立即发现了问题。 XSP4(或mono-fastcgi-server4)确实出了问题。我安装了单声道3.0.1,假设它会安装最新的xsp。但事实并非如此。所以我从github下载了最新版本。我的基本网站再次运作。但我的实体框架网站仍然没有工作,没有时间去工作。在我在这里报告我的发现之前,我打算这样做。

答案 1 :(得分:0)

我之前从未使用过FastCGI服务器,但几周之前我已经看到mod-mono-server4出现了同样的问题 - 但是在我报告之后很快就解决了,所以你的Mono 3.0.1应该没问题

但是,看起来FastCGI Server没有使用您编译和安装的新Mono 3.0.1,而是使用较旧的Mono 3.0.1。

您是否将新的Mono安装到主目录中的某个自定义前缀中?查看您的Web服务器配置以检查它使用的mono-fastcgi-server4,然后查看该文件 - 它应该是一些shell脚本,其中包含mono的完整路径(可能是/usr/bin/mono )。