patrick31415 / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

VS10.msi installs VS9, not VS10 #117

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Download and run protobuf-net-VS10.msi  
2. Say yes to everything.
3. The installer exits successfully.

What is the expected output? What do you see instead?

Instead of installing into C:\Program Files 
(x86)\protobuf-net\protobuf-net-VS10, it has installed into C:\Program Files 
(x86)\protobuf-net\protobuf-net-VS9. It works fine with VS 2008, but not with 
VS 2010. Also, the MSI dialog windows indicate that VS9 will be installed, 
giving off the impression that the installer is actually VS9, but is named VS10.

What version of the product are you using?

The file is called protobuf-net-VS10.msi, the checksum on disk is 
482c3308cb1aba103b5f94da4b5793aa98b1e664.

On what operating system?

Windows 7 Professional.

Original issue reported on code.google.com by 0x6e6...@gmail.com on 23 Jun 2010 at 2:16

GoogleCodeExporter commented 9 years ago
Oddly, I was installing this the other day and noticed it. Yes, the title and 
install path is misleading (this is on my white-board to fix), but it does 
install for VS2010. You can check this simply by creating a .proto file in 
VS2010.

Original comment by marc.gravell on 23 Jun 2010 at 6:39

GoogleCodeExporter commented 9 years ago
I have created .proto files in VS 2010 and 2008. In 08 the whole toolchain 
works fine and the resulting class is code gen'ed, but in 10 the file is 
treated as a pure text file and hence it is not compiled. Is there maybe some 
setting in VS 10 that I can turn on to make it aware of .proto files?

Original comment by 0x6e6...@gmail.com on 23 Jun 2010 at 11:05

GoogleCodeExporter commented 9 years ago
It should be enabled by default. I've just verified this on my VS2010 rig and 
it worked fine. You could try setting the "Custom Tool" of the .proto file to 
ProtoBufTool. If this still doesn't work, perhaps check the registry - under 
HKLM\Software\Microsoft\VisualStudio\9.0\InstalledProducts\ProtoBufTool (or 
HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\InstalledProducts\ProtoBuf
Tool in x64). If this doesn't exist, it isn't installed.

Original comment by marc.gravell on 24 Jun 2010 at 5:45

GoogleCodeExporter commented 9 years ago
OK, I've got a little further. It is actually installed into VS10 and the 
registry keys are as suggested. Originally I placed the .proto file into an F# 
project, which doesn't seem to expose the CustomTool attribute in the file 
properties. So I created a new C# project and the ProtoBufTool can be invoked 
by clicking on Run Custom Tool. Unfortunately when ProtoBufTool is invoked, I 
now get an error window saying "The custom tool ProtoBufTool failed". I've run 
protogen.exe from the command line and it seems to work, and as indicated 
before, the whole thing works fine in VS 2008 (i.e. it generates the .cs file). 
Are there any extra diagnostics I can turn on to find out why the invocation of 
ProtoBufTool may have failed?

Original comment by 0x6e6...@gmail.com on 24 Jun 2010 at 7:38

GoogleCodeExporter commented 9 years ago
(As a side note):

On reflection it is probably not logical to expect that the tool should work 
within an F# project because it is generating C# source, which would be 
incompatible with the F# project, so sorry about that oversight.

Original comment by 0x6e6...@gmail.com on 24 Jun 2010 at 7:41

GoogleCodeExporter commented 9 years ago
Furthermore, I've just tried to install this on another install of Windows 7 
with VS 2010. It installs OK and I can invoke the Run Custom Tool, but it fails 
as well. However, in this scenario, an extra error window pops up that didn't 
on my original install.

So before the "The custom tool ProtoBufTool failed" error pops up, I get this 
error pop up:

"protogen.exe - Application Error"
"The application was unable to start correctly (0xc000007b). Click OK to close 
the application"

Original comment by 0x6e6...@gmail.com on 24 Jun 2010 at 7:46

GoogleCodeExporter commented 9 years ago
I think I've solved the issue: The text file I was creating from within VS had 
the Codepage 65001 encoding which causes protogen to barf in this way:

foo.proto:7:3: Invalid control characters encountered in text.
The input file should be UTF8 without a byte-order-mark (in Visual Studio use 
"File" -> "Advanced Save Options..." to rectify)
An error occurred parsing foo.proto

So I changed the encoding of the page to Codepage 1252 and everything works.

Incidentally, on VS 2008, the output of protogen seems to get parsed and 
inserted into the VS Error Window, whereas on my VS 2010 setup, this does't 
seem to be the case.

Anyhow, thanks for all of your help, Marc. 

Thanks for 

Original comment by 0x6e6...@gmail.com on 24 Jun 2010 at 8:27

GoogleCodeExporter commented 9 years ago
I can't comment about the output tab, but it appears in the error tab:

Error   1   Custom tool error: test.proto:1:1: Invalid control characters 
encountered in text.    c:\users\marc\documents\visual studio 
2010\Projects\ConsoleApplication15\ConsoleApplication15\test.proto  1   1   ConsoleAp
plication15

Error   2   Custom tool error: The input file should be UTF8 without a 
byte-order-mark (in Visual Studio use "File" -> "Advanced Save Options..." to 
rectify)    c:\users\marc\documents\visual studio 
2010\Projects\ConsoleApplication15\ConsoleApplication15\test.proto  1   1   ConsoleAp
plication15

For info, the correct encoding is 65001 ***without BOM*** (somewhere near the 
bottom of the list). This is a glitch in Google's "protogen" utility. I have 
asked them to make it accept UTF8 with/without BOM, but they didn't seem 
interested.

Original comment by marc.gravell on 24 Jun 2010 at 11:08

GoogleCodeExporter commented 9 years ago
OK, good to know. Thanks for your time.

Original comment by 0x6e6...@gmail.com on 24 Jun 2010 at 12:39

GoogleCodeExporter commented 9 years ago
C# VS2010:
I can't import proto file in other project, even with full path. If all proto 
in a project, import works fine.
Error 1 Custom tool error: Import "..\TestA\A.proto" was not found or had 
errors.
Error 2 Custom tool error: ..\TestA\A.proto: File not found.

How can I import proto in other project?
Thanks

Original comment by miaoda...@gmail.com on 17 Mar 2011 at 5:36

GoogleCodeExporter commented 9 years ago
What are the relative locations of the files in that case? (so I can test)

Original comment by marc.gravell on 17 Mar 2011 at 6:49

GoogleCodeExporter commented 9 years ago
I have the same issue, I Can't import proto file in other project, I'm using 
VS2008.

Original comment by mchavarr...@gmail.com on 22 Mar 2011 at 4:20

GoogleCodeExporter commented 9 years ago
I get "cannot find custom tool ProtoBufTool" - any aid? (v1)

Original comment by tim@mylemans.com on 14 Jul 2011 at 11:54

GoogleCodeExporter commented 9 years ago
What IDE and what protobuf version?

Original comment by marc.gravell on 14 Jul 2011 at 1:27

GoogleCodeExporter commented 9 years ago
Visual Studio 2010 SP1 / protobuf v1 r406 (build the installer, installed 
multiple times using the build installer)

I did solve it myself by inserting the missing CLSID / Generators keys.

Original comment by tim@mylemans.com on 14 Jul 2011 at 2:24

GoogleCodeExporter commented 9 years ago
I have the same issue: importing a .proto file from another project fails, even 
when using an absolute path. I know that I can specify the import directory 
multiple times with the --proto_path flag, but I'm using visual studio with the 
following rule for running the protoc compiler: protoc.exe 
-I="$(ProjectName)_protofiles" --cpp_out="$(ProjectName)_protofiles" [Inputs]

So, nothing is hardcoded. And I want to keep it that way, so I'd prefer to use 
relative import statements in the .proto file like:
import "../dir1/file1.proto";
import "../dir2/file2.proto";

Original comment by chriswil...@gmail.com on 25 Jul 2011 at 6:12

GoogleCodeExporter commented 9 years ago
Tooling changes here are on my roadmap; however, note that as a short-term 
option, you can also use "protoc" to compile your .proto(s) to a binary, and 
then use protogen on the compiled model. Protogen will accept that as input.

Original comment by marc.gravell on 26 Jul 2011 at 7:40

GoogleCodeExporter commented 9 years ago
I had "The custom tool 'ProtoBufTool' failed" error all the time. After 
investigation I found simple workaround: just copy all files from "C:\Program 
Files (x86)\protobuf-net\protobuf-net-VS9\" to AppData temp directory where 
Visual Studio tries to load ProtoBufGenerator.dll. I have this temp directory: 
C:\Users\<user>\AppData\Local\assembly\dl3\1L8VM9P3.V5N\997YCJP3.X53\5b161527\00
49d08c_e3dbca01\. This directory could be found by searching 
ProtoBufGenerator.dll.

P.S. This is known VS2010 bug: 
http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/900
c3dae-9018-4e00-b840-717b39c57604

Original comment by vladisla...@gmail.com on 14 Feb 2012 at 12:43

GoogleCodeExporter commented 9 years ago
In general "The custom tool 'ProtoBufTool' failed" problem was caused by 
"Shadow Copying Assemblies" feature:  
http://msdn.microsoft.com/en-us/library/ms404279.aspx

Seems the "GetInstallPath" method of "ProtoBufGenerator\ProtoBufTool.cs" should 
use Registry to find installation path (where protogen.exe is located).

Original comment by vladisla...@gmail.com on 14 Feb 2012 at 1:34

GoogleCodeExporter commented 9 years ago
1. VS10.msi has installed VS9.
2. Running the custom tool produces the "The custom tool 'ProtoBufTool' failed" 
error.
So, integration is unusable.
Any workaround?

Original comment by eigenein on 26 Apr 2012 at 10:15

GoogleCodeExporter commented 9 years ago
1: The VS9 thing is simply a typo from when the installer was written. It 
installs for VS10.

2: Is there an error message in the error output? Most likely it says (and I 
quote from my IDE, where it works fine) "Custom tool error: The input file 
should be UTF8 without a byte-order-mark (in Visual Studio use "File" -> 
"Advanced Save Options..." to rectify)" - the option needed by protoc (Google's 
tool) is: "Unicode (UTF-8 without signature) - Codepage 65001" - about 6 up 
from the bottom.

Original comment by marc.gravell on 27 Apr 2012 at 12:24

GoogleCodeExporter commented 9 years ago
1: Is the install path "C:\Program Files (x86)\protobuf-net\protobuf-net-VS9" 
also a typo?
2: There is no additional messages neither in message box nor in output window 
nor in "Errors" view.

Original comment by eigenein on 27 Apr 2012 at 12:37

GoogleCodeExporter commented 9 years ago
1: not so much a typo as "that install will work for both VS9 and VS10, and 
needs to go somewhere; it uses the VS9 API (which is supported by VS10), so - 
it is primarily VS9 (emph: works on both)"

2: hard to comment without an error, I agree. Have you tried reinstalling the 
addin?

Original comment by marc.gravell on 27 Apr 2012 at 1:12

GoogleCodeExporter commented 9 years ago
2: Seems that reinstalling has fixed the problem. At least, now I've seen the 
"The input file should be UTF8 without..." error message and after fixing the 
*.cs file was successfully created.

Original comment by eigenein on 27 Apr 2012 at 11:03