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

can't compile DocumentFormat.OpenXml after cloning :/ #1514

Closed
hannes7g opened this issue Aug 24, 2023 · 4 comments
Closed

can't compile DocumentFormat.OpenXml after cloning :/ #1514

hannes7g opened this issue Aug 24, 2023 · 4 comments

Comments

@hannes7g
Copy link

hannes7g commented Aug 24, 2023

Describe the bug
After cloning from github on a clean system, i cannot compile DocumentFormat.OpenXml project.

To Reproduce

  1. Clone the repository from OpenXMLSDK (this repo)
  2. Build DocumentFormat.OpenXml.Generator and DocumentFormat.OpenXml.Generator.Models, Built. TRy to build DocumentFormat.OpenXml 179 Errors for missing classes for parts.

..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\InkML\Ink.cs(28,26,28,39): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\AdditionalCharacteristics\AdditionalCharacteristicsInfo.cs(35,26,35,39): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Bibliography\Sources.cs(37,26,37,39): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\InkML\Ink.cs(37,26,37,39): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\AdditionalCharacteristics\AdditionalCharacteristicsInfo.cs(17,48,17,61): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Bibliography\Sources.cs(19,26,19,39): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\InkML\Ink.cs(19,22,19,35): error CS0246: The type or namespace name 'CustomXmlPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\Model3DReferenceRelationshipPart.cs(12,41,12,59): error CS0115: 'Model3DReferenceRelationshipPart.IsValidContentType(IPackagePart)': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\MailMergeRecipientDataPart.cs(17,60,17,79): error CS0115: 'MailMergeRecipientDataPart.InternalRootElement': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\MailMergeRecipientDataPart.cs(24,51,24,66): error CS0115: 'MailMergeRecipientDataPart.PartRootElement': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Wordprocessing\ConditionalFormatStyle.cs(31,41,31,65): error CS0115: 'ConditionalFormatStyle.StrictTranslateAttribute(in OpenXmlQualifiedName, string?)': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Wordprocessing\Document.cs(11,41,11,65): error CS0115: 'Document.StrictTranslateAttribute(in OpenXmlQualifiedName, string?)': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\OpenXmlSupportedRelationshipExtensions.cs(56,19,56,46): error CS0246: The type or namespace name 'AlternativeFormatImportPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Wordprocessing\Indentation.cs(23,41,23,65): error CS0115: 'Indentation.StrictTranslateAttribute(in OpenXmlQualifiedName, string?)': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\OpenXmlSupportedRelationshipExtensions.cs(67,19,67,46): error CS0246: The type or namespace name 'AlternativeFormatImportPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Wordprocessing\Justification.cs(21,41,21,65): error CS0115: 'Justification.StrictTranslateAttribute(in OpenXmlQualifiedName, string?)': no suitable method found to override
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\OpenXmlSupportedRelationshipExtensions.cs(78,19,78,37): error CS0246: The type or namespace name 'CustomPropertyPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Packaging\OpenXmlSupportedRelationshipExtensions.cs(89,19,89,37): error CS0246: The type or namespace name 'CustomPropertyPart' could not be found (are you missing a using directive or an assembly reference?)
..\Open-XML-SDK\src\DocumentFormat.OpenXml\Schema\Wordprocessing\StylePaneSortMethods.cs(30,41,30,65): error CS0115: 'StylePaneSortMethods.StrictTranslateAttribute(in OpenXmlQualifiedName, string?)': no suitable method found to ove
....
...
..

Expected behavior
Repositories should be buildable by default without having to check google, stackoverflow etc.. I dont see anywhere any info related to this in README files.

I would appreciate if someone can tell me how i should generate these files. There are some file under "Open-XML-SDK\generated" but they are not references fromthe project. Do i have to copy paste these folder to "Open-XML-SDK\src\DocumentFormat.OpenXml" folder somehow?
Thanks

@twsouthwick
Copy link
Member

Can you describe what you did? Did you use the dotnet command or did you use VS/VS Code/Rider? What is your dotnet --list-sdks output?

The build generally requires a fairly new version of VS and the .NET toolchain, but for how far you got, it looks like you have a sufficient version.

@hannes7g
Copy link
Author

hannes7g commented Sep 2, 2023

I used VS2022.

5.0.203 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]
6.0.413 [C:\Program Files\dotnet\sdk] <<--i am or i want to use this
7.0.201 [C:\Program Files\dotnet\sdk]

I had to add *_g.cs files manually. and then i could be able to compile it.

but now the problem is that i cannot publish my software. when i copy DocumentFormat.OpenXml.dll and DocumentFormat.OpenXml.Framework.dll files with the executable it is not generating the documents. I also copied Newtonsoft.Json.dll and System.IO.Packaging.dll and still didnt work.

I haven even converted these 4 projects to net6.0-windows x64 and now i can compile but generated excel and word files does not show anything.

What dlls should i deliver to that it works with .net6 x64? I cant event find these Newtonsoft.Json.dll and System.IO.Packaging.dll as 64 bit assembly.

@twsouthwick
Copy link
Member

I'm not sure I understand the scenario here. Are you trying to publish your own build of it? We generally recommend the nuget packages as the way to use the SDK. I'll try to answer some of your points below, but it would be helpful to understand why you are building the SDK locally.

I used VS2022.

5.0.203 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.402 [C:\Program Files\dotnet\sdk]
6.0.413 [C:\Program Files\dotnet\sdk] <<--i am or i want to use this
7.0.201 [C:\Program Files\dotnet\sdk]

I had to add *_g.cs files manually. and then i could be able to compile it.

We only support building the OpenXML SDK with the .NET SDK that we define in global.json, which we generally keep to the latest released tool chain. You will not be able to build with a .NET 6 toolchain

ut now the problem is that i cannot publish my software. when i copy DocumentFormat.OpenXml.dll and DocumentFormat.OpenXml.Framework.dll files with the executable it is not generating the documents. I also copied Newtonsoft.Json.dll and System.IO.Packaging.dll and still didnt work.

Need more details for this

I haven even converted these 4 projects to net6.0-windows x64 and now i can compile but generated excel and word files does not show anything.

Which projects are referring to here? The SDK supports windows targets without any special effort; i.e. there is no need to change the TFMs.

What dlls should i deliver to that it works with .net6 x64? I cant event find these Newtonsoft.Json.dll and System.IO.Packaging.dll as 64 bit assembly.

That's because they are not native binaries - they are IL, not any specific architecture

@twsouthwick
Copy link
Member

@hannes7g I haven't heard a response, so I'll consider it solved. If you hit additional issues when trying to clone the project, please reopen the issue.

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

2 participants