.net 重命名Lightswitch数据源表时出错

.net 重命名Lightswitch数据源表时出错,.net,entity-framework,visual-studio-lightswitch,.net,Entity Framework,Visual Studio Lightswitch,在Lightswitch中重命名数据源表后,我得到以下运行时异常: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code>1</code> <message xml:lang="en-US">

在Lightswitch中重命名数据源表后,我得到以下运行时异常:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <code>1</code>
    <message xml:lang="en-US">
        &lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;ExceptionInfo&gt;&lt;Message&gt;Schema specified is not valid. Errors: &#xD;
        REDCanonicalData.msl(653,10) : error 2007: The Table 'EntityNames' specified as part of this MSL does not exist in MetadataWorkspace.&#xD;
        REDCanonicalData.msl(652,8) : error 2063: At least one property must be mapped in the set mapping for 'EntityNames'.&lt;/Message&gt;&lt;StackTrace&gt;   at Microsoft.LightSwitch.Threading.DispatcherExtensions.Invoke(IDispatcher dispatcher, Action action)&#xD;
        at Microsoft.LightSwitch.ServerGenerated.Implementation.DataService`1.LogicInvoke[T](Func`1 f)&#xD;
        at Microsoft.LightSwitch.ServerGenerated.Implementation.DataService`1.Microsoft.LightSwitch.ServerGenerated.Implementation.IODataService.LogicInvoke[T](Func`1 f)&#xD;
        at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceQueryProvider.QueryableWrapper`1.ExecuteGeneric[TResult](Expression expression)&#xD;
        at Microsoft.LightSwitch.ServerGenerated.Implementation.DataServiceQueryProvider.QueryableWrapper`1.Execute[TResult](Expression expression)&#xD;
        at System.Linq.Queryable.LongCount[TSource](IQueryable`1 source)&lt;/StackTrace&gt;&lt;ErrorInfo /&gt;&lt;/ExceptionInfo&gt;
    </message>
</error>

问题是生成过程没有自动签出位于项目的…/Server/GeneratedArtifacts目录中的.ssdl文件。由于文件未签出,因此它将保持只读,并且无法通过生成过程进行更新

解决方案是进入TFS源代码资源管理器,手动签出文件,然后重新生成解决方案

如果您不使用Team Foundation Server进行源代码管理,则该文件可能是只读的,或者您可能没有更改它的权限。