Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
uXs
May 3, 2005

Mark it zero!
Found this about WPF and MVVM: http://blog.lab49.com/archives/2650 and the video linked in there still works. I wish the video quality on the code samples was better, but the content (to me at least) seems very, very good.

It's taken me from having basically no clue about WPF to having a handle on how to make an MVVM application with WPF in about 1.5 hours. I realize there's a shitload more to learn but at least I feel like I have a very good base now to start from. Highly recommended viewing!

Adbot
ADBOT LOVES YOU

uXs
May 3, 2005

Mark it zero!

wwb posted:

Yes, they are vastly different beyond some surface similarities as to similar languages. Especially with Option Strict on. The best place to start is http://www.asp.net/get-started , that is probably one of the few sites still doing examples in VB.Net though -- most of the world has gone C#. You might wish to do the same.

I think you misunderstand, he wants to learn classic ASP, not .NET.

uXs
May 3, 2005

Mark it zero!
Anyone have any experience connecting to Sharepoint services?

Problem I'm having is that when I start my application and it connects to the service, it gets the reply: the remote name could not be resolved: 'localhost'. But when I then use a browser to go to the wsdl on the server, and then run my application again, connecting to the service does work. Any ideas?

Edit: when I download the wsdl in my program first (with WebClient), it works too. But only when I set the Credentials to the DefaultNetworkCredentials.

uXs fucked around with this message at 14:15 on Jul 16, 2014

uXs
May 3, 2005

Mark it zero!

Betjeman posted:

Can't say specifically about Sharepoint, but this stopped us dead trying to intiialise an old web service on a new machine yesterday:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/6550f476-9c8c-4056-a153-2074fa2f6993/error-cs2001-cs2008

The response we were getting was "cannot resolve <servername>" as well.

Fix was to give permission for the asp.net process to modify the Windows/Temp directory.

E: wrong url

That... looks like a completely different problem?

uXs
May 3, 2005

Mark it zero!

Betjeman posted:

The problem happened to us (and again, may be completely different to your problem, I'm not sitting at your desk) that the call to the web service was not reporting the actual error, but instead simply failing at the attempt to connect to the web service in teh production environment. Only sticking in shitloads of trace code to try and find out what the problem was revealed the error.

The symptom was the same, that I could access a web service from a browser, from SoapUI, from anywhere but the app installed in an IIS environment. You said you can connect if using different credentials, so your problem does suggest it's a permissions issue?

E: sorry misread the bit about it working from a browser then working from your application. Maybe your browser is accessing via different credentials, and therefore creating whatever files the web service connection needs to be in the temp directory?

Yeah I think I'll mess around with the credentials some more. But if I can't find it easily I'll just download the wsdl on application startup to circumvent the problem.

uXs
May 3, 2005

Mark it zero!
Question about installing a vNext (or whatever its name is) website on IIS 7:

I have a site that works locally, both in IIS Express as in the full version, that I can't get to work on a server. It keeps giving me an "HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory." error. (I obviously don't want it to list the contents of the directory, I want it to give me my website.)

Other websites, made in previous versions of .Net (4.5) do work. I copy/pasted another website in the wwwroot of my new vNext website and that worked right away.

I installed .NET 4.6 on the server too, to no avail.

Any ideas?

edit: just discovered that vNext probably requires IIS 7.5. At least that's what my server told me when I enabled directory browsing and tried to browse to the Views folder.

uXs fucked around with this message at 16:44 on Jun 11, 2015

uXs
May 3, 2005

Mark it zero!
Doing some vNext stuff and running into the following:

In earlier version of .NET, different configurations for different environments could be handled by config transforms.

In vNext, those are gone, and you're supposed to use environment variables (ASPNET_ENV for example) to check for the environment and load the correct config file. But what are you supposed to do if you require multiple configurations on the same server?

We have a test IIS server where we put (at least) 2 test copies of our website: one for internal testing and one for user testing. At the very least those use different databases and thus database connections. I can't use the environment variables to differentiate between configs because those are server-wide.

Any ideas? I could manually gently caress around with the deployment and just delete the config files that it shouldn't use, but that's stupid.

uXs
May 3, 2005

Mark it zero!

RangerAce posted:

Environment variables are not really server-wide. In IIS, you can set environment variables at just about any level of configuration using the <environmentvariables> config element. You should be able to set a variable for each site, and then use that thusly: http://stackoverflow.com/a/26478436/221648

That's a fastCgi thing and isn't read by asp.net.

uXs
May 3, 2005

Mark it zero!

RangerAce posted:

What about setting up different users for each site and have the different sites use different app pools that run as different users? Then, you should be able to set ASPNET_ENV differently for each user.

Too much magic that just floats around and can't easily be seen by looking in (text) files.

uXs
May 3, 2005

Mark it zero!

Boz0r posted:

Now I've got another problem. I'm trying to get this Entity Framework to work with my database. Right now, I've added a couple of objects via code, but when I want to retrieve them, I just get an empty collection.

code:
public ViewResult Index()
{
	using (var ctx = new DatabaseContext())
	{
		ctx.Areas.Add(new Area("First"));
		ctx.Areas.Add(new Area("Second"));
		ctx.Areas.Add(new Area("Third"));
		ctx.SaveChanges();
	}

	IEnumerable<Area> areas = productRepository.Areas;

	return View();
}
What did I do wrong?

You're returning a view without any data.

uXs
May 3, 2005

Mark it zero!
What would be a good way to add data to EF7 migrations? Say if I want to have a table that should contain a few options and I want to add them right after that table is created.

Do I just add the data in code to the 'Up' method in the migration?

uXs
May 3, 2005

Mark it zero!
About half of you are ignoring the '7' part of my EF question, because there are no seed or populate mechanics in EF 7 yet.

I couldn't really do it in the 'up' method either, because I don't have a reference to the context and I really don't want to use plain SQL.

I ended up putting it all in a method somewhere and just call that from application startup. Maybe/probably it will have to change later but it works fine for now.

uXs
May 3, 2005

Mark it zero!
NSubstitute!

uXs
May 3, 2005

Mark it zero!
Has anyone gotten xunit to work with vnext? I have a project in vnext and it doesn't work for me.

Two paths I tried:

Add the test project as a vnext class library, with "Class Library (Package)". Tried to install xunit and xunit.runner.dnx, but when I try to run 'dnx . test' (or dnx . xunit.runner.dnx), I get a nullreference exception. Most likely this is a version conflict between dnx and the xunit version, which I tried to resolve by getting ever more bleeding edge versions of xunit and the dnx libraries it requires, but nothing I tried works.

Other try was to add the test project as a normal class library, and add references to xunit and xunit.runner.visualstudio. This made a bogus test (Assert.True(true);) appear in the VS Test Explorer window, but then I get problems when I try to add references to the other (vnext) projects in my solution. Instead of adding a reference to the project I have to add a reference to the .dll it makes, and I also need references to a bunch of other crap (mostly EF libraries) that start to conflict with each other and make the entire thing refuse to build.

So, anyone able to actually make it work, and if so, how exactly? Preferably completely in vnext.

uXs
May 3, 2005

Mark it zero!
I have a service that receives JSON messages from a queue.

The format and content of this message can vary and change over time, so I can't deserialize the entire thing into an explicitly defined .NET object.

What's the best/easiest way to add a property to this message?

The standard libraries seem most concerned with deserializing and reserializing the entire JSON object, which is something I want to avoid if it all possible.

Adbot
ADBOT LOVES YOU

uXs
May 3, 2005

Mark it zero!

NihilCredo posted:

Do you mean a .NET property, or a JSON property?

In either case, you could deserialize it to a dynamic JObject. If you want an extra .NET property, make a subclass of JObject with the extra property. If you want a JSON property, just call the .Add(String, JToken) method.

A JSON property. I need to add it to the message and then send it back on another queue.

I think I've got it working with what you said + casting the JObject to a dynamic to add the property. Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply