Archived
This forum has been archived. Please start a new discussion on GitHub.
VS2010 add-in and perforce
I currently have a project that has slice files as links. So the proiject is purely a cspjoj file. i have the proj file under source control. When I sync a new workspace with the project in it the .cs files are not generated. I have to check the files out, edit them, and then double click the missing .cs file in the project to force a regeneration of the .cs files. This seems very cumbersome and does not support automated builds.
What could I be doing wrong? I am sure it is a simple user error on my part I just cannot find the magic switch to make it work.
What I would presume would happen would be that when the project is built the files are first generated if they don't exist and then compiled.
I would appreciate any help in this matter.
ICE version 3.4.1
Add-in version 3.4.1.2
Visual Studio 2010 C# .Net4
Windows 7
What could I be doing wrong? I am sure it is a simple user error on my part I just cannot find the magic switch to make it work.
What I would presume would happen would be that when the project is built the files are first generated if they don't exist and then compiled.
I would appreciate any help in this matter.
ICE version 3.4.1
Add-in version 3.4.1.2
Visual Studio 2010 C# .Net4
Windows 7
0
Comments
-
Hi,I currently have a project that has slice files as links. So the proiject is purely a cspjoj file.
Can you clarify that, how you add the files to the project?When I sync a new workspace with the project in it the .cs files are not generatedI have to check the files out, edit them, and then double click the missing .cs file in the project to force a regeneration of the .cs files.What I would presume would happen would be that when the project is built the files are first generated if they don't exist and then compiled.
The slice compiler is run at several points, first when a project is open all files that aren't update are generated, second when a Slice file is added to project the builder is run and check all files that need to be rebuild, third when a project is build the slice compiler is also run, fourth when Slice files are removed the builder is also run.
Are you sure that the files aren't generated in you case, it seems to me that could be that just the icon's are reflecting the current state. If the generated files aren't there could you provide steps to reproduce the issue so we could investigate it.
Jose0 -
Can you clarify that, how you add the files to the project?I m not sure what you mean, with syn a new workspace, is that a VS 2010 feature?Double click the files doesn't cause a regeneration, but maybe the icons aren't update by VS at that point.The slice compiler is run at several points, first when a project is open all files that aren't update are generated, second when a Slice file is added to project the builder is run and check all files that need to be rebuild, third when a project is build the slice compiler is also run, fourth when Slice files are removed the builder is also run.Are you sure that the files aren't generated in you case, it seems to me that could be that just the icon's are reflecting the current state. If the generated files aren't there could you provide steps to reproduce the issue so we could investigate it.
Jose
The build does indeed create the files but the icon state is not updated by VS0 -
The issue still remains, however that in a clean workspace doing a build solution F6 in VS does not generate the .cs files.
If I build the project manually SHIFT-F6 they are generated then I can build the rest of the solution.
Why won't the Build Solution option generate the .cs files?0 -
There are not generated when the project is opened, only when build is run.
Files should be generated when opened the solution, could you set the tracing level to "Debug" in Ice Configuration and review Visual Studio Output. Slice compiler will trace the exact command it execute here.The issue still remains, however that in a clean workspace doing a build solution F6 in VS does not generate the .cs files.
In my VS 2010 setup F6 does nothing, F7 builds the solution an Slice compiler is run at this point.After furthur testing that is quite true. If I invoke build on the project the .cs files are indeed created VS does not however recognise them until I double click.
If i not missed something your problem is that when you open/build the solution slice files aren't generated, that shouldn't happen, if you continue having these problem, the simple could be to attach a Visual Studio project that allow us to reproduce the issue. We will be happy to look at it
Jose0 -
Files should be generated when opened the solution, could you set the tracing level to "Debug" in Ice Configuration and review Visual Studio Output. Slice compiler will trace the exact command it execute here.In my VS 2010 setup F6 does nothing, F7 builds the solution an Slice compiler is run at this point.We will check if we can force VS to update icons when the generated files has been created.If i not missed something your problem is that when you open/build the solution slice files aren't generated, that shouldn't happen, if you continue having these problem, the simple could be to attach a Visual Studio project that allow us to reproduce the issue. We will be happy to look at it
Jose
James0 -
I am obviously doing something wrong.
I see no debug output in the output window. I have attached a screen-shot of the output window in VS2010. If this is not where your debug goes, where does it go?
I have also attached a screen-shot of the ICE config window for you to pass comment on. Maybe I have not got things checked that I should or have something checked that I should not.
I hope it is something simple
James0 -
OK what I see in the debug is
------ Slice compilation started at: 8:48 AM Project: RcmsMain ------ ------ Slice compilation succeeded: Project: RcmsMain ------
Then later------ Build started: Project: IceInterfaces, Configuration: Debug x64 ------ error CS1504: Source file '...acoustic.cs' could not be opened ('Unspecified error ') error CS1504: Source file '...recorder.cs' could not be opened ('Unspecified error ')
The slice files are in the IceInterfaces project not the RcmsMain project (which is the start-up project).
It seems the slice compiler is run on the RcmsMain project that has no slice files to process and succeeds.
The slice compiler is not run on the IceInterfaces project where it should be.
How do I tell the slice compiler to run on the IceInterfaces project?
When I run the build on the IceInterfaces project directly I get the following------ Slice compilation started at: 8:53 AM Project: RcmsMain ------ ------ Slice compilation succeeded: Project: RcmsMain ------ ------ Build started: Project: IceInterfaces, Configuration: Debug x64 ------ IceInterfaces -> ...IceInterfaces\bin\x64\Debug\IceInterfaces.dll ========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
Which seems bizarre that the slice compiler is running on RcmsMain when I invoked the build on the individual project.
I am now totally confused.
James0 -
Hi JamesThe slice files are in the IceInterfaces project not the RcmsMain project (which is the start-up project).
It seems the slice compiler is run on the RcmsMain project that has no slice files to process and succeeds.
The slice compiler is not run on the IceInterfaces project where it should be.
How do I tell the slice compiler to run on the IceInterfaces project?
You should enable the Ice Configuration in the project "Ice Interfaces" that has the slice files. In "RcmsMain" you can enable the builder if you want to manage Ice references with the add-in.
Seems to me that Slice compiler is run in "RcmsMain" because there is a dependecy on IceInterfaces from "RcmsMain" this project.
When you build a solution, the projects are build in order, Visual Studio handle which projects should be build first based on project dependencies.
When you build a single project, the add-in first build all projects, that are build dependencies of the project, and then continue to build the project.
Seems to me that in your case "RcmsMain" is a depency for "IceInterfaces", and you also has enabled the Ice add-in in "RcmsMain" project, that is the reason you see the Slice builder being run in "RcmsMain" when you build "IceInterfaces" project.
So i think that what you should do is,
1) Enable Ice add-in in "IceInterfaces" project
2) If RcmsMain is the start-up project and you want to use generated code here, add a reference to "IceInterfaces" in that project, Right click in "References" choose the Projects tab, and check "IceInterfaces" this will also create a dependency on "IceInterfaces", so the build order is setup properly.
Note that if "IceInterfaces" has currently a dependency on "RcmsMain" you should first remove that dependency, otherwise Visual Studio don't let you add a reference to "IceInterfaces" as this will create a circular dependency.
I have been doing some test win perforce today, one thing i have noticed is that generated files should not be checked-in, because perforce lock files an the add-in will not be able to update the files, in general isn't a good idea to have generated files checked in.
I looking at the other issues you posted
Jose0 -
Looking at the screen shot of your "Ice Configuration" the include path seems to include "..\..\IceInterfaces", and if i not wrong that is your "RcmsMain", that doesn't contain Slice files.
In general you only need to configure include path for projects that contains Slice files.
In projects that doesn't contain Slice files, you could also use the add-in to facilitate the task to manage references to Ice assemblies, but in that case only "Ice Home" and "Ice Components" options are relevant.
Other options are intended to configure the slice compiler, but when there isn't Slice files there isn't a need to configure the Slice compiler.0 -
Build started: Project: IceInterfaces, Configuration: Debug x64
error CS1504: Source file '...acoustic.cs' could not be opened ('Unspecified error ')
error CS1504: Source file '...recorder.cs' could not be opened ('Unspecified error ')
I unsure about that, the error come from C# compiler, seems that the files are locked or missed when C# compiler try to read it. Are this files generated from Slice? If after follow the recommendation in my previous post you still have problems with this we will look at it again, but i think is due to the other configuration issues i have comment on.
Jose0 -
You should enable the Ice Configuration in the project "Ice Interfaces" that has the slice files. In "RcmsMain" you can enable the builder if you want to manage Ice references with the add-in.Seems to me that Slice compiler is run in "RcmsMain" because there is a dependecy on IceInterfaces from "RcmsMain" this project.When you build a solution, the projects are build in order, Visual Studio handle which projects should be build first based on project dependencies.
When you build a single project, the add-in first build all projects, that are build dependencies of the project, and then continue to build the project.Seems to me that in your case "RcmsMain" is a depency for "IceInterfaces",and you also has enabled the Ice add-in in "RcmsMain" project, that is the reason you see the Slice builder being run in "RcmsMain" when you build "IceInterfaces" project.So i think that what you should do is,
1) Enable Ice add-in in "IceInterfaces" project2) If RcmsMain is the start-up project and you want to use generated code here, add a reference to "IceInterfaces" in that project, Right click in "References" choose the Projects tab, and check "IceInterfaces" this will also create a dependency on "IceInterfaces", so the build order is setup properly.Note that if "IceInterfaces" has currently a dependency on "RcmsMain" you should first remove that dependency, otherwise Visual Studio don't let you add a reference to "IceInterfaces" as this will create a circular dependency.I have been doing some test win perforce today, one thing i have noticed is that generated files should not be checked-in, because perforce lock files an the add-in will not be able to update the files, in general isn't a good idea to have generated files checked in.0 -
Looking at the screen shot of your "Ice Configuration" the include path seems to include "..\..\IceInterfaces", and if i not wrong that is your "RcmsMain", that doesn't contain Slice files.In general you only need to configure include path for projects that contains Slice files.In projects that doesn't contain Slice files, you could also use the add-in to facilitate the task to manage references to Ice assemblies, but in that case only "Ice Home" and "Ice Components" options are relevant.
OK I will verify and then post screen shots of the two configurations. It has, however seemed in the past that when I select Ice Configuration from the context menu for the IceInterfaces projcect, The changes get made to the RcmsMain project instead, but I will verify this behaviour.Other options are intended to configure the slice compiler, but when there isn't Slice files there isn't a need to configure the Slice compiler.0 -
I unsure about that, the error come from C# compiler, seems that the files are locked or missed when C# compiler try to read it. Are this files generated from Slice? If after follow the recommendation in my previous post you still have problems with this we will look at it again, but i think is due to the other configuration issues i have comment on.
Jose0 -
Quote:
Originally Posted by xdm View Post
In general you only need to configure include path for projects that contains Slice files.
I believe that is what I have done.
But the Configuration dialog you attached, is for RcmsMain not for IceInterfaces, see the title in the configuration dialog you attached "Project: RcmsMain"0 -
But the Configuration dialog you attached, is for RcmsMain not for IceInterfaces, see the title in the configuration dialog you attached "Project: RcmsMain"
Yes it is. I use the Solution Navigator add-in for VS2010 and it has different behavior to the Solution Explorer that is default with VS2010. When i right click on the IceInterfaces project I get the config dialog for the RcmsMain project. Go figure...
Having said that Using 'Solution Explorer' the 'Ice Configuration' item is greyed out for the IceInterfaces project (and all non-start-up projects).
How do I get it enabled so I can configure the IceInterfaces project?0 -
I think I am getting an inkling into the issue.
It seems that the RcmsMain project tries to invoke the Ice Compiler on the IceInterfaces directory (..\..\IceInterfaces), but this directory has no slice files in it because they are links to files in other locations in the IceInterfaces csproj file. As far as RcmsMain is concerned it has done the right thing.
Before you ask, No we cannot have the ice files in the project as non-links as the ice files are shared between a C++ linux build and a C# windows build.
The IceInterfaces project has no Ice compiler options enable because the item is greyed out and I cannot access them. maybe if I can enable the Ice Compiler on the IceInterfaces project and remove them from the RcmsMain project all will work well.0 -
I use the Solution Navigator add-in for VS2010Having said that Using 'Solution Explorer' the 'Ice Configuration' item is greyed out for the IceInterfaces project (and all non-start-up projects).
How do I get it enabled so I can configure the IceInterfaces project?
It should be enabled, for C#, C++ projects, note the that 'Ice Configuration' is temporally disabled when the project is build, but is enabled again after the build ends, it should not be any difference in that the project is an startup project or not.0 -
It should be enabled, for C#, C++ projects, note the that 'Ice Configuration' is temporally disabled when the project is build, but is enabled again after the build ends, it should not be any difference in that the project is an startup project or not.
Maybe it SHOULD be but it is NOT. What would cause it to be not enabled?0 -
this is what is in my csproj file for the IceInterfaces project
<ItemGroup> <None Include="..\..\..\ice\genasor\recorder.ice"> <Link>recorder.ice</Link> </None> <None Include="..\..\..\ice\saars\acoustic.ice"> <Link>acoustic.ice</Link> </None> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> <UserProperties ZerocIce_Prefix="False" ZerocIce_ExtraOptions="--underscore" ZerocIce_IncludePath="." ZerocIce_Enabled="True" ZerocIce_VerboseLevel="0" /> </VisualStudio> </ProjectExtensions>
0 -
I think I am getting an inkling into the issue.
It seems that the RcmsMain project tries to invoke the Ice Compiler on the IceInterfaces directory (..\..\IceInterfaces), but this directory has no slice files in it because they are links to files in other locations in the IceInterfaces csproj file. As far as RcmsMain is concerned it has done the right thing.
Before you ask, No we cannot have the ice files in the project as non-links as the ice files are shared between a C++ linux build and a C# windows build.
You can have Slice files as links in RcmsMain, and configure the builder in that project, that should work.0 -
Maybe it SHOULD be but it is NOT. What would cause it to be not enabled?
Could you disable the Solution Navigation add-in and check again to see if that works.0 -
Actually will be good if you can attach a demo project, i will look at it, if you don't want to attach it here you can send i to support@zeroc.com
Jose0 -
Actually will be good if you can attach a demo project, i will look at it, if you don't want to attach it here you can send i to support@zeroc.com
Jose
OK I will see if I can cut down our full project to one which will demo the fault and can be sent.0 -
Attached is a project that does not work.
- I have not configured the Slice compiler in the IceAddinTest mainline.
- I am unable to configure the Slice compiler for the IceInterfaces project
I will now modify it to have the slice compiling in the IceAddInTest project as per out current system0 -
attached is the second project that has the slice comiler configured in the IceAddInTest project and it behaves the same as described prteviously.
If you delete the recorder.cs file from underneath VS2010 (using windows explorer) then try to build the solution it fails because the Recorder.cs file does not exist.
If you build the IceInterface project first then build the solution the file is then generated and all is well.
I hope these help0 -
Hi James
I have looked at your demos, and i can reproduce your problem, i debugging the issue , meanwhile if you move "IceIterfaces" project out of "ice" folder in solution explorer, you will be able to access "Ice Configuration" for this project and the build will work fine.0 -
Hi James,
I have review your projects, and found the issues, the add-in currently don't work with projects that are inside a solution folder, you need to move the projects out of the solution folder. The issue will be fixed with the next add-in release.
I have also looked at the "Solution Navigator" add-in, the problem here is that Ice Add-In, gets the selected project from "Solution Explorer", i cannot promise a fix for that in the next release, but i will try to fix it.
Thanks for report the problems
Regards,
Jose0 -
Hi James
I have looked at your demos, and i can reproduce your problem, i debugging the issue , meanwhile if you move "IceIterfaces" project out of "ice" folder in solution explorer, you will be able to access "Ice Configuration" for this project and the build will work fine.
Thankyou for your help on this issue.
I will move it out of the folder for now as a work-around.
What is the ETA for the next release of the add-in?0 -
Hi James,
We don't know yet when we'll make another release of the VS add-in; the latest update was released about 3 weeks ago, so a new release is not imminent.
Best regards,
Bernard0