Error compiling ASMX while accessing the web service - asp.net

I have a ASMX web service. When I access it from a client the ASMX get compiled but I get this error:
Looking at csc.exe command line from the error detail the System.Windows.Forms asseembly is not referenced.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 3: using System.ComponentModel;
Line 4: using System.Drawing;
Line 5: using System.Windows.Forms;
Line 6: using System.Xml;
Line 7: using Idp.Core.Configuration;

This problem can occur for at least two reasons:
The required assembly (in this case, System.Windows.Forms) is not referenced by your project. You can resolve this by adding the reference to your project in Visual Studio and, if required, redeploying the site.
The using statement is superfluous. Sometimes I wind up with unwanted using statements in my file. If it's unused, deleting line 5 should resolve the issue.

Related

The type or namespace name 'DomainServices' does not exist in the namespace 'System.ServiceModel'

I am getting the following error in my VS 2015 project :
.net framework 4.6
Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'DomainServices' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)
Also the following dlls are missing under the References folder :
System.ServiceModel.DomainServices.EntityFramework
System.ServiceModel.DomainServices.Hosting
System.ServiceModel.DomainServices.Server
I believe you will need to install the WCF RIA Services Toolkit separately because DomainServices is not apart of the standard WCF library.
Here is the link to download the WCF RIA Services Toolkit

Can't add reference to System.ServiceProcess.dll

I am using System.ServiceProcess.dll in my ASP.NET application. I added a reference and intellisense recognizes it. But when I build an application, there is no System.ServiceProcess.dll in bin folder and application says it can't find a namespace. What may be wrong? Can I use this dll in IIS?
This is what I get:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0234: The type or namespace name 'ServiceProcess' does not exist in the namespace 'System' (are you missing an assembly reference?)
Source Error:
Line 5: using System.Diagnostics;
Line 6: using System.Linq;
Line 7: using System.ServiceProcess;
Line 8: using System.Web;
Line 9: using System.Web.UI;
Add a reference in the process to System.ServiceProcess.dll.
To do this, in the solution window, right click on "References" and choose "Add Reference.." Go to the .NET tab, and double click on System.ServiceProcess.dll.
Most likely you added reference to the DLL of wrong .NET version. (so it exists, but when trying to actually compile, it's breaking)
When adding the reference, make sure the version match the version of your project:

CS0234: Missing Assembly Reference

I have some missing assemblies in my PC, and don't have any idea how to fix it.
When I create a new ASP.NET MVC 4 internet application from template (using VS 2012) everything works fine. As soon as I try to integrate Web API controller I get a missing assembly reference error. For example, when I create application using ASP.NET 4 Web API default template and click "API" on the interface I get Compilation error:
Compiler Error Message: CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
I have checked the assembly and everything seems to be fine. It's in version 4.0. I have .NET framework 4.5 installed on my PC. Where should I look for the reason of the issue?
I saw this same error code (different missing reference) when compiling a PCL using msbuild but not when building via Visual Studio:
error CS0234: The type or namespace name 'Storage' does not exist in the namespace 'Windows' (are you missing an assembly reference?)
In my case it was caused by a 'using Windows.Storage;' statement that was not actually referenced by any code in the file. I removed the line and the error was fixed.

Server Error in '/IIS' Application

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'PropertiesLayer' could not be found (are you missing a using directive or an assembly reference?)
Looks like your code could not findout "PropertiesLayer" which you are refering in your code.
Where is PropertiesLayer defined ? Is it a seperate assembly ? Did you add a reference to that ? If not, add that. That would fix your problem.
Also make sure you are really using something inside that namespace, If you are not using,just remove the import /using statement. I have seen code where namespaces are refereed and not being used.

Web service Compilation Error

I have a problem with a web service. I add a web service reference to my project. I use this service in many pages. It is working correctly, no problems in VS but I copy App_WebReferences folder's files and Web.Config file to ISS path. But it is not working.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0246: The type or namespace name 'InterkomLaboratuar' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 22: InterkomLaboratuar.Service1SoapClient _sistemTip = new InterkomLaboratuar.Service1SoapClient();
Source File: c:\Inetpub\wwwroot\MedulaV3\diyaliz02\Istemler.aspx.cs Line: 22
How can i solve this problem please help..
Copy Bin folder to IIS. You are missing some assemblies.

Resources