diff --git a/src/actions/vstudio/vs2005_csproj.lua b/src/actions/vstudio/vs2005_csproj.lua index 2f9d656d..f9710540 100644 --- a/src/actions/vstudio/vs2005_csproj.lua +++ b/src/actions/vstudio/vs2005_csproj.lua @@ -466,17 +466,12 @@ local action = premake.action.current() local targetFramework = cfg.dotnetframework or action.vstudio.targetFramework - for k, frameworkVersion in ipairs(vstudio.frameworkVersions) do - if k == #vstudio.frameworkVersions then + for _, frameworkVersion in ipairs(vstudio.frameworkVersions) do + if frameworkVersion == targetFramework then break end - local nextFrameworkVersion = vstudio.frameworkVersions[k + 1] - - -- Compare the versions as numbers. - if tonumber(targetFramework:gsub("%.", "")) >= tonumber(nextFrameworkVersion:gsub("%.", "")) then - table.insert(frameworks, frameworkVersion) - end + table.insert(frameworks, frameworkVersion) end table.insert(frameworks, targetFramework)