warrenfalk / msbuild-protocol-buffers

MSBuild targets for automatic support of .proto files
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

Doesn't work when using with a csproj in the old format #1

Open dsbenghe opened 6 years ago

dsbenghe commented 6 years ago

As in title - It seems to work only in the new csproj format.

Any plans to support the old format?

warrenfalk commented 6 years ago

I believe that it should be feasible to do, but I don't have plans to do it myself because I think it's probably non-trivial and I don't currently use the old format. I'm certainly open to a PR if anyone else wants to give it a shot.

warrenfalk commented 6 years ago

Some more information:

The error is actually reported as follows:

The target "RunResolvePackageDependencies" does not exist in the project

It would be nice to have a better error message along the lines of

The old csproj format is not supported: [https://github.com/warrenfalk/msbuild-protocol-buffers/issues/1]

It is not necessary to target a .NET Core framework. You can target .NET Framework, but you MUST use the new csproj format currently. You can use the new project format while targeting .NET Framework even though Visual Studio hides this from you. To do it, create a .NET Core project in Visual Studio, and then immediately right click the project and click "Edit .csproj". In the csproj file change to something like the following (substituting whatever version of .NET Framework you need):

<TargetFramework>net452</TargetFramework>
dsbenghe commented 6 years ago

I'm aware that the new project format can be used with .net framework - but we have other roadblocks in going that route.

And probably is true that it doesn't worth the effort to support the old crappy project format anyway :) if is not reasonable straightforward.

NN--- commented 6 years ago

I suggest at least to prevent installing the package, or put some message using install.ps1 script. You install the package and then don't understand why it doesn't work.