I create simple cs file with one class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Bed
{
public class TimeoutWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest w = base.GetWebRequest(uri);
w.Timeout = 30 * 1000;
return w;
}
}
}
suddenly my visual studio has interpreted it as a form class.. where did I go wrong?

These are the versions I use:
Microsoft Visual Studio Ultimate 2013
Version 12.0.21005.1 REL
Microsoft .NET Framework
Version 4.5.50938
I'm not sure how it happened but this is how I fix it:
I expect you to find something like this:
<ItemGroup>
<Compile Include="TimeoutWebClient.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="TimeoutWebClient.Designer.cs">
<DependentUpon>TimeoutWebClient.cs</DependentUpon>
</Compile>
<!-- other files go here -->
Remove the SubType tag. If you also want to undo any dependencies remove the <DependentUpon> tag as well.
Save your project file, right-click it and choose 'Reload'.
Verify if you achieved what you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With