22. November 2008 by Mads

I have thought about this many times, but never had the time to make the research to find an solution.

The problem is that if you put an .asmx (web service) on a web server, it will as the default, be able to show the WSDL information to everybody. This isn’t of cause very good, as anyone then easily can see all methods in the web service. Of cause a web service is typically accessible from the public, as this is where it’s purpose to be used from. Anyways, it’s not good to show the WSDL, so I wanted to remove it.

All you need to do, is to add these lines to your web.config:

<? xmlversion="1.0" encoding="utf-8"?>
<configuration>
<system.web>
                <webServices>      
                     <protocols>        
                           <remove name="Documentation"/>       
                     </protocols>  
              </webServices>
</system.web>
</configuration>

Read the rest of the article from where I found this here: http://www.15seconds.com/Issue/040609.htm

 

26. September 2008 by Mads

Take a look at ScottGu's blog for more info. Getting real close now.

http://weblogs.asp.net/scottgu/archive/2008/09/25/silverlight-2-release-candidate-now-available.aspx

31. August 2008 by Mads

Today I received an email from Softpedia letting me know, that they had added my applications, "DependencyFinder" and "WebMonitor", to their database/site.

I have no idea why, but I think its awesome! :)

Apparently they have tested my applications for spyware etc. so I am now "certified", they wrote:

"Dependency Finder has been tested in the Softpedia labs using several
industry-leading security solutions and found to be completely clean of
adware/spyware components. We are impressed with the quality of your
product and encourage you to keep these high standards in the future.
"

 certified

So now I have two applications on softpedia, sweet.

 

11. August 2008 by Mads

Today I got so mad at my VS 2008 I desided to fix this problem I have had for some time now. I wrote another blog post about it alittle while ago.

TODAY I FINALLY FOUND A SOLUTION TO THE PROBLEM! :)

I found this blogpost about how to fix it. It is actually very easy to do.

Here is what you need to do:

Download "subinacl" here. This is a command-line tool that enables administrators to obtain security information about files, registry keys, and services, and transfer this information from user to user, from local or global group to group, and from domain to domain.

After installing subinacl.exe (it will be in the C:\Program Files\Windows Resource Kits\Tools folder.), drop to a command prompt and run the following batch file, which you have saved in the same folder with the filename "FIX.bat":

subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.vbproj.9.0 /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=users=f
subinacl /subkeyreg HKEY_CLASSES_ROOT\VisualStudio.csproj.9.0 /grant=system=f

 

Enjoy!

 

UPDATE: I just found out that this only solved half my problem :( Before I couldn't create an new Silverproject or add an file to any project at all. I tried out this fix, and it solved the problem where i couldn't add files to an project. Sadly didn't solved my Silverlight problem...need to reinstall Vista I think...

6. April 2008 by Mads

NOTE: I'm so sorry I don't have a code parser on my blog at the moment. This means that the code doesn't look very good. I'm working on an codeparser, but just can't find a working one at the moment. So I desided to do the post, and then clean up the source code in it later. 

In a comment to my blog post about PopTheBubble on silverlight.ne, Jason Schluter asked me for the code to the hi-score in the game. So here goes.

The hi-score actually works pretty simple. The game has a Service reference to a WebService, which lives on the web server ofcause (remember the game lives in the users browser). When the Hi-score UserControl is loaded in the Silverlight application (the game), calls a method called "GetScore" to retrieve the top-50 scores/players. When you type in your name and click submit, another method is called on the WebService to save your score. The score is persisted in an xml file on the server.

HiScore.xaml:

    public partial class HiScore : UserControl
    {
        private int score;
        private ServiceReference1.BubbleHiScoreSoapClient scoreClient;

        public HiScore()
        {
            InitializeComponent();
            score = 0;

            //Hook up with WebService
            scoreClient = new PopTheBubble.ServiceReference1.BubbleHiScoreSoapClient();
            scoreClient.GetScoresCompleted += new EventHandler<PopTheBubble.ServiceReference1.GetScoresCompletedEventArgs>(scoreClient_GetScoresCompleted);
            scoreClient.SaveScoreCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(scoreClient_SaveScoreCompleted);
        }

        public void UpdateScore()
        {
            scoreClient.GetScoresAsync();
        }


        public int Score
        {
            get { return this.score; }
            set
            {
                hiScoreTextBlock.Text = "Your score: " + value;
                this.score = value;
            }
        }

        protected void scoreClient_SaveScoreCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
        {
            UpdateScore();
        }

        protected void scoreClient_GetScoresCompleted(object sender, PopTheBubble.ServiceReference1.GetScoresCompletedEventArgs e)
        {
            hiscoreDataGrid.ItemsSource = e.Result;
        }

        private void submitScoreButton_Click(object sender, RoutedEventArgs e)
        {
            if (!playerNameTextbox.Text.ToLower().Equals("type your name...") && playerNameTextbox.Text != "")
                scoreClient.SaveScoreAsync(playerNameTextbox.Text, score);
        }
    }

 

HiScore.asmx 

        [WebMethod]
        public void SaveScore(string name, int score)
        {
           //Saves the score into a xml file. Original code has been removed.
        }

        [WebMethod]
        public List<HiScoreEntry> GetScores()
        {
            //Get the top-50 hiscores from the xml file. Original code has been removed.
        }

As you can see it's pretty simple, but not very secure. You don't need to be a state-of-the-art hacker to figure out how to cheat here, but this was not my focus with this game. The code in the WebService is just normal C# code reading/writing from an xml file. Please post a comment if you have any questions.