Simple Website not building - asp.net

I am new to ASP .Net programming. I know C,C++ and C#. I have got the book named ASP.Net 4.5.1 in C# and VB by Imar Spaanjaars.
I have got Visual Studio 2013 ultimate installed as well.
What is bothering me ?
I did exactly as the author told and I getting the errors when building
error. See screen shot.
Any help would be much appreciated.

It seems your project misses some dll in the project bin folder. Could you please check?
Otherwise it may be that you need to configure Nuget, in order to download automatically those missing packages.

Related

Migrate old VB.NET project from VS2013 to VS2017

I have a huge enterprise asp.net application that perfectly builds and runs on servers. We've been using Visual Studio 2013 in our workflow. Now we want to migrate to newer IDEs. But if I build this application in Visual Studio 2017 I'll get this error.
Error BC40004 sub 'PreInit' conflicts with event 'PreInit' in the base class 'Page' and should be declared 'Shadows'.
I think it's a problem with VB compiler version (again vs2013 builds project). Do you have any idea how to fix this?
My solution contains 40+ projects. The main project is asp.net webforms app written in VB.net. Other projects are services and code libraries written in C#.
I tried to specify VB.net version in .vdproj manually. But it didn't solve my problem.
edit: Fine. Thank you all for your responses. I got that problem is about code and that visual studio analyzer has changed a lot in the last few years. I'll try to find out the reasons why this code have been working without exceptions.
BC40004 is a warning, this shouldn't prevent you to compile the solutions unless you set the Treat warnings as errors on the project's property under the tab compilation.

Installed nuget package depends on older version of System.Web.Mvc.dll after Publish

I have an MVC4 application developed with Visual Studio 2010.
Project works fine on IIS Express.
When publishing it to IIS8 and trying to access it I get an exception saying the System.Web.Mvc, Version=3.0.0.0 assembly could not be loaded.
The calling assembly is AttributeRouting.Web.Mvc, which is a NuGet package I use.
The way I understand it, my project referes to version 4.0.0.0 of System.Web.Mvc, while the package I'm using depends on 3.0.0.0.
If Visual Studio/IIS Express can run it perfectly, how come the published version has this problem?
I read a lot only today, but still couldn't figure it out.
Is this what Binding Redirect used for?
I'm kind'a lost here, feeling like I don't really have any direction.
Any advice is welcomed.
Thanks in advance,
Shy.
SOLVED:
I simply (Well it wasn't so simple) installed MVC3 in addition to versions 2 and 4.
Problem disappeared without the need of any further changes.
Solution:
Download and install MVC3 from Microsoft's website.
In case installation failes:
Extract the setup file.
Open ParameterInfo.Xml in an editor.
Remove completely the <Exe> tag that refers to the vs10-kb2483190
file.
Run setup again.
Thank you very much for your help #Augusto.
Hope this helps someone someday :)

VS2013 Scaffolding Error when constructing view

I'm getting a curious error when attempting to generate a view via the 'Add View' dialog. Simply leaving the dialog as is (ie creating view 'View') and hitting 'Add' yields the following error dialog:
Error: There was an error running the selected code generator: 'The Templates/PackageVersions5.0.1xml file is missing from the installed template folder.'
Which I'm afraid means little to me. I've googled the xml file to no avail.
Not really sure where to go now - I'm unable to add views to my project via scaffolding (though I can of course just by 'adding a new item' and building it myself).
How can I track down the source of this error?
Posting here because I ran into the same "file is missing" issue with Visual Studio 2019 and PackageVersions5.2.6.xml. This was one of the only pages I could find related to this scaffolding issue so I suspect others will find their way here too.
I found that upgrading the "Microsoft.AspNet.Mvc" package via NuGet to 5.2.7 was not sufficient to fix the problem. I also had to upgrade "Microsoft.AspNet.WebApi" and its related packages to 5.2.7. The Add View option started working again afterward.
Just make sure you have same version of MVC nugget in all projects, if you only have one project then upgrade/downgrade MVC to different version then revert back to the version you require and issue will get fixed.
I just changed version from 5.2.3 back to 5.2.2 and then reverted back to 5.2.3 and all worked. It appears some file got messed up or and then was restored by this.
I got same issue while using visual studio 2019 community edition, where I am able to create view using visual studio 2017.
After reading answers here, I tried upgrading Microsoft.AspNet.Mvc package, and it works for me.
I'm afraid the rather unsatisfactory solution I arrived at was to create a clean project and import the project elements in, recreating the project from scratch.
I assume that some deep-configuration had become corrupted and I was unable to work out how to fix it.
I ran into the same problem when using a project from VS2013 in VS2015. In my case it was PackageVersions5.1.3.xml that was missing. 5.1.3 seems to be the version of MVC this project was using. I updated MVC to the latest (currently 5.2.3) and this solved the issue.
The XML file should exist in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web\Mvc\Scaffolding\Templates\
I had the same issue. The problem started after installing DevExpress to project. I found that DevExpress installation creates some DevExpress folders in D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions but all necessary files for scaffolding lived in D:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions. I copied the content of extension folder from vs professional to enterprise restart Visual Studio and Scaffolding works again.

Compiling ASP.NET

I'm compiling ASP.NET code for the first time ever and I'm stumped.
I downloaded MINGW-Get and just finished installing it. The client gave me the source code and I found a file called RSConfig.exe.
So I assumed that was the config file, ran it, and then tried "make" but got the error
No targets specified and no makefile found. Stop
Any idea what I'm supposed to do? I don't see anything that would resemble a makefile in the source code.
Thanks in advance!
Do yourself a favour and install Visual Studio Express:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
It makes development easier and fast
It sounds like you might want to get familiar with the background concepts around asp.net and it's defacto development environment Visual Studio (there are many versions of visual studio).
As Andrei recommends, using Visual Studio Express is a good free way of getting started. The version most suited for web development is Visual Web Developer Express.
Attempting to compile .net code from a toolset such as MinGW isn't a typical route for using asp.net, however I've not used MinGW before and not sure it's possible to compile .net code from it.... Although it is perfectly possible to compile .net code from the command line (using the .net framework sdk) , I certainly wouldn't recommend it if you are getting started.
I'm going to make a guess that it is an ASP.net web forms project, it being the most prolific asp.net project type at the moment.
This official asp.net site http://www.asp.net/web-forms will guide you through what web forms are and how to get the development environment setup. Having this sort of background will aid you in solving your particular situation.

How to build the MVVMToolkit from source code?

I'd like to understand the proper way to build the MVVM toolkit from the source files on codeplex for a WP7 sample app. I've got the source associated with codeplex changset 47157 by lbugnion Apr 18 at 10:42 AM 1300 associated with Release: MVVM Light Toolkit V3 SP1 (2).
I've got VS2010 and Windows Phone Developer tools installed. I see the VS10 dir that presumably contains the VS2010 solution files. Do I just open that .sln file in VS2010 and build all? The distributed binaries contain versions of the dlls suffixed with WP7. I don't see those version of the dlls generated when I build the VS10 solution file.
Thanks,
Peter
There seems to be a problem with the WP7 bits. Unfortunately they are missing from the VS10 folder and are instead in the old GalaSoft.MvvmLight folder. Plain and short, I messed up. The "old" folder was historically the root. When I added projects for SL4 and WPF4, I did so in the VS10 subfolder (not my brightest idea). And when I added WP7, I apparently did so in the wrong folder. This is really weird.
I have a flaky internet connection in the moment (I am on the road) so I won't be able to fix the issue before a couple of days. I made a note and will fix the CodePlex code base ASAP. More info will be given on my blog http://blog.galasoft.ch.
Cheers,
Laurent
If you're using Visual Studio 2010 the solution you should open is source\VS10\GalaSoft.MvvmLight\GalaSoft.MvvmLight.sln. The Silverlight projects may not open if you don't have the Silverlight Tools for Visual Studio installed. Don't worry about this if you're only building the WP7 version of the toolkit assemblies. The solution structure is confusing at first because it uses linked file references.
Actually, now that I look at the VS10 solution, it doesn't look like there are any WP7 files under the structure. I think you're correct, and the Visual Studio 2010 solution doesn't build the Windows Phone 7 assemblies.

Resources