如果使用完整路径调用,Nuget 无法读取 AssemblyInfo.cs

Nuget can't read AssemblyInfo.cs if called with full path

如果在 c:\soruce\project1 文件夹中调用 nuget pack c:\source\project1\project.nuspec,则无法从 AssemblyInfo.cs 中读取详细信息。 Visual Studio Team Services(以前的 Visual Studio Online)就是这样做的,因此不可能使用从 AssemblyInfo.cs 读取的通配符版本号。 Nuget 中似乎没有设置工作文件夹的选项。

我们的想法是每晚构建构建号上的版本增量。

我通常通过以下方式直接从项目文件创建 nuget 包文件:

nuget pack MyProject.csproj

生成的包根据AssemblyInfo.cs中的版本号命名。