Ho incontrato problemi di compilazione con il mio MSVS 10 dopo aver installato MSVS 11Beta. Ora, quando compilo i miei C# in MSVS 10 (Progetti creati in MSVS 10; framework di destinazione: 3,5), ottengo errori MSB4216
, MSB4028
con il seguente testo nella finestra di output:Sembra che MSVS 11.0 Beta abbia danneggiato l'installazione di MSVS 10.0
1>Task "GenerateResource" skipped, due to false condition; ('%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' != 'CLR2') was evaluated as ('Resx' == 'Resx' and '' != 'false' and 'CLR2' != 'CLR2').
1>Task "GenerateResource"
1> Launching task "GenerateResource" from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" in an external task host with a runtime of "CLR2" and a process architecture of "x86".
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2199,5): error MSB4216: Could not run the "GenerateResource" task because we could not create or connect to a task host with runtime "CLR2" and architecture "x86". Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NetFX 4.0 Tools\MSBuildTaskHost.exe" exists.
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2217,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
1>Done executing task "GenerateResource" -- FAILED.
Come posso risolvere questi errori ?
EDIT:
- Menzionato file "C: \ Program Files (x86) \ Microsoft SDK \ Windows \ V8.0a \ bin \ netfx 4.0 Tools \ MSBuildTaskHost.exe" esiste.
- I progetti C++ si stanno completando senza problemi.
- La reinstallazione di VS10 non risolve il problema.
- Questo è
GenerateResource
compito, che deve compilare resx-file, ma genera un'eccezione:
<!-- But we can't use those parameters if we're targeting 3.5, since we're using the 3.5 task -->
<GenerateResource
Sources="@(EmbeddedResource)"
UseSourcePath="$(UseSourcePath)"
References="@(ReferencePath)"
AdditionalInputs="$(MSBuildAllProjects)"
NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.Cache"
StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
PublicClass="%(EmbeddedResource.PublicClass)"
OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)"
Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' == 'CLR2'">
- ho cercato di debug lo script MSBuild (
.csproj
). Poco prima della fatale attivitàGenerateResource
ho controllato tutte le proprietà e articoli. Non c'era nulla su "8.0A" ma solo su "7.0A"
Hai verificato che il file richiesto esista per errore? "Assicurarsi che (1) il runtime richiesto e/o l'architettura siano disponibili sulla macchina e (2) che l'eseguibile richiesto" C: \ Programmi (x86) \ Microsoft SDK \ Windows \ v8.0A \ bin \ NetFX 4.0 Tools \ MSBuildTaskHost.exe "esiste." – Chris
@Chris - Sì, questo file esiste, e posso vedere nel registro procmon, che l'app "C: \ Programmi (x86) \ Microsoft SDK \ Windows \ v8.0A \ bin \ NetFX 4.0 Tools \ MSBuildTaskHost.exe" è stata avviata e stava compiendo alcune azioni. – Loom
Potrebbe essere un problema di percorso. VS11 potrebbe aver impostato un percorso che sovrascrive un percorso che il tuo script di build assume e utilizza la versione errata di file o dll. Controlla i tuoi percorsi. –