aspnet_compiler ASPParse Could Not Load Type - aspnet-compiler

I am unable to build my Web Application (not Web Site) in our build environement. We use DMAKE in our build environment (this unfortunately is non negotiable, therefore using MSBUILD is not permitted ) and when invoking the asp.net precompiler through
C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_compiler -d -nologo -p Site -f -fixednames -errorstack -v / Debug
We get the following error
error ASPPARSE: Could not load type 'X.Y.Admin.Site.Global
If I compile from the ide it is successful. If i then compile with aspnet_compilier it is successful. So i only get a successful compile with aspnet_compiler when the target dll i am trying to compile is in the bin of the web application i am compiling.
I keep running into postings that talk about solutions using MSBUILD which unfortunately I cant try.
Any help would be appreciated

We had the same problem on our web application:
error ASPPARSE: Could not load type '...'
The problem was that we had the file on disk (on the project folder) but it wasn't included in our application project (in the .csproj file). We solved the problem by including the file in the project :)

I ran into a similar problem using NANT. The trick was to compile the web applications code files into a dll then include that when using aspnet_compiler.
use the command line compiler,either csc.exe (c#) or vbc.exe (visual basic), to compile your web application with an output of type library. This will create a dll that you can use in your aspnet_compiler task

Have you tried specifying the path using -p? Sounds to me like it can't find that type / assembly.
http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx

For web applications, you have to build the .vb files into a dll and put that in the bin folder before you run the aspnet compiler. Check the output window in visual studio and you'll see the command line for the VB compiler. Run that first before you run the aspnet compiler, and the asp pages should be able to find the missing types.

This problem was resolved for me by simply deleting all bin and obj folders. Seems like they were in a bad state somehow. I also deleted the the .sou file, but I don't think that was the issue.

I received the same problem.
I fixed it by copying my webapp's DLL from the OBJ/DEBUG folder to the BIN folder.

I just had this error and found 2 ways to fix it, either:
Change the Codebehind attribute in the global.asax file to CodeFile and add "partial" to the class declaration
In the deployment project's property pages, set "Version output assemblies" and provide a version number
I don't really know why either worked, but it did.

solution :
-p Site path must have the directory path of .csproj file location.
ex :-
aspnet_compiler -p D:\Projects\MGM\mgm\mgm -v / D:\Projects\MGM-deploy\mgm_compiled

Related

FileNotFoundError: [Errno 2] No such file or directory selenium\\webdriver\\remote\\getAttribute.js'

I'm working with selenium. The script is in :
C:\Users\User\Desktop\Data Analytics Arg\Proyectos\datademia\Py_install\py_ejemplo.py . Venv is activated and chromedriver.exe is in C:\Users\User\Desktop\Data Analytics Arg\Proyectos\datademia\Py_install\chromedriver.exe
The script runs perfectly. Then I created an only .exe-file via terminal :
pyinstaller --add-data "chromedriver.exe;." --windowed --onefile py_ejemplo.py
Folders are created correctly (build and dist). The .exe file (py_ejemplo.exe) was created, but when I try to run it, I get this message:
I've been looking and still can't solve it... I've tried these solutions :
filenotfound
but didn't work for me...Could someone help me? I donĀ“t know what's wrong...
Thanks in advance
I got the same problem but I was working with Firefox and geckodriver.
In my case, I copied the selenium folder from the virtual environment to the dist folder and it worked.
There are a few things you should ensure when packing a script with pyinstaller build with selenium web driver.
It may require to add driver executable when building. I.e. chromedriver.exe
It may also require to add some package files related to selenium such as getattributes.js file when building. It was required at my project.
pyinstaller will extract those files to temp folder in AppData for windows users. So in your code, your relative paths may require to be resolved with a sample function as below (if you are running your code in vs code or you are running through pyinstaller executable the paths should be resolved by function).
For item 1 and 2, you can use --add-binary and --add-data features of pyinstaller for each of them. It is also possible to do this in *.spec file with add-files list, following your first running of pyinstaller (see this explanation) I preferred command-line option as below.
pyinstaller ./app.py --onefile --noconsole --add-binary "./driver/chromedriver.exe;./driver" --add-data "C:\Users\YOUR_USER_NAME\.conda\pkgs\selenium-3.141.0-py38h2bbff1b_1000\Lib\site-packages\selenium\webdriver\remote;selenium\webdriver\remote"
For item 3, to resolve relative paths in your source code, you can use below function in related places (for example when accessing chromedriver.exe)
def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except Exception:
base_path = os.path.dirname(__file__)
return os.path.join(base_path, relative_path)
Use above function once you need to access packaged executables and files in your source code. In below example, my chromedriver is inside driver folder in my workspace. But when it is accessed through pyinstaller executable, it will be extracted to temp folder in AppData, yet function will access it through sys._MEIPASS variable set by pyinstaller.
driver = webdriver.Chrome(executable_path = resource_path('./driver/chromedriver.exe'))
Hope it works.

MSDeploy Auto Generated deploy.cmd path issue?

I've been working on trying to figure out why our auto-generated deploy.cmdscripts will not work when installed to C:\Program Files (x86)\OurProgram. I finally narrowed down the issue to the closing parenthesis in (x86) as the script would terminate with "Files was unexpected at this time". One possible solution was to manually create another batch file to set _DeploySetParametersFile to a Windows path ( C:\Program^ Files^ (x86^)\OurProgram\Program.Parameters.xml). This isn't a valid solution for me, so I dug into the auto generated file and found the issue to be 2 variables:
RootPath
_DeploySetParametersFile
Both of which were referenced using %'s(i.e. %RootPath%), however as soon as they were changed to !'s(i.e. !RootPath!), no 2nd script was needed and I can run the cmd script from Program Files (x86) just fine. The issue of course with this is, the deploy.cmd file is auto-generated on each build, thus I have to change it for each build I do. My question is this: Is there a way to edit the template Visual Studio uses to generate the deploy.cmd file? If so, where? It seems so ridiculous that Microsoft would have this be an issue in their web deployment.

Cannot install appx through graphic installer

I'm facing a problem right now and I don't really know how to get more informations about it.
I've converted a desktop application through Microsoft's Desktop App Converter, made some manual modifications about the visual assets, and rebundled it through "makeappx.exe". Then I signed it.
Everything went fine. Except that when I double click the appx to check it, I have the following window:
Appx Error
Which roughly translates as "Couldn't open the appx or appxbundle file" and "Reason: Failure caused by an unknown reason".
This does not helps me a lot :/
However, if I try to install the package through a simple "Add-appxpackage MyPackage.appx", it works perfectly fine.
Could anyone help me find some leads on what's happening here? I've already checked the event viewer as explained here but I couldn't find anything unusual.
Thanks,
Skefrep
It seems the Microsoft team has taken notice of this problem and investigated this appropriately.
-Here is their solution-
The problem can be because when you convert an app with DesktopBridge the resources are signed with the manifest info and store that info in the .pri files you found in PackageFiles folder. Later, when you change something like the Publisher or the Name this signature doesn't match. To fix this you only need to recreate the .pri files.
rm *.pri. Remove the old .pri files.
cd C:\foo\PackageFiles\. Change current directory to the PackageFiles folder. This step is important for the next step.
makepri createconfig /cf priconfig.xml /dq en-US. Create a configuration file for the resources.
makepri new /pr "C:\foo\PackageFiles" /cf "C:\foo\PackageFiles\priconfig.xml". Generate the new *.pri files.
Then you can make the package as usual: MakeAppx, etc.
You can find more information about this problem in "Failed due to unknown reasons" error when you try to sideload a Desktop Bridge app - App Consult Team.

how to Step through Catel code while debugging ?

After adding Catel implementation to one of my views(mainPage) in my project I have a bug that crashes my Silverlight project. The only indication I have is :" A first chance exception of type 'System.NullReferenceException' occurred in Catel.MVVM " (just about after setting the RootVisual~) - I can't find what I'm doing wrong, and since I am planing on a long-term relationship with Catel I thought that stepping through Catel code might come in handy, so I tried and failed in all the following steps (any help will be appreciated.. because currently I'm stuck and can't find anything):
downloaded catel 3.9 source files (same as my nuget package) and tried building it.. failed with this error :
E:\Dev\Catel-3.9.0\src\Catel.Core\Catel.Core.SL5\Fody.targets(51,5): error MSB4036: The "Fody.WeavingTask" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "E:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" directory. - trying to search and figure the reasons and overcome this, lead me to nowhere. :(
i have followed this "Stepping through the code" instruction in Catel documentation but noting really happened (I'm using VS2010..is this an issue ?? )
I read this article & readme.md at : https://github.com/GeertvanHorrik/GitHubLink about using GitHubLink to help you stepping through Catel code while debugging. I downloaded the release GitHubLink 1.3.0 from https://github.com/GeertvanHorrik/GitHubLink/releases/tag/1.3.0 ... but running this even with just the githublink.exe -help flag had thrown a exception..
I downloaded the Githublink-master source files but 0 projects were loaded (the GithubLink project file is incompatible with the current version of VS - I'm using VS2010)
can anyone help me either shade some light or:
overcome the build error I receive for catel (no.1)
instruct me how to set & step into catel ?
share the pdb files for Catel libs
It completely depends on the version you are using. If you are using the latest official one (3.9), stepping through the code is only possible by cloning the master branch and building the PDB files yourself.
In the latest prerelease versions via NuGet (the upcoming 4.0 version) you only have to enable the source server checkbox.
Note that you should never have to use GitHubLink yourself, that is for developers only (we run it during the build of Catel).
About the Fody task: it looks like the NuGet packages have not yet been restored on your side. In the lib folder there is a RestorePackages.bat which you can run to restore the packages.
I tried debugging on VS2012 and using Catel 4 pre-release (from Nuget)..
although I believe I did all the right things & settings in VS, I didnt get much further..
So I Opened (using a bin editor) the pdb file that was pulled by Nuget with the DLL, and took a look at the bin file.
the file have strings pointing to the source files at this directory :
C:\ci_ws\WS\1629\source\catel\src\catel/mvvm\catel.mvvm.shared..
So I have created a tree that starts with
c:\ci_ws\ws\1629\source
and downloaded the catel folder to that dir, renamed it from
"Catel-Develop" to just "Catel" in order to feet the location the pdb pointed.
To get things going I also had to add a "Symbol File(.pdb) location" in VS
option-> settings->Debugging->Symbols..(location/server list) to where the nuget download the packages.
in my case.. SolutionFolder\Packages\Catel.MVVM.3.9.0.1406062245-beta\lib\sl50..(I'm using Silverlight)
and then I was able to load the symbols and step/break into the code successfully ..
Maybe I missing something and there is a better way, but this the only way that worked for me..
The only question that still remains for me now is : What is the name of the Catel Github source branch that is matching the pre-release dll and pdb that Nuget is publishing at the moment (3.9.0.1406062245) ?
(I unchecked the general debug settings of : require source files to exactly match the original version)

How do I use Microsoft.Build.BuildEngine to Build a Silverlight project?

I am using the Microsoft.Build.BuildEngine to build a number of projects. Projects that do not use Silverlight are building correctly while projects that do use Silverlight are not building. All of these projects (Silverlight and non-Silverlight) all build fine through Visual Studio 2008. I get the error message:
error CS0234: The type or namespace name 'SilverlightControls' does not exist in the
namespace 'System.Web.UI' (are you missing an assembly reference?)
I've added System.Web.Silverlight to the project that is doing the build using Microsoft.Build.BuildEngine. I am able to see that namespace in the project doing the build also (so it appears that the project doing the build does have access to System.Web.UI).
Any ideas on how I can avoid that error?
Turned up the verbosity on the build through VS2008 and compared to the log created from the Microsoft.Build.BuildEngine. It looks like the Microsoft.Build.BuildEngine is producing lines like:
Considered "c:\Program Files\Reference Assemblies\Microsoft\Framework
\v3.5\System.Web.Silverlight.dll", but it didn't exist.
It doesn't exist in that location, should it? There are actually a number of locations that it looks for that dll and doesn't find it. I added the reference by right clicking, add reference, .Net, add. There doesn't appear to be a System.Web.Silverlight.dll on my machine (which is odd because the project does compile using VS2008).
Comparing the possibly relevant sections of the two logs:
Microsoft.Build.BuildEngine
For SearchPath "{GAC}".
Considered "System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL", which was not found in
the GAC.
Visual Studio 2008
System.Web.Silverlight, Version=2.0.5.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
Manually added System.Web.Silverlight to the path that the Microsoft.Build.BuildEngine was looking for it (coppied it from the output directory when I build the project via VS2008). This solved that problem, but I now get the following errors on the Silverlight components of the solution:
C:\Program Files\MSBuild\Microsoft\Silverlight
\v2.0\Microsoft.Silverlight.Common.targets(95,9): error : The Silverlight 2 SDK is not
installed.
Any ideas?
In the application that is running the Microsoft.Build.BuildEngine I changed the type of build from Any CPU to x86. This has now made the application be able to build the target as expected.
So you're programmatically building using the MSBuild APIs?
It may be useful to add an ILogger (e.g. that just prints to the console) to engine.Loggers, and compare the output with the output window in VS (after setting e.g. 'tools\options\project & solutions\build & run\msbuild output verbosity' to verbose)... seems like somehow the environment is causing assemblies to resolve differently?
Set build type of project to Any. This helps. Happy coding...

Resources