Hi
I wanna start working with ASP.NET with C# but want to do it in ubuntu.
I have installed mono and XSP2 but have some problems and questions.
The instructions I followed for installing XSP2 is this page.
But when I type "sudo apt-get install asp.net2-examples" in terminal, I get:

Package asp.net2-examples is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
asp.net-examples

E: Package 'asp.net2-examples' has no installation candidate

So I installed "asp.net-examples" instead.
Then I type "xsp2 –root /usr/share/asp.net2-demos/" but the result isn't the one shown in the page. I should just type xsp2 to get:

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

But then, when I go to 127.0.0.1:8080 in my browser, I get:

Application Exception
System.Web.HttpException
The resource cannot be found.

Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Details: Requested URL: /
Exception stack trace:
at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0
Version Information: 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1); ASP.NET Version: 2.0.50727.1433

What should I do?

Another question, How can I start a project?

And the last one: The latest ASP.NET version is 4.5, but with mono and XSP2, I have to work with ASP.NET2. Will I have compatibility problems if I want to work on codes written by others on windows with ASP.NET4.5?

Thanks

For both cases, I get the same error as before(application exception) with different Exception stack traces!

Have you tried using Wine? Documentation

sudo apt-get install wine

Are you suggesting me to install Visual Studio using wine?
Doesn't seem safe to me!

I get the same error as before(application exception) with different Exception stack traces!

Ok, can you show these exceptions?

For example, the first exception you posted is an HTTP 404, this is the reason why I suggested you to check the default value for the index pages of the web server: in some cases it can be default.aspx instead of index.aspx, which does not match with the contents of /usr/share/asp.net-demos/. Don't you have a file like web.config or machine.config to define this value?

For "http://127.0.0.1:8080/", the exceptions are:

at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.Tick () [0x00000] in <filename unknown>:0

For "http://127.0.0.1:8080/index.aspx" :

at System.Web.Compilation.BuildManager.AssertVirtualPathExists (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web.VirtualPath virtualPath, System.Type requiredBaseType) [0x00000] in <filename unknown>:0 at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0

for "http://127.0.0.1:8080/2.0/index.aspx","http://127.0.0.1:8080/1.1/index.aspx" the same as the last one.

Then I type "xsp2 –root /usr/share/asp.net2-demos/" but the result isn't the one shown in the page. I should just type xsp2 to get:

Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /usr/share/asp.net-demos
Hit Return to stop the server.

By typing xsp2 –root /usr/share/asp.net2-demos/ you should get the error:

Error: Directory "/usr/share/asp.net2-demos/" not found.

Because /usr/share/asp.net2-demos/ does not exists, when installing asp.net-examples you get /usr/share/asp.net-demos/, this is the correct path. Instead, by using only xsp2 (without arguments) the server sets the root to the current directory, for example, here I'm trying from /tmp/:

xsp2
Listening on address: 0.0.0.0
Root directory: /tmp
Listening on port: 8080 (non-secure)
Hit Return to stop the server.

So, try with:

xsp2 –root /usr/share/asp.net-demos/

It should work, requesting: http://127.0.0.1:8080/ from the browser. Then, if you want, you can start applications by creating a config file, as the example in /etc/xsp2/debian.webapp:

xsp2 --appconfigfile /etc/xsp2/debian.webapp

Or by defining the path for the application:

xsp2 --applications http://localhost:8080:/samples:/usr/share/asp.net-demos

For more information run xsp2 -h and man xsp2, bye!

When I type "xsp2 -root /usr/share/asp.net2-demos/" or "xsp2 -root /usr/share/asp.net-demos/" in terminal, I get the same thing that is shown when I type "xsp2 --help".
I wasn't paying attention to the current directory so my paths were wrong.
But I now have another problem. For testing, I made an asp.net project on my desktop using monodevelop. I changed nothing and everything in that project is as the monodevelop creates it.
Then I typed "xsp2" in the terminal and then in the browser, I typed "http://127.0.0.1:8080/Desktop/workspace/test/test/Default.aspx".

Now I get the following:

Application Exception
System.Web.Compilation.ParseException
Cannot find type test.Global

Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error.

Details: Cannot find type test.Global

Error origin: Parser

Error source file: /home/shayan/Desktop/workspace/test/test/Global.asax
Exception stack trace:
at System.Web.UI.BaseParser.ThrowParseException (System.String message, System.Object[] parms) [0x00000] in <filename unknown>:0 at System.Web.UI.TemplateParser.SetBaseType (System.String type) [0x00000] in <filename unknown>:0 at System.Web.UI.TemplateParser.ProcessMainAttributes (IDictionary atts) [0x00000] in <filename unknown>:0 at System.Web.UI.TemplateParser.AddDirective (System.String directive, IDictionary atts) [0x00000] in <filename unknown>:0 at System.Web.UI.ApplicationFileParser.AddDirective (System.String directive, IDictionary atts) [0x00000] in <filename unknown>:0 at System.Web.Compilation.AspGenerator.GetInheritedType (System.String fileContents, System.String filename) [0x00000] in <filename unknown>:0 at System.Web.Compilation.AspGenerator.GetRootBuilderType (System.IO.Stream inputStream, System.String filename) [0x00000] in <filename unknown>:0 at System.Web.Compilation.AspGenerator.CreateRootBuilder (System.IO.Stream inputStream, System.String filename) [0x00000] in <filename unknown>:0 at System.Web.Compilation.AspGenerator.InitParser (System.IO.TextReader reader, System.String filename) [0x00000] in <filename unknown>:0 at System.Web.Compilation.AspGenerator.Parse (System.IO.TextReader reader, System.String filename, Boolean doInitParser) [0x00000] in <filename unknown>:0 at System.Web.Compilation.GenericBuildProvider1[System.Web.UI.TemplateParser].Parse () [0x00000] in <filename unknown>:0 at System.Web.Compilation.GenericBuildProvider1[System.Web.UI.TemplateParser].get_LanguageName () [0x00000] in <filename unknown>:0 at System.Web.Compilation.TemplateBuildProvider.get_LanguageName () [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildProviderGroup.AddProvider (System.Web.Compilation.BuildProvider bp) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManagerDirectoryBuilder.AssignToGroup (System.Web.Compilation.BuildProvider buildProvider, System.Collections.Generic.List`1 groups) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManagerDirectoryBuilder.Build (Boolean single) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.BuildInner (System.Web.VirtualPath vp, Boolean debug) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.Build (System.Web.VirtualPath vp) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.GetCompiledType (System.Web.VirtualPath virtualPath) [0x00000] in <filename unknown>:0 at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath (System.Web.VirtualPath virtualPath, System.Type requiredBaseType) [0x00000] in <filename unknown>:0 at System.Web.UI.PageParser.GetCompiledPageInstance (System.String virtualPath, System.String inputFile, System.Web.HttpContext context) [0x00000] in <filename unknown>:0 at System.Web.UI.PageHandlerFactory.GetHandler (System.Web.HttpContext context, System.String requestType, System.String url, System.String path) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url, Boolean ignoreContextHandler) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication.GetHandler (System.Web.HttpContext context, System.String url) [0x00000] in <filename unknown>:0 at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () [0x00000] in <filename unknown>:0
Error source context:

Error lines: 1, 1
1: <%@ Application Inherits="test.Global" %>
Version Information: 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1); ASP.NET Version: 2.0.50727.1433
Powered by Mono

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.