projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 652 forks source link

vcproj file found -> crash #150

Closed SeriousM closed 11 years ago

SeriousM commented 12 years ago

Hi!

I was trying out KUDU on azure and my local machine and it seems that application deployment stops working if a ".vcproj" file was found.

Error Message: Exception has been thrown by the target of an invocation. at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Kudu.Core.Infrastructure.VsSolution.EnsureProjects() in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsSolution.cs:line 65 at Kudu.Core.Infrastructure.VsSolution.get_Projects() in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsSolution.cs:line 41 at Kudu.Core.Infrastructure.VsHelper.ExistsInSolution(VsSolution solution, String targetPath) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsHelper.cs:line 75 at Kudu.Core.Infrastructure.VsHelper.<>c__DisplayClass3.<FindContainingSolutions>b__2(VsSolution solution) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsHelper.cs:line 31 at System.Linq.Enumerable.WhereListIterator1.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Kudu.Core.Infrastructure.VsHelper.FindContainingSolutions(String searchPath, String targetPath) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsHelper.cs:line 30 at Kudu.Core.Infrastructure.VsHelper.FindContainingSolution(String searchPath, String targetPath) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Infrastructure\VsHelper.cs:line 40 at Kudu.Core.Deployment.SiteBuilderFactory.DetermineProject(String repositoryRoot, String targetPath) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Deployment\SiteBuilderFactory.cs:line 169 at Kudu.Core.Deployment.SiteBuilderFactory.ResolveProject(String repositoryRoot, String targetPath, Boolean tryWebSiteProject, SearchOption searchOption, Boolean specificConfiguration) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Deployment\SiteBuilderFactory.cs:line 120 at Kudu.Core.Deployment.SiteBuilderFactory.CreateBuilder(ITracer tracer, ILogger logger) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Deployment\SiteBuilderFactory.cs:line 41 at Kudu.Core.Deployment.DeploymentManager.Build(String id, ITracer tracer, IDisposable deployStep) in c:\SVN-Store\GitHub\projectkudu\kudu\Kudu.Core\Deployment\DeploymentManager.cs:line 400

INNER EXCEPTION: The project file "failures\cpp-cli-failures.vcproj" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it.

This was caused by the file .\AdditionalStuff\NUnit-2.6.0.12051\samples\cpp\cpp-cli\failures\cpp-cli-failures.vcproj.

But i do not understand why it starts searching for it even i specifies the file to deploy in the .deployment file. by the way, my project do not have any links or references to the vcproj file.

Everything looks good when i remove the file!

btw: the inner exception is very very very important, you shouldn't skip this information in your logs. and in azure, there should more information than just the error message itself that was Exception has been thrown by the target of an invocation. which is not very useful.

davidfowl commented 12 years ago

It's likely because it's trying to parse the solution and use it to find the solution path.

davidebbo commented 12 years ago

And good point about propagating the inner exception. That's always a pain point with reflection.

davidfowl commented 12 years ago

Yea, this is a known issue #121

raquelsa commented 12 years ago

We actually have an issue here other than just better error message by propagating the inner exception. Please see repro app at https://github.com/KuduApps/ReproIssue150 for a repro.

Solution has two projects: a WAP and a Visual C++ proj (.vcproj). Note that the .vcproj was renamed to .vxcproj in recent versions of VS (>= Dev10). The .deployment file points to the WAP project so we should just build/deploy with no problems.

raquelsa commented 12 years ago

Pasting the Git log for error details.

remote: New deployment received. remote: Updating branch 'master'. remote: Preparing deployment for commit id 'c0ed0f5d0c'. remote: Exception has been thrown by the target of an invocation. remote: Error - Changes committed to remote repository but your website not updated. To https://raquel4@reproissue150.scm.azurewebsites.net/ReproIssue150.git

davidebbo commented 12 years ago

The WAP looks like a 3.5 project. Would it work in Kudu even if it was by itself without the C++ proj?

davidebbo commented 12 years ago

Though based on the stack trace, there does seem to be something bad happening in EnsureProjects().

davidebbo commented 11 years ago

The error handling is fixed in 4aa2eb8f4989ccdb403988ba49f1f1d961c36597. It will now show the correct error:

The project file "VcProject\VcProject.vcproj" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it.