2016-04-28 6 views
3

ich folgende bin diesen guide meine eigenen NuGet privaten Server einrichten, aber unter Verwendung von Visual Studio 2010fehlender Verweis auf erfolgreiche NuGet Paketinstallation

Ich habe erfolgreich hinzugefügt, um das NuGet.Server Paket durch Package Manager Console, aber wenn ich möchte, dass die bauen WebApplication ich habe Fehler:

der Typ oder Namespace-Name 'Server' existiert nicht im Namensraum 'NuGet' (werden Sie eine Assembly Referenz fehlt?)

Es ist kein Fehler in der Paketinstallation, aber ich sehe, dass NuGet.Server nicht im Referenzordner des Projekts hinzugefügt wird, warum ist das passiert?

Edit: Weitere Untersuchungen auf den Paketinhalt, sehe ich, dass NuGet.Server nicht die lib für net40 hat. Ich muss vielleicht NuGet.Server source forkieren und es in net40 kompilieren, um dies zu beheben.

Hier sind meine Protokolle von Package Manager Console:

PM> Install-package nuget.server 
Attempting to resolve dependency 'NuGet.Core (≥ 2.10.1)'. 
Attempting to resolve dependency 'Microsoft.Web.Xdt (≥ 2.1.0)'. 
Attempting to resolve dependency 'Newtonsoft.Json (≥ 8.0.1)'. 
Attempting to resolve dependency 'RouteMagic (≥ 1.3.0)'. 
Attempting to resolve dependency 'WebActivatorEx (≥ 2.1.0)'. 
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'. 
Installing 'Microsoft.Web.Xdt 2.1.1'. 
You are downloading Microsoft.Web.Xdt from Microsoft Corporation, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=273778. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device. 
Successfully installed 'Microsoft.Web.Xdt 2.1.1'. 
Installing 'NuGet.Core 2.10.1'. 
Successfully installed 'NuGet.Core 2.10.1'. 
Installing 'Newtonsoft.Json 8.0.1'. 
Successfully installed 'Newtonsoft.Json 8.0.1'. 
Installing 'RouteMagic 1.3'. 
Successfully installed 'RouteMagic 1.3'. 
Installing 'Microsoft.Web.Infrastructure 1.0.0.0'. 
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'. 
Installing 'WebActivatorEx 2.1.0'. 
Successfully installed 'WebActivatorEx 2.1.0'. 
Installing 'NuGet.Server 2.10.3'. 
Successfully installed 'NuGet.Server 2.10.3'. 
Adding 'Microsoft.Web.Xdt 2.1.1' to WebApplication2. 
Successfully added 'Microsoft.Web.Xdt 2.1.1' to WebApplication2. 
Adding 'NuGet.Core 2.10.1' to WebApplication2. 
Successfully added 'NuGet.Core 2.10.1' to WebApplication2. 
Adding 'Newtonsoft.Json 8.0.1' to WebApplication2. 
Successfully added 'Newtonsoft.Json 8.0.1' to WebApplication2. 
Adding 'RouteMagic 1.3' to WebApplication2. 
Successfully added 'RouteMagic 1.3' to WebApplication2. 
Adding 'Microsoft.Web.Infrastructure 1.0.0.0' to WebApplication2. 
Successfully added 'Microsoft.Web.Infrastructure 1.0.0.0' to WebApplication2. 
Adding 'WebActivatorEx 2.1.0' to WebApplication2. 
Successfully added 'WebActivatorEx 2.1.0' to WebApplication2. 
Adding 'NuGet.Server 2.10.3' to WebApplication2. 
File Conflict 
File 'Web.config' already exists in project 'WebApplication2'. Do you want to overwrite it? 
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "N"):A 
Overwrite existing file 'Web.config'. 
Successfully added 'NuGet.Server 2.10.3' to WebApplication2. 
+1

Wenn Sie versuchen, diese Quelle selbst zu kompilieren, sieht es so aus, als hätten Sie ein Referenzproblem basierend auf der Framework-Version: [Getting "Typ oder Namespace-Name konnte nicht gefunden werden" aber alles scheint ok?] (Http: // stackoverflow .com/questions/3304741/getting-type-or-namespace-name-konnte-nicht-gefunden-aber-alles-scheint-ok/3304899 # 3304899). – slugster

Antwort

12

ich den gleichen Fehler hätte, wenn es mit Visual Studio 2015 in einem Projekt zu bauen versucht, die das Ziel Framework .NET Framework 4.0 gesetzt hatten. Das Festlegen des Zielframeworks auf .NET Framework 4.6.1 hat es für mich behoben.

Ich würde vorschlagen, wenn möglich eine neuere Version von Visual Studio zu verwenden, oder kompilieren Sie es mit dem neueren Framework selbst über die Befehlszeile. Diese andere Stapelüberlauf-Antwort kann hilfreich sein, wenn Sie das später tun möchten. How to build .NET 4.6 Framework app without Visual Studio installed?

+0

Danke !! Rettete mir eine Menge Zeit! – Ross

1

Eine Option für alle, die keine andere .NET Framework-Version als Ziel haben möchten oder können, ist die Installation einer früheren Version von NuGet.Server. Zum Beispiel zielt Version 2.10.3 auf .NET 4.5 ab.

Verwandte Themen