Creating new web application from WSP file - sharepoint-2010

A web application is installed on our sharepoint server. I have the WSP and dll files for the solution but not the source code. I need to make some changes in the code of the webpages of that application so I have to create a new web application with exact same functionality from scratch so that I have full control. How can I use the WSP and DLL files to create a new solution.
I have imported the WSP package in vs2010 and decompiled the dll file to get code behinds of aspx pages.

You can give a shot to tools that reflect on code. You will be able to generate a lot of code OOB using ILSpy. Give it a shot.

Related

Using DLL for web project

I am a little new to VB.NET but I have downloaded and installed VS Express 2012 for web. I created a web application that is fairly simple. One page. mypage.aspx It runs perfect in studio and responses how I would expect.
What I want to do is make it run from the dll. Not from the mypage.aspx.vb. I see the dll for the project in the bin folder.
But when I move mypage.aspx and web.config, and bin with dll to the server it simply says its missing the code behind page. Do I just need to change the reference to the VB file?
If you want to use dll, Go to Build menu in your Visual Studio and click on Publish Web Site
Set Target Location, there your whole project will be get created with dll and without code behind files.
Use this project to deploy on your server.

Getting MVC4 error in Studio 2010 Pro

File C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.5.20902.9026\Modules\NuGet\profile.ps1 cannot be loaded because the execution of scripts is disabled on this system.
I would like to piggyback another :
Why does a new MVC4 project not come with a unit test project? It is not letting me check the box for that.
And one more thing : why is it not including the MicrosoftMVCAjax scripts in the scripts folder?
I am finding I can write a working JSONapp with partial views and callbacks if I have this one from an older MVC2 or 3 project.
Thanks!
You should be able to create check the unit test project check box for the Internet and Intranet project templates.
We are de-emphasizing the use of Microsoft AJAX scripts in MVC templates and instead focusing on the jQuery family of scripts. However, you can still use the scripts if you copy them from an existing MVC 2 or 3 project.

Make changes in wsp file programmatically

What I currently need is to programmatically make certain changes in existing wsp file. Most likely wsp file will be created using "Save site as template" SharePoint action - and I'll need to update it.
What api/approach would you recommend to accomplish this task? Please note that .NET C# is mandatory. Some approaches/questions I could see now:
Do you guys know some 3rd party tool allowing "friendly" object model to work with WSP files? I could not find one.
Do you know is there any special assemblies that could be used for this in WSPBuilder or Visual Studio 2010?
What CAB tool would you recommend? Because it seems there are not so much .NET solutions to work with CAB files.
You can use cablib.dll . Its the same API library which the WSP BUilder uses.
Note that making changes like this programmatically is not recommended and by deploying it might put your server into unsupported mode.
http://www.codeproject.com/KB/files/CABCompressExtract.aspx

Deploying multiple WSP files using a single setup - SharePoint

Is there a tool or method/process to create a package which installs multiple WSP files using a single setup for both SharePoint 2007 and SharePoint 2010?
I don't think there is any setup tool out there which can deploy multiple wsps. So I wrote a custom setup to deploy them.

devenv VS aspnet_compiler

If I use aspnet_compiler to publish an ASP.NET MVC web site, does it do the same tasks that devenv would do? Or is it just pre-compiling to minimize the startup delay?
I.E.
my requirnment is to be able to compile and publish an ASP.NET web site.
in this case, should I use devenv first to build the web site, and then use aspnet_compiler to pre-compile and copy the files over (Publish)?
Or if I just use aspnet_compiler would that also do the building (compiling) of the source and reference projects to relevent dlls?
Your responses are highly appreciated.
Thanks a lot.
Lets start from short answer - aspnet_compiler.exe is not related to ASP.NET MVC.
MVC projects are compiled either by devenv.exe or msbuild.exe or whatever else is out there (Roslyn anyone?). But those 2 are provided with VS installation.
aspnet_compiler is used [in compilation sense] to compile WSP - web site projects. In WSP each code behind is compiled into separate DLL. But MVC projects compile into single DLL like WAP - web application project.
I doubt you have WSP and MVC, and even if you had one - still, it is better compile using devenv because devenv compiles ashx files and aspnet_compiler doesn't. This could lead to failures at runtime.
To understand problem better research on
web site projects vs web application project
Although, I believe in VS15 WSP is gone
I don't know if ther is such thing as aspnet_compiler. Have a look at part of 'Visual C# -> ASP.NET Web Application' project file:
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.\WebApplications\Microsoft.WebApplication.targets" />
First line is standard C# target. Second, is more interesting as it is ASP.NET specyfic. If you look into its content you will find definition of of Publish target and that is probably what you are looking for.
For building and publishing your project you can use (or even just Publish if there are predefined dependencies, I haven't check it)
msbuild /t:Build,Publish <project file>