Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paket should not add <Paket> element in csporj file to cs files that are added via nuggets #1513

Closed
tsibelman opened this issue Mar 13, 2016 · 31 comments

Comments

@tsibelman
Copy link
Contributor

Following paket.dependencieswill

source https://www.nuget.org/api/v2/
nuget Microsoft.Orleans.Templates.Interfaces 

Adds empty orleans.codegen.cs file to csproj like this

    <Compile Include="Properties\orleans.codegen.cs">
      <Paket>True</Paket>
    </Compile>

This unexpected element hides file from Orleans code generator, and no code is created. The failure is detected only during run time, right now we manually remove this property.

@forki
Copy link
Member

forki commented Mar 13, 2016

Can't you use the no-content option?

@tsibelman
Copy link
Contributor Author

Then I will need to add this file manually ?

@forki
Copy link
Member

forki commented Mar 13, 2016

Ok I don't really understand the problem. What is Orleans expecting?

@tsibelman
Copy link
Contributor Author

It expecting to have this file in the csproject but it do not expect it to have<Paket>True</Paket>under it.

@tsibelman
Copy link
Contributor Author

It should be just <Compile Include="Properties\orleans.codegen.cs"/>

@forki
Copy link
Member

forki commented Mar 13, 2016

Tbh this sounds like a bug in that tool

@tsibelman
Copy link
Contributor Author

I don't sure if it a bug, Paket is not a part of csproj XSD specification so varius tools that do XCD based validation could fail.

@isaacabraham
Copy link
Contributor

@tsibelman What's the XSD spec say though - I wouldn't have thought that adding an extra element inside the Compile node would have caused an issue?

@tsibelman
Copy link
Contributor Author

It defined inside Microsoft.Build.Commontypes.xsd as you can see Compile has number of possible predefined child elements and Paket is not one of them.

 <xs:element name="Compile" substitutionGroup="msb:Item">
        <xs:annotation>
            <xs:documentation><!-- _locID_text="Compile" _locComment="" -->Source files for compiler</xs:documentation>
        </xs:annotation>        
        <xs:complexType>           
            <xs:complexContent>
                <xs:extension base="msb:SimpleItemType">
                    <xs:sequence minOccurs="0" maxOccurs="unbounded">                       
                        <xs:choice>
                            <xs:element name="SubType"/>
                            <xs:element name="DependentUpon"/>
                            <xs:element name="AutoGen">
                                <xs:annotation>
                                    <xs:documentation><!-- _locID_text="Compile_AutoGen" _locComment="" -->Whether file was generated from another file (boolean)</xs:documentation>
                                </xs:annotation>
                            </xs:element>                                 
                            <xs:element name="DesignTime"/>
                            <xs:element name="Link">
                                <xs:annotation>
                                    <xs:documentation><!-- _locID_text="Compile_Link" _locComment="" -->Notional path within project to display if the file is physically located outside of the project file's cone (optional)</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="DesignTimeSharedInput"/>
                            <xs:element name="Visible">
                                <xs:annotation>
                                    <xs:documentation><!-- _locID_text="Compile_InProject" _locComment="" -->Display in user interface (optional, boolean)</xs:documentation>
                                </xs:annotation>
                            </xs:element>                                
                            <xs:element name="CopyToOutputDirectory"/>
                            <xs:element name="VBMyExtensionTemplateID"/>
                        </xs:choice>
                    </xs:sequence>
                    <!-- redefine Include just to give a specific description -->
                    <xs:attribute name="Include" type="xs:string" use="optional">
                        <xs:annotation>
                            <xs:documentation><!-- _locID_text="Compile_Include" _locComment="" -->Semi-colon separated list of source files (wildcards are allowed)</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>                    
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>

@isaacabraham
Copy link
Contributor

Perhaps a Paket=true attribute rather than an element would work?

@tsibelman
Copy link
Contributor Author

I think it can work

@forki
Copy link
Member

forki commented Mar 13, 2016

Nope. IIRC the attribute failed somewhere in normal csproj process.
On Mar 13, 2016 6:15 PM, "tsibelman" notifications@github.com wrote:

I think it can work


Reply to this email directly or view it on GitHub
#1513 (comment).

@isaacabraham
Copy link
Contributor

Can you confirm this - remove the element, replace with attribute, does it work? Not saying that that's the right solution - Orleans is open source, we should find out what it's doing.

@tsibelman
Copy link
Contributor Author

Maybe this info should not be stored in csproj at all ? It already available in nugets.

@isaacabraham
Copy link
Contributor

@tsibelman it's needed for upgrades between packages I think.

@forki
Copy link
Member

forki commented Mar 13, 2016

It's needed for paket to understand where people opt out of default
behavior. If you remove the flag our set it to false then we don't touch it
anymore.
On Mar 13, 2016 6:48 PM, "Isaac Abraham" notifications@github.com wrote:

@tsibelman https://github.com/tsibelman it's needed for upgrades
between packages I think.


Reply to this email directly or view it on GitHub
#1513 (comment).

@tsibelman
Copy link
Contributor Author

@forki if people choose option content: once it looks logical to not add this element at all, what do you think ?

@forki
Copy link
Member

forki commented Mar 14, 2016

Mhm that could make sense. Yes
On Mar 13, 2016 19:20, "tsibelman" notifications@github.com wrote:

@forki https://github.com/forki if people choose option content: once
it looks logical to not add this element at all, what do you think ?


Reply to this email directly or view it on GitHub
#1513 (comment).

@tsibelman
Copy link
Contributor Author

@forki great, this change would definatly help us

@forki forki closed this as completed in 8d75dff Mar 14, 2016
@forki
Copy link
Member

forki commented Mar 14, 2016

done. please try again

@tsibelman
Copy link
Contributor Author

I tried I see that it still adding it

I declared content: once in the start of paket.dependencies and run this command paket convert-from-nuget -f

@forki
Copy link
Member

forki commented Mar 14, 2016

yes. try to remove the reference from the csproj to make it believe that it starts from scratch.

@tsibelman
Copy link
Contributor Author

Can it work on conversion from nugget ?

@forki
Copy link
Member

forki commented Mar 14, 2016

did not try that

@tsibelman
Copy link
Contributor Author

I wanted it to work during conversion by adding paket.template with content: once, looks like it not working :(

@forki
Copy link
Member

forki commented Mar 14, 2016

I made it a bit more agressive. The test shows it's not adding the paket tag any more. In fact it's removing it.

forki added a commit that referenced this issue Mar 14, 2016
@tsibelman
Copy link
Contributor Author

It works perfectly thank you

@tsibelman
Copy link
Contributor Author

Looks like in latest version this behavior not working

@forki
Copy link
Member

forki commented Mar 20, 2016

Are you sure? We didn't change that.
On Mar 20, 2016 13:32, "tsibelman" notifications@github.com wrote:

Looks like in latest version this behavior not working


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#1513 (comment)

@tsibelman
Copy link
Contributor Author

Let's me double check it

@tsibelman
Copy link
Contributor Author

All good it was my mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants