icsharpcode / SharpDevelop

#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
2.09k stars 771 forks source link

Compile error CS1502 + CS1503 when adding AutoUpdater.NET via NuGet package manager #813

Closed robytur closed 6 years ago

robytur commented 6 years ago

Hi guys,

first of all I want to thank you for the job you've done for this incredible project, for many aspects it's even better than Visual Studio in my opinion. Now, I was trying to add the AutoUpdater.NET reference by installing the package via NuGet: it correctly adds the reference to the "References" section of my project, then I add the

using AutoUpdaterDotNET;

at the top of my MainForm.cs file and, in the "OnFormLoad()" method I add the line

AutoUpdater.Start("http://rbsoft.org/updates/AutoUpdaterTest.xml");

When I try to compile, I get two errors:

The autocompletion system tells me that the method start() appears first with the overload: (1 of 2) public static void Start(Assembly myAssembly = null);

while the other (the one I need) is:

(2 of 2) public static void Start(string appCast, Assembly myAssembly = null);

It seems as if SharpDevelop could not detect overloads for the functions contained in AutoUpdater.NET reference but just the first one. I tried the same steps in Visual Studio and it works perfectly.

Is this a bug with SD or NuGet package manager?

Thanks. Kind regards, Rob

subchannel13 commented 6 years ago

It's compiler error which is probably external to SD. Compiler executable is shipped with .Net framework (https://stackoverflow.com/questions/5721053/where-is-the-net-command-line-compiler) and SD is probably just feeding project file to it. Could be that SD is using a compiler version which doesn't understand optional parameters.

Which framework are you targeting and which compiler version is set in project settings?

robytur commented 6 years ago

Compiler version C# 3.0, .NET target framework 3.0.

subchannel13 commented 6 years ago

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments

Optional parameters are C# 4 feature, try increasing compiler version.

robytur commented 6 years ago

Uhm.. maybe I was a bit outdated? I usually tend to stay to the lower version possible just in favor of higher compatibility, but I need to reconsider advantages of using new versions (and since Windows 8 the minimum preinstalled version is 4.5).

However, this simple advice solved my problem. Thank you really much for your time!