Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何安装asp.net kigg初学者工具包?_Asp.net_Asp.net Mvc_Kigg - Fatal编程技术网

如何安装asp.net kigg初学者工具包?

如何安装asp.net kigg初学者工具包?,asp.net,asp.net-mvc,kigg,Asp.net,Asp.net Mvc,Kigg,我正在尝试在本地机器上安装kigg初学者工具包 我从这里下载KiGG v3.0源代码: 首先,当我尝试运行/重新构建项目时,我会收到如下3条错误消息: Error 101 The type 'System.Web.Routing.RouteValueDictionary' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routin

我正在尝试在本地机器上安装kigg初学者工具包

我从这里下载KiGG v3.0源代码:

首先,当我尝试运行/重新构建项目时,我会收到如下3条错误消息:

Error    101    The type 'System.Web.Routing.RouteValueDictionary' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll'    c:\Documents and Settings\Desktop\Kigg\Kigg_3a9b436eace5\Source\Web\Views\Membership\Detail.aspx    21    Kigg.Web
Error    102    The type 'System.Web.Routing.RouteValueDictionary' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll'    c:\Documents and Settings\Desktop\Kigg\Kigg_3a9b436eace5\Source\Web\Views\Membership\Detail.aspx    27    Kigg.Web
Error    103    The type 'System.Web.Routing.RouteValueDictionary' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Routing\3.5.0.0__31bf3856ad364e35\System.Web.Routing.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.dll'    c:\Documents and Settings\Desktop\Kigg\Kigg_3a9b436eace5\Source\Web\Views\Membership\Detail.aspx    34    Kigg.Web
当我尝试运行项目时,仍然会出现以下错误:

Line 43:         }
Line 44: 
Line 45: public Database(string connectionString) :
Line 46:             base(connectionString, _defaultContainerName)
Line 47:         {   
我遵循以下解决方案:

并将以下文件从“视图/共享文件”复制到“应用程序数据”

现在,错误更改为:

An attempt to attach an auto-named database for file C:\Documents and Settings\Desktop\Kigg\Kigg_3a9b436eace5\Source\Web\App_Data\KiGG.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file C:\Documents and Settings\NA-PC\Desktop\Kigg\Kigg_3a9b436eace5\Source\Web\App_Data\KiGG.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Source Error:

Line 92:             Check.Argument.IsNotEmpty(userName, "userName");
Line 93:             
Line 94: return DataContext != null ? FindByUserNameQuery.Invoke(DataContext, userName.Trim()) : Database.UserDataSource.FirstOrDefault(u => u.UserName == userName.Trim());
Line 95:         }
Line 96
我使用SSMS创建了一个数据库,这是我的连接字符串

<connectionStrings>
    <clear />
    <add name="KiGGDatabase" connectionString="Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|KiGG.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />
  </connectionStrings>


请帮助解决前3个错误:
打开文件Kigg.Web.csproj

搜索AspNetCompiler,您将在此处找到它

<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\Web" />
</Target> 

添加了刀轨参数,如下所示

<Target Name="AfterBuild" Condition="'$(MvcBuildViews)'=='true'">
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\Web" 
ToolPath="C:\Windows\Microsoft.NET\Framework\v2.0.50727"/>
</Target> 

对于数据库错误 将连接字符串从

<add name="KiGGDatabase" connectionString="Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|KiGG.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />


<add name="KiGGDatabase" connectionString="Data Source=.\SQLEXPRESS;Database=KiGG;Integrated Security=True;User Instance=True;MultipleActiveResultSets=true" providerName="System.Data.SqlClient"/>