2011-10-14 2 views
9

Ho uno strano problema sul mio server di build. Sto utilizzando l'ultima versione di TeamCity su Windows Server 2008 R2. Ho usato il programma di installazione della piattaforma Web per installare ASP.NET MVC sul server di build, ma la mia compilation continua a non riuscire con i messaggi che non riesce a trovare lo System.Web.Mvc.dll. Ho verificato che è sul disco nella posizione prevista:ASP.NET MVC 3 Il progetto non verrà compilato sul server di build con ASP.NET MVC 3 installato

(C: \ Program Files (x86) \ Microsoft ASP.NET \ ASP.NET MVC 3 \ Assemblies)


Ecco una selezione dei messaggi:

Controllers\AccountController.cs(7, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 
Controllers\AccountController.cs(15, 35): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?) 
Controllers\HomeController.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 
Controllers\HomeController.cs(9, 32): error CS0246: The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?) 
Global.asax.cs(5, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 
Models\AccountModels.cs(8, 18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 

Allora, cosa mi manca?

risposta

7

Gli errori sembrano essere inferire che non riesce a trovare la versione corretta della dll MVC. È possibile che sia stato installato MVC (originale) o MVC2 anziché MVC3 dalla piattaforma Web sul server di generazione?

Edit:

anche il file deve essere nel GAC, (non sono sicuro la posizione sulla Windows Server 2008, ma indovinando che è simile a vincere 7.)

C: \ Windows \ Microsoft.NET \ assembly \ GAC_MSIL \ System.Web.Mvc \ (quindi la cartella versione .Net, la mia è v4.0_3.0.0.0)

+0

Buone domande e mi ha portato alla risposta. MVC 3 è stato installato e nel GAC. Tuttavia, in realtà stava cercando di trovare MVC 2, che credo sia richiesto perché ho installato il pacchetto MVGontrib NuGet. Quando ho installato MVC 2 sul buildserver, tutto ha funzionato bene. –

+0

Ah, mi fa piacere averlo aiutato, dalla memoria dovrebbe esserci una configurazione vincolante nel web.config che dovrebbe impostare tutte le richieste per mvc 1 e 2 per usare la dvc mvc 3. (ma non l'ho mai provato, quindi non ho idea se sarebbe utile nella tua situazione) – Skuld