I try to generate LINQ classes for my Site Collection root in Sharepoint with this command (all in one line):
SPMetal.exe
/web:http://myserver
/namespace:mynamespace
/code:myfile.cs
/parameters:mysettings.xml
The mysettings.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<Web AccessModifier="Internal"
xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal">
<List Name="List1"/>
<List Name="List2"/>
<ExcludeOtherLists/>
</Web>
But it doesn't work, the resulting error is (roughly translated from German):
The specified file name can not be used. Perhaps already a file or directory with this name exists, or permissions are not sufficient to access the file.
And I think it can't be a file problem because:
http://myserver/subsite
it works pretty good, the file gets generated So what am I missing? Or can't I create LINQ classes for the root Site Collection?
If you are using Visual Studio 2010 try LINQ to SharePoint extension . It allows to use nice UI wizard for generating models classes.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.