Author Topic: ASP.NET and web servers  (Read 9111 times)

0 Members and 1 Guest are viewing this topic.

Keith Brown

  • Swamp Rat
  • Posts: 601
ASP.NET and web servers
« on: August 13, 2014, 06:08:03 PM »
I was not sure which forum to ask this question so feel free to move if in the wrong place.


I have created a plugin for AutoCAD MEP that uses CryptoLicensing to verify if the user has the right to run the plugin through a license server using asp.net.  I have been able to successfully run the license service on my local machine but have not had any luck with uploading it to my godaddy.com hosting account.  The account is a windows account and uses asp.net 2.0 or 4.0.  Has anyone done anything like this before and might have some pointers for me?  It is all very new to me and i am reading as much from the CryptoLicense website as i can on what to do but do not seem to be having much luck.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: ASP.NET and web servers
« Reply #1 on: August 13, 2014, 10:18:04 PM »
Hi Keith,

Is your hosting a shared hosting services or a VPS (Virtual Private Hosting)?

If it's shared you will probably have trouble running any executable file on the server as it may interfere with the other clients on that server, hosts are very strict on this rule for obvious reasons.
I'm not sure how asp is set up on a server so whether it's an exe or not I don't know but being written in C# it will be an exe or dll which may not be allowed??

A VPS set up gives you full control of what OS you want and what you install, it's a blank VM canvas to do what you will and may be a better option. The other option is to use Azure, windows has done everything they can to make this process easy and you can get some space for free I think.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #2 on: August 13, 2014, 10:59:06 PM »
Hi MickD,


Its a Windows Hosting Service that accepts Active Server Pages.  There is no exe in the visual studio project.  It is a dll.  I have a Lynda.com membership so i am actively watching the ASP videos to try and jumpstart what I know.   


I might look into the windows Azure.  I thought I went there earlier and they wanted money for a site but I will check again.  I was using GoDaddy.com because that is where i host some other things.  I have a linux and a windows server there that I host several sql databases on.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Jeff H

  • Needs a day job
  • Posts: 6150
Re: ASP.NET and web servers
« Reply #3 on: August 14, 2014, 02:22:26 AM »
Keith,
 
For a website with a database I could of stayed up for 4 days then gotten miserably drunk and still deployed website, and created database and connected it to site with azure portal.
 
Microsoft makes it very easy and can make schema and it push to up azure and site.
 
Looks like they added more support azure
http://visualstudiogallery.msdn.microsoft.com/18EB0E24-D2F0-42BD-8903-492569C4EFCD
 

Jeff H

  • Needs a day job
  • Posts: 6150
Re: ASP.NET and web servers
« Reply #4 on: August 14, 2014, 02:33:02 AM »
One more thing Keith,
Just noticed at acad forums but add this to your signature
AutoCAD MEP BLOG

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #5 on: August 14, 2014, 08:51:07 AM »
Hi Jeff,


After reading Micks post last night I went and got a free Azure account and will be checking that out over the next couple of days.  Based on your comments it should work for me and might even be easier to port the licensing database over too.


I also updated my signature to include the blog links.  Guess I will have to start updating it again!  I was planning on doing a customizing AutoCAD MEP with c# series for programming idiots by a programming idiot but might have to rethink that if some of you programming geniuses are watching.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

n.yuan

  • Bull Frog
  • Posts: 348
Re: ASP.NET and web servers
« Reply #6 on: August 14, 2014, 10:07:48 AM »
When you say you have a plugin for licence checking, my understand it is AutoCAD DLL (.NET, possibly)  running inside AutoCAD. Then there is web application that is hosted somewhere that does the actual licence info validation based on the request sent to it and returns the validation result.

In this scenario, the plugin on the AutoCAD side is to gather licence information from user's computer, and then send to the remote web application (most likely, as Http request) and wait the web app on the remote web server responds back (as Http response).

It looks like when you say plugin, it is actually 2 different applications: a) AutoCAD plugin that sends licence info to b) a web app (service) to validate the licence.

Regardless where the web app is hosted, if it is accessed as most web application/website, then your AutoCAD plugin only need to send proper Http request. If the web app allows anonymous access like most public website, then no need to authentication credential. Otherwise you need to provide login information. Since it is hosted on the net, unless your office network is automatically connected with the hosting network via VPN as the same network domain, it is unlikely that Windows authentication can be used. It is really depends on the web application.

Obtaining MS Azure may not help you, if the web application is done by someone else, and only helps you if you are to develop the web application and want to host it with Azure. Still, your plugin need to pass login credential with it web request sent to the web application.

With System.Web/Net namespace, you can make call to remote web application (web services) directly from desktop app (your AutoCAD plugin); with AutoCAD2015, you may even want to try to use JavaScript API. For example, host a simple HTML page in a PaletteSet for user to enter login info and submit the licence valication info. Of course you can do it entirely silently in the background, as long as your plugin knows where the get the login credential (ask user input when the plugin is used the first time, maybe).

Azure provide one month free host trial. Or if you are MSDN subscription member, you can have a free access to Azure with certain resources limits. Well, if you have not done a web app (based on ASP.NET, I assume) before, one month free access to get your own web service for licence validation is certainly not long enough, but the real cost for serious web app hosing is very affordable.

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #7 on: August 14, 2014, 10:29:21 AM »
When you say you have a plugin for licence checking, my understand it is AutoCAD DLL (.NET, possibly)  running inside AutoCAD. Then there is web application that is hosted somewhere that does the actual licence info validation based on the request sent to it and returns the validation result.


yes.  That is it exactly.  I have purchased CryptoLicense to help with the heavy lifting.  It does all the licensing and creates the service for me.  I also followed this ADN Sample from Autodesk to verify that a user bought my software from the exchange website and then send an email to them with activation information.  I have everything working correctly for me on my local machine.  I just need to publish the web app (service) to a internet server.  I have a GoDaddy hosting account that is on a windows server and is running the correct version of ASP.NET (2.0).  I have just been unsuccessful in configuring it correctly.  GoDaddy support is clueless on how to do it also.   Once i understand how to deploy the service manually either on GoDaddy or Azure then i should be ok.  I will just have to modify the code to look to the web instead of my local IIS server.

Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: ASP.NET and web servers
« Reply #8 on: August 14, 2014, 04:26:56 PM »
When you say it doesn't work, are you referring to the fact that it doesn't authorize a legitimate license or that it just will not run?

In my previous job, I had the task of moving an application that used encryption from one server to another. The problem I faced was that the server was trying to use the cryptographic key from the old server. I had to build a new key on the new server and use it. The software that I used tied the encryption to the server where the application was deployed from, thus the data cannot be decrypted successfully on a remote system.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Jeff H

  • Needs a day job
  • Posts: 6150
Re: ASP.NET and web servers
« Reply #9 on: August 14, 2014, 06:23:45 PM »
I believe Keith needs something to host a database and a small service uses database information to validate.
Similar to activating Autodesk products.
 
 

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #10 on: August 15, 2014, 06:07:23 PM »
That is exactly what I want Jeff.


Here were the steps that I took to get this working.


1.  Spent 3 days on GoDaddy trying to get it configured on and off.
2.  Day 4 said a big F*&^ Y(* to GoDaddy and got another service provider.
3.  Spent 5 minutes waiting for Domain Name to transfer.
4. Spent 2 minutes configuring the settings.
5.  Was successfully able to connect to the webservice.


So in total it took me 7 minutes from the minute i purchased the site to get the results i wanted.

Moral of the story is I will never use GoDaddy again to host an ASP site.  It is working fine with my wordpress blog.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: ASP.NET and web servers
« Reply #11 on: August 15, 2014, 10:27:27 PM »
Moral of the story is I will never use GoDaddy again to host an ASP site.  It is working fine with my wordpress blog.

Speaking of GoDaddy and morals ... http://gawker.com/5787676/meet-godaddys-ridiculous-elephant-killing-ceo

Even if their stuff worked I wouldn't use it. I used ICDsoft to host Wordpress before I moved to Wordpress.com - got sick of maintaining it. Glad to hear you got Crypto's service working, I'm also considering it for an AutoCAD plugin if I ever when I get it finished. My other candidate is LimeLM.


MickD

  • King Gator
  • Posts: 3637
  • (x-in)->[process]->(y-out) ... simples!
Re: ASP.NET and web servers
« Reply #12 on: August 15, 2014, 11:56:35 PM »

Another licensing solution I'm using is Infralution, similar to Crypto in function and price. It has an encrypted license key or License Server set up and is pretty easy to set up and use.

I can tie a machine id, cad serial or whatever to the key so it can't be reused in other machines. Happy with it so far.
"Programming is really just the mundane aspect of expressing a solution to a problem."
- John Carmack

"Short cuts make long delays,' argued Pippin.”
- J.R.R. Tolkien

Jeff H

  • Needs a day job
  • Posts: 6150
Re: ASP.NET and web servers
« Reply #13 on: August 16, 2014, 03:22:07 AM »
When of the best things I have done and has worked for me for years is writing really sh**ty code and people seem to shy away or not steal it without my permission.
 
 

CADbloke

  • Bull Frog
  • Posts: 342
  • Crash Test Dummy
Re: ASP.NET and web servers
« Reply #14 on: June 19, 2015, 12:37:37 AM »
... I have purchased CryptoLicense to help with the heavy lifting.  It does all the licensing and creates the service for me.  I also followed this ADN Sample from Autodesk ...

Are you still using Crypto? How is it working out for you?

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #15 on: June 19, 2015, 08:02:41 AM »
I still have crypto and still use it however I am not using the web.  I currently activate my programs using a serial number and machine lock.  This is mainly so employees cannot take the programs elsewhere and use them and it works great for this purpose.


They do seem to be lacking in web activation samples and instructions but that is probably due to me being an extreme novice in ASP.NET and web programming.  Possibly once I delve a little deeper into this realm I will revisit the web activation portion of the code.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013

Keith Brown

  • Swamp Rat
  • Posts: 601
Re: ASP.NET and web servers
« Reply #16 on: June 19, 2015, 08:07:29 AM »
When of the best things I have done and has worked for me for years is writing really sh**ty code and people seem to shy away or not steal it without my permission.


Somehow I did not read this when it was posted and it made me smile.  I seriously doubt that is really the case Jeff.  However if someone was to take a peek at what I write then they would probably be cross-eyed for life.
Keith Brown | AutoCAD MEP Blog | RSS Feed
AutoCAD MEP 2014 / Revit MEP 2014 / EastCoast CAD/CAM addon / Visual Studio 2013