c# 4.0 - Nuget autoupdate in website -
for customer trying build webb application can build patches (new versions) , customers can them self click in app update.
i have made minor experioments on nuget before , had reference: http://haacked.com/archive/2011/01/15/building-a-self-updating-site-using-nuget.aspx
unfortunatly of nuget packages installed , used in project new , not compatible nuget package of autoupdate 0.2.1 uses nuget.core 1.3.20419.9005.
so took autoupdate code , upgraded nuget 2.5 , fixed new issues new nuget core (changes in functions/parameters etc.).
now works far can se wich package installed, , can see there new version on remote server. howerver when try upgrade local package version on server error: system.entrypointnotfoundexception: entry point not found.
this code goes wrong:
public ienumerable<string> updatepackage(ipackage package) { return this.performloggedaction(delegate { bool updatedependencies = true; bool allowprereleaseversions = true; this._projectmanager.updatepackagereference(package.id, package.version, updatedependencies, allowprereleaseversions); }); } [entrypointnotfoundexception: entry point not found.] nuget.iprojectsystem.get_projectname() +0 nuget.projectmanager.updatepackagereference(string packageid, func`1 resolvepackage, boolean updatedependencies, boolean allowprereleaseversions, boolean targetversionsetexplicitly) +1014 nuget.projectmanager.updatepackagereference(string packageid, semanticversion version, boolean updatedependencies, boolean allowprereleaseversions) +233
the package param package want upgrade to.
in web app got folder \app_data\packages holds .nupkg file installed. on remote folder got installed packages + new version package.
i dont understand entrypoint , how solve issue.
after lot of time googling , code inspect , re-engineering code, looks problem in microsoft.aspnet.webpages.administration wich compatible nuget.core (≥ 1.6.2 && < 1.7). re-engineered webprojectsystem class , kinda works.
string webrepositorydirectory = webprojectmanager.getwebrepositorydirectory(siteroot); ipackagerepository sourcerepository = packagerepositoryfactory.default.createrepository(remotesource); ipackagepathresolver pathresolver = new defaultpackagepathresolver(webrepositorydirectory); ipackagerepository localrepository = packagerepositoryfactory.default.createrepository(webrepositorydirectory); iprojectsystem project = new webprojectsystem(siteroot); this._projectmanager = new projectmanager(sourcerepository, pathresolver, project, localrepository);
the updatepackage methods dosent seam job, updates references or something. when uppgrading new version of package (eg. deploy new images or html files) seams need use following method instead:
public ienumerable<string> installpackage(ipackage package) { return this.performloggedaction(delegate { bool ignoredependencies = false; bool allowprereleaseversions = true; this._projectmanager.addpackagereference(package.id, package.version, ignoredependencies, allowprereleaseversions); }); }
this goes through files in package , seams replace them. got weird issues files 0 bytes after upgrade (only binary dll files, have seen far).
need more research on this.
Comments
Post a Comment