i found it. i was traing to compile the application using .net framework 4 client profile.
if you use the complete version of .net framework (go to project properties / application / target framework and set to .net framework 4, don't use client profile) you are able to compile windows application using system.web dll's.
if you want do know if you are running a library in an windows application or a web application and want to know if it is possible to use session, do
public virtual bool isweb()
return (system.web.httpcontext.current != null);
public virtual bool issessionenabled()
return isweb() && (system.web.httpcontext.current.session != null)
you can build a class library which contains you need to do references,then public them to gac. then you can both use them in others .net application solution easyly.
- How to read and update external web.config by a c# Windows forms application
- How can I post user name and password from a Windows application to a web page to obtain user-specific content?
- How to call web API URL in C# windows application and get response
- How to get both dynamic numericupdown and textbox values in c# windows forms
- How to do Dependency Injection with Autofac PropertiesAutowired() if the web application has both Mvc and WebApi controllers
- How to compile and run a C# Windows Forms application without visual studio
- How to use dynamic localization in an asp .net web application
- How receive SMS in windows mobile application and put it into the Inbox
- In ASP.NET web forms is it possible to use RDLC Reports and have the ability to place a tick mark/check mark in cells of a particular column?
- How do I run other windows forms while enabling a reference? Once I connect my reference, the application gets stuck on only one form
- How to fix 'Cannot convert from 'string' to System.Data.SqlDbType' in a Windows Forms Application
- How to use correctly use ASP.Net Web API to get and display SQL table?
- How to change c# console code to windows forms application
- Programming in Visual Studio C# Windows Forms and including a NuGet package; How do I find out the namespace to reference?
- How can I create a windows application that should run with admin rights in .Net C# without prompting UAC again and again?
- How do I use C# REST API HttpClient for both Basic header authentication and for default AD credentials?
- I can't find any .NET 4.0 application build with Windows Forms Controls and (or) Infragistics
- How can I use the windows form application on macOS?
- How can I use flip view with multiple item and flip by other button in Universal Windows Platform
- How to configure a wcf service client to use both certificate and username credentials at the message level?
- How to use UserName and Password in Swagger to generate Bearer Token for .NET Web API
- When we create a Web Application project in Visual Studio 2019, but when we open in VS Code and use dotnet cli it gives Microsoft.targets errors
- How can i post both file and text data to web api using asp net core http client?
- How do i retrieve the thumbnail image of a video from mysql database and display it on web application
- How to check checkboxes with "KeyCode"? ( Windows Forms Application )
- How to embed an html file in C# Windows forms application in Visual studio?
- DataAnnotation Attribute in Windows Forms - How to use UIHint Attribute with WinForms
- How to separate UI thread and process thread, in Windows Forms
- How can I use my camera as both VR and normal camera
- How to deploy ASP.NET core web application to IIS on Windows Server 2016
More Query from same tag
- Unity CSharp 2D texture
- Are chunked uploads blocked for personal accounts in the Microsoft Graph API?
- Mainwindow.xaml can not design when open but still drop item from toolbox
- Unity WWWForm unauthorized for azure
- Retrieving the ProductCodes of instance transforms defined inside of an MSI with C#
- C# AvalonEdit Highlighting Regex till new line
- UserObject does not implement the CallbackContractType 'Client.MyService.IMyServiceCallback'
- XML response of webservice call in C#
- How to transfer data from a list to another list
- Xamarin Shell android customize with xml markup
- Load a TreeView from a DropDownList value C# ASP.NET
- How to get the reference of a TextBlock.Text property
- I can't issue a role when the user clicks on reaction
- How can I perform CRUD operations to a specific azure database in my Sql server object explorer and not a default connection database?
- Neo.ApplicationFramework "The name ... does not exist in the current context"
- Visual Studio C# Facebook Graph API can't get user wall
- Logging in a class with an injected logger
- Texture for UnorderedAccessView
- Filtering an Iqueryable object by a group of rules
- Display value of a gridview selected row to dropdownlist
- .NET - How to combine multiple CSV files into one MS Excel file with multiple tabs
- Error in deserializing the XML data in C#
- C# SQLiteDataAdapter Fill Method is slow
- Pass checked checkboxes to controller
- Build a collection of object using EF, C#, linq (Dictionary<string,List<string,string>>)
- What are the requirements for the content parameter in Frame.Navigate?
- Background and Buttons for Login System
- Null Row Cell in GridView with 'Date' type
- Custom .net TCP server