Compilation into a DLL
-
I've recently started ASP.NET, and am making simple pages (in C#). I have a simple app, with one page - index.aspx, and it's codebehind file index.aspx.cs The index page has an asp label with the id 'myLabel' The page load in index.aspx.cs sets this myLabel to "Hello world". Simple. (basically myLabel.Text = "Hello world") I decided not to go the codebehind way, and instead compile the index.aspx.cs file into a dll. When using .NET Framework 1.1, it all works fine. I put the dll (generated at the cmd prompt by csc /t:library index.aspx.cs) into a bin folder, remove the .cs file, and the app works fine. When I do this in .NET 2.0, I get the following message when trying to compile the DLL: index.aspx.cs(17,13): error CS0103: The name 'myLabel' does not exist in the current context Can someone explain what I'm doing wrong? Am I supposed to do things differently for .NEt 2.0?
ASP - AJAX is SEXY. PERIOD.
-
I've recently started ASP.NET, and am making simple pages (in C#). I have a simple app, with one page - index.aspx, and it's codebehind file index.aspx.cs The index page has an asp label with the id 'myLabel' The page load in index.aspx.cs sets this myLabel to "Hello world". Simple. (basically myLabel.Text = "Hello world") I decided not to go the codebehind way, and instead compile the index.aspx.cs file into a dll. When using .NET Framework 1.1, it all works fine. I put the dll (generated at the cmd prompt by csc /t:library index.aspx.cs) into a bin folder, remove the .cs file, and the app works fine. When I do this in .NET 2.0, I get the following message when trying to compile the DLL: index.aspx.cs(17,13): error CS0103: The name 'myLabel' does not exist in the current context Can someone explain what I'm doing wrong? Am I supposed to do things differently for .NEt 2.0?
ASP - AJAX is SEXY. PERIOD.
you must PUBLISH your website if you want use dll instead of code files go to menu on VisualStudio and find publish...
Human knowledge belongs to the world http://www.rad.pasfu.com/index.php
-
you must PUBLISH your website if you want use dll instead of code files go to menu on VisualStudio and find publish...
Human knowledge belongs to the world http://www.rad.pasfu.com/index.php
I don't think that's the solution. My code works fine in .NET 1.1 I don't have visual studio etc.
ASP - AJAX is SEXY. PERIOD.
-
I don't think that's the solution. My code works fine in .NET 1.1 I don't have visual studio etc.
ASP - AJAX is SEXY. PERIOD.
did you mean this?: Create a DLL without Visual Studio[^]
Human knowledge belongs to the world http://www.rad.pasfu.com/index.php