This project has moved and is read-only. For the latest updates, please go here.

SharpDevelop

Feb 16 at 4:59 PM
Hello,
I'm new to coding. Can netdxf be compiled in SharpDevelop instead of Visual Studio? I've opened the solution files in SharpDevelop but get many errors and a failed build. Plainly put, is netdxf exclusive to Visual Studio only?
Feb 17 at 3:15 PM
Edited Feb 17 at 9:50 PM
SharpDevelop should be able to open Visual Studio projects. The main requirement is the .NET Framework 4.5, I have not tried it but as long you use SharpDevelop 4.5 or 5 it should work. What kind of errors are you getting?

Daniel
Mar 8 at 4:32 PM
Hey Daniel,

I'm confused. I downloaded the netDxf 2.0.2 on the homepage, but am not sure how to run the program. I'm using the latest SharpDevelop. Forgive me for such a rookie question, but that's what I am.
Mar 10 at 6:20 PM
netDxf is a software library (dll) not an application, therefore there is no executable that you can "run". You need to add the netDxf dll as a reference to your own project, the same way you add or remove other other net Framework or external libraries that you might use.

Additionally to the download option in the front page, that only includes the library, you can also download the full source code. There you will find a solution that contains two project, one is the actual netDxf source code and other called "TestDxfDocument" that I use to test it. It includes lots of example on how to load and save dxf files, how to create and modify different elements of a dxf, etc.

Daniel
Mar 10 at 6:48 PM
This is what I get when I try to run the .netdxf solution in the latest SharpDevelop:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. (MSB3270)
There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "PresentationCore", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. (MSB3270)
The name 'nameof' does not exist in the current context (CS0103) - C:\Users\username\Documents\DXF2\netDxf\Collections\DimensionStyleOverrideDictionary.cs:134,53
The name 'nameof' does not exist in the current context (CS0103) - C:\Users\username\Documents\DXF2\netDxf\Collections\DimensionStyleOverrideDictionary.cs:203,49
The name 'nameof' does not exist in the current context (CS0103) - C:\Users\username\Documents\DXF2\netDxf\Collections\DimensionStyleOverrideDictionary.cs:205,135

407 errors in total. Would you happen to know how I can fix this?
Mar 14 at 7:16 PM
The output you are showing correspond to two different erros:
  1. MSB3270. netDxf is build with the Platform Target set to AnyCPU, check if while opening the solution with SharpDevelop it has changed that. In VisualStudio that option is under the Build tab in the project properties, I guess in SharpDevelop should be in a similar place.
  2. CS0103. Lots of this kind of errors might appear, nameof is a new keyword introduced in C# 6, do not confuse the C# version with the NET Framework version they are different. If SharpDevelop shows that error is because they are not up to date and that specific keyword is not recognized. nameof(value) is the same as "value". Your choices are modify those entries yourself, wait until they update it, or change to VisualStudio, the Community Edition is also free.
Despite those errors there is no need to compile the library, use the one already provided.

Daniel
Mar 14 at 8:23 PM
I think I might have gotten it to work. I did download VS 2015. For the "TestDxfDocument" I set it to Set as Startup Project. Once I compiled it, it showed me the number of entities and so forth for the sample drawing. Here's my question: How would I turn this into a stand alone EXE to use with any dxf file?
Mar 18 at 5:19 PM
You will have to create a new project, add a reference to netDxf as an external library to have access to its functionality, decide if you are going to build an interface using WinForms or WPF, you could even use the console, and develop the required code to select and load the desired dxf. But, you will find a lot more detailed information about all of this and a lot more in a book.

Daniel